OpenWrt Forum Archive

Topic: Need help on building kamikaze + asterisk

The content of this topic has been archived between 18 Apr 2018 and 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I managed to build the latest Kamikaze with svn, but have problems with "asterisk".

My configuration:
- Dell XPS  M1330 (2.5G) with Windows Vista
- Ubuntu 7.10 under VMWare 6 ACE (this is my develpment plateform)

How I did ?

Under Ubuntu: svn co https://svn.openwrt.org/openwrt/kamikaze/trunk kamikaze-7.09
I made apt-get to install differents libaries needed.

In the kamikaze-7.09 folder, I made a "make menuconfig" then selected squashfs image with 2.6 kernel. I saved.

I launched the make "make -j2 world V=99"

After one hour, I got my image in the kamikaze/bin folder.

I installed this new image on my asus WL-500GP then asterisk 14.18 from Zandbelt built "http://members.home.nl/hans.zandbelt/op … kaze/7.09/"

Installation stepo is ok.

BUT
----
If I simply started asterisk like that it is ok: "asterisk -cvvvvvv" asterisk seems running ok,
but when I statred: "asterisk &" or "asterisk" I d only 3 asterisk daemons running
----
883 root       3932 S   asterisk
884 root       3932 S   asterisk
885 root       3932 S   asterisk
----
and when I did "asterisk -r" I got this message :
----
root@OpenWrt:~# asterisk -r
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
root@OpenWrt:~#
-----

I do not know what is wrong in my kamikaze compiling/building. I already try with asterisk 1.4.9 and got same thing. Idem when I built others kamikaze releases.

Could anyone suggest me a solution ? On howto build correctly kamikaze ?

When building kamikaze, I tried it with different users, with different permissions of kamikaze folder but always got the same result.


Thanks.

palexy91.

The latest trunk i tried that worked more or less 100% with my wl-500gp was r9770.
All the later versions has segfaulted or given me some strange errors or something.
Here's an image if ur interested. http://donagrejja.com/temp/WRT/flashing … uashfs.trx
It's 2.6 kernel using Atheros Wifi.

No idea ?

Could anyone kindly give me an image for test ? The image on the openwrt website is old and the "segmentation fault" is not resolved. This latter resolved with the "Random segfaults -- Fixed in SVN 9285" release. "http://wiki.openwrt.org/OpenWrtDocs/Har … %28asus%29".

Thanks.

palexy91 wrote:

root@OpenWrt:~# asterisk -r
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
root@OpenWrt:~#

I sure am very glad to see someone has encountered such a problem. AFAIC and I may be wrong, it has something to do with pthread. I am sure Zandbelt knows this issue but fails to respond to fix it. Anyway, I got mine fixed with some quick hack as shown on my response here.

Thank Mazi,

It's very glad that people who know how to fix the problems do not share their idea. I wonder if there are others people in my situation ? Or how they do for building kamikaze ?

Palexy91.

Mazi, I followed your hack and asterisk seems to run like what you show in your post. But I think adding "-v" option makes asterisk consumes more CPU time. Am I right ?

mazilo wrote:

I sure am very glad to see someone has encountered such a problem. AFAIC and I may be wrong, it has something to do with pthread. I am sure Zandbelt knows this issue but fails to respond to fix it. .

well since you apparently must have the right on support from me I would like to point out that you fail to response to the question no 1. "does /var/run/asterisk.ctl exist?" Question no. 2 would be: "what does your /etc/default/asterisk look like?"

Hans.

Hans,

You are our master on Asterisk+Openwrt, have you any idea why this error occurs ? Personaly I used a lot your work and thank so much for your good job. I show you my /etc/default/asterisk file:

## startup options for /etc/init.d/asterisk

ENABLE_ASTERISK="yes"
OPTIONS="-vC /etc/asterisk/asterisk.conf"
------------------------------------------------------

Thanks.

palexy91 wrote:

Hans,

You are our master on Asterisk+Openwrt, have you any idea why this error occurs ? Personaly I used a lot your work and thank so much for your good job. I show you my /etc/default/asterisk file:

## startup options for /etc/init.d/asterisk

ENABLE_ASTERISK="yes"
OPTIONS="-vC /etc/asterisk/asterisk.conf"
------------------------------------------------------

Thanks.

thanks for the answer on question number two...

Hi Hans,

I deleted the "-v" option in the /etc/default/asterisk file then rebooted my openwrt, I got the following message with "ps":

SW< [usb-storage]
  772 root       1928 S   /usr/sbin/dropbear -p 22
  775 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  776 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  777 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  781 root       2412 S   /usr/sbin/httpd -p 80 -h /www -r OpenWrt

Then I checked the "asterisk.ctl" in /var/run and I did NOT found it. No asterisk.ctl in /var/run.

Here the answer of the first question.

palexy91 wrote:

Hi Hans,

I deleted the "-v" option in the /etc/default/asterisk file then rebooted my openwrt, I got the following message with "ps":

SW< [usb-storage]
  772 root       1928 S   /usr/sbin/dropbear -p 22
  775 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  776 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  777 root       3932 S   //usr/sbin/asterisk -C /etc/asterisk/asterisk.conf
  781 root       2412 S   /usr/sbin/httpd -p 80 -h /www -r OpenWrt

Then I checked the "asterisk.ctl" in /var/run and I did NOT found it. No asterisk.ctl in /var/run.

Here the answer of the first question.

now we're in business ;-)
some more questions:
what are the contents of your /etc/asterisk/asterisk.conf?
does asterisk function at all (since apparently it runs)?
if yes, is the only problem that 'asterisk -r' does not work?

For the record: the 3 processes you see are actually 3 threads but because of the threading implementation used on your OpenWRT platform they are listed as processes in the output of 'ps'.

Hans.

(Last edited by zandbelt on 12 Mar 2008, 21:01)

zandbelt wrote:

now we're in business ;-)

Thank you.

one more question: what are the contents of your /etc/asterisk/asterisk.conf?

Since my Fonera hasn't been modded to use an external storage (SD card), the asterisk-1.4.18 is installed in the original directories as seen below:

root@Fonerisk:/tmp# cat /etc/asterisk/asterisk.conf 
[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /usr/lib/asterisk
astdatadir => /usr/lib/asterisk
astagidir => /usr/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run
astlogdir => /var/log/asterisk

;[options]
;verbose = 3
;debug = 3
;alwaysfork = yes ; same as -F at startup
;nofork = yes ; same as -f at startup
;quiet = yes ; same as -q at startup
;timestamp = yes ; same as -T at startup
;execincludes = yes ; support #exec in config files
;console = yes ; Run as console (same as -c at startup)
;highpriority = yes ; Run realtime priority (same as -p at startup)
;initcrypto = yes ; Initialize crypto keys (same as -i at startup)
;nocolor = yes ; Disable console colors
;dontwarn = yes ; Disable some warnings
;dumpcore = yes ; Dump core on crash (same as -g at startup)
;languageprefix = yes ; Use the new sound prefix path syntax
;internal_timing = yes
;systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues
;maxcalls = 10 ; Maximum amount of calls allowed
;maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit
;cache_record_files = yes ; Cache recorded sound files to another directory during recording
;record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)
;transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly
;runuser = asterisk ; The user to run as
;rungroup = asterisk ; The group to run as

; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl
root@Fonerisk:/tmp#

BTW, how did you patch asterisk-1.4.18 so that it will compile on OpenWRT? My asterisk-1.4.18 on my Fonera running on OpenWRT SVN trunk is based on some your asterisk-1.4.11 patches and an additional patch I created to link to openntpd-3.9p1/openbsd-compat/bsd-getifaddrs.c file.

Here is my asterisk.conf file :

[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /usr/lib/asterisk
astdatadir => /usr/lib/asterisk
astagidir => /usr/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run
astlogdir => /var/log/asterisk

;[options]
;verbose = 3
;debug = 3
;alwaysfork = yes ; same as -F at startup
;nofork = yes ; same as -f at startup
;quiet = yes ; same as -q at startup
;timestamp = yes ; same as -T at startup
;execincludes = yes ; support #exec in config files
;console = yes ; Run as console (same as -c at startup)
;highpriority = yes ; Run realtime priority (same as -p at startup)
;initcrypto = yes ; Initialize crypto keys (same as -i at startup)
;nocolor = yes ; Disable console colors
;dontwarn = yes ; Disable some warnings
;dumpcore = yes ; Dump core on crash (same as -g at startup)
;languageprefix = yes ; Use the new sound prefix path syntax
;internal_timing = yes
;systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues
;maxcalls = 10 ; Maximum amount of calls allowed
;maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit
;cache_record_files = yes ; Cache recorded sound files to another directory during recording
;record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)
;transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly
;runuser = asterisk ; The user to run as
;rungroup = asterisk ; The group to run as

; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl
~

Thanks

Sorry, forgot to answer 2d question:

" does asterisk function at all (since apparently it runs)?
if yes, is the only problem that 'asterisk -r' does not work?"

No, asterisk did not run at all, I made a "asterisk -r" and I got :

root@OpenWrt:/etc/asterisk# asterisk -r
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
root@OpenWrt:/etc/asterisk#

I tried to make a call or received a call from my mobile, nothing. Very strange.

you mentioned that it does run from the commandline, with:

  /usr/sbin/asterisk -cvvv -C /etc/asterisk/asterisk.conf

is that correct? and if you run the above command in one terminal, and in another terminal run:

  /usr/sbin/asterisk -r  -C /etc/asterisk/asterisk.conf

does /var/run/asterisk.ctl then exist? and does asterisk then work?

Hans.

Hans I got this:

root@OpenWrt:/etc/asterisk# /usr/sbin/asterisk -r -C /etc/asterisk/asterisk.conf
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
root@OpenWrt:/etc/asterisk#

palexy91 wrote:

Hans I got this:

root@OpenWrt:/etc/asterisk# /usr/sbin/asterisk -r -C /etc/asterisk/asterisk.conf
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
root@OpenWrt:/etc/asterisk#

and this is with the other terminal running:

  /usr/sbin/asterisk -cvvv -C /etc/asterisk/asterisk.conf

right (Q1)? and does asterisk then work (Q2)?

Hans.

(Last edited by zandbelt on 12 Mar 2008, 22:33)

With this command:

  /usr/sbin/asterisk -cvvv -C /etc/asterisk/asterisk.conf

Yes, asterisk is running. I confirm.

*CLI> [Jan  1 01:49:03] NOTICE[876]: ..............

palexy91 wrote:

With this command:

  /usr/sbin/asterisk -cvvv -C /etc/asterisk/asterisk.conf

Yes, asterisk is running. I confirm.

*CLI> [Jan  1 01:49:03] NOTICE[876]: ..............

but, in another terminal, at the same time, this command is not working

  /usr/sbin/asterisk -r  -C /etc/asterisk/asterisk.conf

, right (Q1)? and /var/run/asterisk.ctl does not exist, right (Q2)?

Hans.

Q1) In the same time and on another terminal, I typed "  /usr/sbin/asterisk -r  -C /etc/asterisk/asterisk.conf" I got:

root@OpenWrt:~#/usr/sbin/asterisk -r  -C /etc/asterisk/asterisk.conf
Asterisk 1.4.18, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.4.18 currently running on OpenWrt (pid = 870)
Verbosity is at least 3
[Jan  1 01:55:43] NOTICE[879]: chan_iax2.c:5316 register_verify: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OpenWrt*CLI>

Q2) I verified in /var/run on another terminal

---------------------------------------------------
root@OpenWrt:~# ll /var/run/
drwxr-xr-x    2 root     root          160 Jan  1 01:48 .
drwxrwxrwt    8 root     root          260 Jan  1 01:48 ..
srwxr-xr-x    1 root     root            0 Jan  1 01:48 asterisk.ctl
-rw-r--r--    1 root     root            4 Jan  1 01:48 asterisk.pid
-rw-r--r--    1 root     root            4 Jan  1 00:00 dnsmasq.pid
-rw-r--r--    1 root     root            4 Jan  1 00:00 dropbear.pid
-rw-r--r--    1 root     root            4 Jan  1 00:00 eth0.1.pid
-rw-r--r--    1 root     root            4 Jan  1 00:00 motion.pid
root@OpenWrt:~#

Asterisk is running...

so if you now run:

  /usr/sbin/asterisk -C /etc/asterisk/asterisk.conf

in one terminal, and in the other:

  /usr/sbin/asterisk -r  -C /etc/asterisk/asterisk.conf

it does not run right (Q1)? And which version of asterisk 1.4.18 do you use: a self-compile one, or the one from my repository (Q2)?

Hans.

Frankly speaking, if you try to run asterisk without a -v switch, you will only see three asterisk processes are running and any attempt to run rasterisk and/or asterisk -r will end up with the error messages saying Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)

Hans,

Q1) Yes, asterisk does not run with the 2 commands.

Q2) I use your build asterisk 1.4.18 in your repository.

Hans,

I read somewhere that this problems could generate by the manner that one build/compile the Openwrt. Note that I used Ubuntu under VMWare 6 ACE as my development platform for building the image. It's a week now I tried to find a solution ....

palexy91 wrote:

Hans,

Q1) Yes, asterisk does not run with the 2 commands.

Q2) I use your build asterisk 1.4.18 in your repository.

I just found out that I went over disk space quota for the website when uploading the atheros repository, and some files were truncated to 0 bytes because of that. I cleaned up some space and uploaded the atheros repository again.
Please reinstall at least libpthread (was truncated to 0 bytes), libpopt, libncurses and asterisk14 and try again.

BTW: I did get a clear warning from ipkg, telling me that the md5sum was incorrect; didn't you get that (Q1)?

I just did an install on a "clean kamikaze 7.09" and it works just fine for me, so I reckon this is where your problem comes from.

Hans.