My experience in installing Asterisk on WRT54GS

 I followed the post on Asterisk on OpenWRT: Asterisk on OpenWRT part 2. Now, I report my process and problems here.

  • vi /etc/ipkg.conf (see updated info)
  • src whiterussian http://downloads.openwrt.org/whiterussian/packages
    src acvs http://12.176.248.4/ipkg
    dest root /
    dest ram /tmp

  • ipkg update
  • ipkg install asterisk-cvs
  • vi /etc/asterisk/modules.conf (slim modules)
  • [modules]
    autoload=yes
    noload => pbx_gtkconsole.so
    ;load => pbx_gtkconsole.so
    noload => pbx_kdeconsole.so
    noload => pbx_dundi.so
    noload => app_intercom.so
    ; load => chan_modem.so
    noload => res_musiconhold.so
    noload => chan_modem.so
    noload => cdr_pgsql.so
    noload => cdr_mysql.so
    noload => chan_alsa.so
    ;noload => chan_oss.so
    [global]
    ; chan_modem.so=yes
  • Set asterisk startup (see update info)
  • Please see below problems I got in the installationi process.
    1. When I run ipkg update, I got the following errors:

    root@OpenWrt:/etc# ipkg update
    Downloading http://openwrt.org/ipkg/Packages
    wget: openwrt.org: Unknown host
    Downloading http://12.176.248.4/ipkg/Packages
    wget: Unable to connect to remote host (12.176.248.4): Network is unreachable
    Downloading http://nthill.free.fr/openwrt/ipkg/stable/Packages
    wget: nthill.free.fr: Unknown host
    Downloading http://nthill.free.fr/openwrt/ipkg/testing/Packages
    wget: nthill.free.fr: Unknown host
    Downloading http://www.wildcatwireless.net/wrt54g/Packages
    wget: www.wildcatwireless.net: Unknown host
    An error ocurred, return value: 5.
    Collected errors:
    ipkg_download: ERROR: Command failed with return value 1: `wget –passive-ftp    -q -P /tmp/ipkg-mWFahm http://openwrt.org/ipkg/Packages’
    ipkg_download: ERROR: Command failed with return value 1: `wget –passive-ftp    -q -P /tmp/ipkg-mWFahm http://12.176.248.4/ipkg/Packages’
    ipkg_download: ERROR: Command failed with return value 1: `wget –passive-ftp    -q -P /tmp/ipkg-mWFahm http://nthill.free.fr/openwrt/ipkg/stable/Packages’
    ipkg_download: ERROR: Command failed with return value 1: `wget –passive-ftp    -q -P /tmp/ipkg-mWFahm http://nthill.free.fr/openwrt/ipkg/testing/Packages’
    ipkg_download: ERROR: Command failed with return value 1: `wget –passive-ftp    -q -P /tmp/ipkg-mWFahm http://www.wildcatwireless.net/wrt54g/Packages’
     

    Run route -n, I saw that gateway was 0.0.0.0.  I’m actually using it behind my dlink router which has LAN ip 192.168.0.1. So I changed WRT ip to 192.168.0.100 with gateway 192.168.0.1. My computer is connected to one LAN port on WRT. Another cable connect another LAN port on WRT to dlink LAN port.

    You could do it manually using the following commands or in the GUI:

    nvram set lan_ipaddr=192.168.0.100
    nvram set lan_gateway=192.168.0.1
    nvram set lan_dns=192.168.0.1
    where 192.168.0.1 is your gateway address
    if you use WAN connection, use the same command with  wan_gateway and wan_dns

    Then when I run “ipkg install asterisk-cvs” to install asterisk, I got an error “src openwrt http://openwrt.org/ipkg is unreachable”. But it seems asterisk was installed properly.

    2. When I run asterisk, I got the same problem as in the comment of the post:

    asterisk: can’t load library ‘libgcc_s.so.1′

    and

    asterisk: can’t load library ‘libssl.so.0.9.7′

    ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.0.9.7

    and

    ln -s /lib/libc.so.0 /lib/libgcc_s.so.1

    This solved the problems.

    3. When I try to register user 3000 on asterisk server, I got an error message: Username/auth name mismatch.

    In sip.conf, host = dynamic instead of host = xx.xx.xx.xx solved the problem.

    4. Unable to connect to remote asterisk, can’t access to CLI with asterisk -r

    Receiving the following error message:
    Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)

    /var/run/asterisk.ctl does exist and asterisk is running.

     The problem was:

    Edit your asterisk.conf file: /etc/asterisk/asterisk.conf

     then add these lines to it or just uncomment them if already exist.

     [files]
    astctlpermissions = 0660
    astctlowner = asterisk
    astctlgroup = pbx
    astctl = asterisk.ctl

    5. For the voicestick registering problem, I followed the post: http://www.asteriskextras.com/index.php?option=com_content&task=view&id=13&Itemid=2I will copy the post later.Comment by alen — February 4, 2007 @ 1:38 am | Edit This

    Problems continued:

    6. pap2 couldn’t register
    nat = yes
    problem solved.
    5. 503: service unavailabe
    I have sip.conf:[3000]
    type = friend
    context = default
    username = 3000
    host = dynamic
    mailbox = 3000
    dtmfmode = rfc2833
    nat = yes

     

    and

    [3001]
    type = friend
    context = default
    username = 3001
    host = dynamic
    mailbox = 3001
    dtmfmode = rfc2833
    nat = yes

    extension.conf:

    [internal]
    exten => 3000,1,Dial(SIP/3000,30,Ttm)
    exten => 3000,2,Playback(invalid)
    exten => 3000,3,Hangup
    exten => 3001,1,Dial(SIP/3001,30,Ttm)
    exten => 3001,2,Playback(invalid)
    exten => 3001,3,Hangup

    Result:
    3000 is fine.
    3001, I got 503: service unavailable

    Don’t know why. 

    Update:

    http://zandbelt.dyndns.org/asterisk.html

    asterisk for whiterussian has been taken down. Asterisk for OpenWRT is now obsolete.

    Kamikaze is now the official OpenWRT stable version. But it’m not sure if Kamikaze has a version for wrt54gs v1.0 v2.0 2.1.

    In the links in http://lestblood.imagodirt.net/archives/106-Asterisk-on-OpenWRT-part-2.html, only http://12.176.248.4/ipkg is still available.

    I put the following in the /etc/ipkg.conf:

    src libncurses http://download2.berlios.de/pub/xwrt/packages
    src acvs http://12.176.248.4/ipkg
    dest root /
    dest ram /tmp

    It seems it works. Or use the openwrt download links.

    src whiterussian http://downloads.openwrt.org/whiterussian/packages
    src non-free http://downloads.openwrt.org/whiterussian/packages/non-free
    src acvs http://12.176.248.4/ipkg
    dest root /
    dest ram /tmp

    Start Asterisk automatically at startup

    Add a simulink /etc/init.d/S60asterisk to asterisk

    ln -s asterisk S60asterisk 

    Then  put the following content in /etc/default/asterisk.

    vi /etc/default/asterisk:

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

    ENABLE_ASTERISK=”yes”
    OPTIONS=”"

    I checked later. It seems that if I make a simulink S99asterisk, it’ll work without vi /etc/default/asterisk: ln -s asterisk S60asterisk .

    For authenticate methods, please check here: http://blog.nyworldphone.com/2008/02/06/how-to-authenticate-users-by-callerid/.

    Sphere: Related Content

    2 Responses to “My experience in installing Asterisk on WRT54GS”

    1. New York World Phone » Blog Archive » Install Asterisk Resources Says:

      [...] My experience in installing Asterisk on WRT54GS [...]

    2. alen Says:

      http://www.mail-archive.com/gnhlug-discuss@mail.gnhlug.org/msg12997.html

    Leave a Reply