• Home
  • About
  • Metaphysical Farms

Asterisk on OpenWRT part 2

Lest Blood Be Shed

Cultivating community so that we may join in our human family in a way that is sustainable and filled with love for all creation. More »

Asterisk on OpenWRT part 2 March 10. 2005




There has been a lot of interest in the geek-world about being able to have a complete telco (more than just a PBX) system on hardware that costs less than $80US. In that vein, it seems like Saint Joseph's College is the heart-beat of that movement and my blog which outlines a simplified how-to install the bugger is getting a lot of attention out in the blogosphere. Because of this (and some question I have received) I thought I would put together a more formal and informed "howto" for installing Asterisk on a Linksys WRT GS box (I think it works for the G but I don't have one to test).

This is the wiki entry for Asterisk on OpenWRT.



Hopefully with this entry, I will be able to describe how to setup (in more detail than last time) a linksys wrt-gs router to run the openWRT firmware and install Asterisk to allow you to have a SIP phone and an outbound carrier. To accomplish this you will need to following things available to you:

  • a real computer
  • a linksys wrt router
  • a copy of the openWRT firmware (on the real computer)
  • a connection to the Internet
  • some sort of SIP phone/phone interface (I use a Cisco ATA 186 in the example)

    Now that you have all that let's get started.

    Step 1:

    The first thing you will need to do is install the openWRT firmware onto the Linksys router. This is a fairly simple process and is describe in great detail on the openWRT website. Because it is so well documented their, I won't take the time to repeat the content here. Some thing you should be wary of when you do attempt the firmware install for the first time (I just say this because it catches me almost every time I try to do a fresh firmware install) is that you definitely need an IP address on the WAN port of the router before things will start working right. Once you have the firmware installed you can telnet into the openWRT box. Before we start with any actual Asterisk stuff you will most likely want to secure your box. If you have your WAN port "plugged into the Internet," you can download and install the sshd (dropbear).
  • ipkg install dropbear

    Test to see that you have ssh access to the machine then disable the telnet access by removing the telnet daemon startup script.
  • rm /etc/init.d/S50telnet

    If you want ssh access to be available from your WAN port (from the Internet) you will either need to remove the firewall (not recommended but it's what Brian Capouch does) or alter the firewall to allow for this type of connection. In the /etc/init.d/S45firewall file all you need to do is add the line "$IPT -t filter -A INPUT -p tcp --dport 22 -j ACCEPT" after the rule for icmp traffic. I like to install other packages (ntpclient, crond) but they are not necessary. You can look at what is available with the ipkg tool and see if you need anything. Be mindful of your disk space. Asterisk is going to take up a lot of space.

    Step 2:

    At this point you should have a working openWRT box with a (working) connection to the Internet. The next step is to prepare to install Asterisk and actually do the install. Fortunately, there are a lot of geeky people working on getting Asterisk and openWRT working and they have made this process as easy as using the ipkg tool to install the software.

    The first thing that needs to be done is to change the /etc/ipkg.conf file to point at the sites that have the Asterisk packages available.

    src openwrt http://openwrt.org/ipkg
    src acvs http://12.176.248.4/ipkg
    src nico http://nthill.free.fr/openwrt/ipkg/stable
    src nico-t http://nthill.free.fr/openwrt/ipkg/testing
    src ab0oo http://www.wildcatwireless.net/wrt54g
    dest root /
    dest ram /tmp


    The first line is where all the standard packages are located. The second line (site acvs) is where you can get the asterisk-cvs package. This package is maintained by Brian Capouch and is updated frequently. Sometimes the cvs packages are unstable but if they are Capouch usually has the it fixed right away because he uses them in his own WRT boxes. He has been doing a lot of testing on the jitter buffer as well as the database backend for Asterisk-cvs. I'm using the cvs and have no problems. The other sites are where you can pick up the "stable" version of Asterisk as well as other packages.

    You will need to update the ipkg local listings before you can install asterisk-cvs.
  • ipkg update
  • ipkg install asterisk-cvs

    The Asterisk install will install other packages that it depends on and may take some time. You might also have problems getting the list of packages from nthill.free.fr, just keep trying until their name resolution works.

    Once you have Asterisk installed you need to make a few changes to the configuration to allow the software to run on the openWRT box. Basically, what you will be doing is "slimming" the modules that are loaded for Asterisk. The file that allows you to do this is located at /etc/asterisk/modules.conf. There are a number of combinations that will work on the Linksys router but I've tried to make the running software as slim as I can get it without loosing too much functionality. Here is what my config looks like sans-comments.

    [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


    Now that you have Asterisk slimmed down you can start up the server. Simply type 'asterisk' on the command line and if all has gone well you will be running Asterisk on an openWRT. You can check the status of your Asterisk software by using the Command Line Interface (CLI). To enter the CLI you just type 'asterisk -r' on the command line. You can change the verboseness of the interface by changing options within the CLI.
  • set verbose 100000
  • set debug 100000

    It will help you tremendously to learn the syntax for the CLI.

    Step 3:

    Now, that you have Asterisk up and running (reliably) you will most likely want to connect VoIP equipment to it. To accomplish this you will want to become familiar with the syntax of sip.conf, iax.conf and extensions.conf. In this step I'll talk about connecting a SIP phone.

    I'm currently using an Cisco ATA 186 as my SIP phone interface and so that is what I will show how to connect. The process should be similar for most other SIP phones and is really not all that difficult.

    I like to have the Asterisk server setup and ready before I configure the phone itself but from my work with the ATA 186 it doesn't matter which one is setup first just as long as they know about each other at some point. To configure Asterisk to recognize your SIP phone you need to edit the /etc/asterisk/sip.conf file. There are a lot of options in the sip.conf and you should look at them and see if you need to change anything (like the bind interface ip address) all in all, though, the defaults should work. I add my phones at the end if the file just so they are out of the way. To setup a SIP phone you need to add a "preamble" that contains your phone description and configuration options. Here is what my phone section of the sip.conf file:

    [daveata186]
    ; Cisco ATA 186 - Living Room
    type=friend
    context=home
    host=dynamic
    user=your_username
    secret=your_secret_password
    canreinvite=no
    callerid=David DeLauro<219-866-XXXX>
    disallow=all
    allow=ulaw


    The first line separates one configuration section from another. I like to add a comment letting me know what kind of phone this configuration is for as well as where I can find the phone. The "type" line identifies what type of relationship the phone will have to your Asterisk server. 'friend' basically means the relationship will be bi-directional. The "context" is where "phone stuff" will be sent when Asterisk looks in its extensions.conf file for dialplans. The "host" is the IP address of the phone. Because I have DHCP running and the IP address of the phone is potentially dynamic I let Asterisk know it should use the IP address that the phone itself registers with. The "user" and "secret" are the credentials that you will use between the phone and Asterisk. The user entry needs to be the same as what you have setup as the preamble (what's between the []). It just makes things 1000 times easier if they are exactly the same. When you setup the phone you will want to make sure these options match otherwise your phone won't have access to the Asterisk server and vise-versa. The "callerid" is self-explanatory. The "disallow" and "allow" lines have to do with the type of codec the communication paths will use between the phone and the Asterisk server. Codec are one of the points that problems can occur with Asterisk and cause poor call quality. So, setting the right codec (especially on these low cpu power machines) is crucial. I have found that 'ulaw' between the phone and the Asterisk server works best (given they are on the same LAN) and for the openWRT installs 'gsm' works best for calls that leave the LAN and go over the Internet. The WRTs to well transcoding (once) between these two codec. With the two last lines you are preventing Asterisk from talking to the phone with any other codec than 'ulaw'

    The next thing you need to do is let asterisk know about the changes you have made in the sip.conf file. You can do this by using the CLI again and giving it the command "reload" This will force asterisk to re-read it's configuration files. Now you can configure your SIP phone to talk to the Asterisk server. The configuration for the Cisco phone was fairly simple. There was a webpage where I could enter in all the options I needed to get it talking to Asterisk. For whatever phone you have you will most likely need the username and password you setup in the SIP configuration and the IP address (192.168.1.1 by default) you setup for the Asterisk server. Once the phone reboots it should register itself with the Asterisk server. I believe you ca watch the registration process from the CLI if you have the 'debug' and 'verbose' options set high but I've never done it. I usually check to see if it's working by picking up the phone and seeing if there is a dial-tone.

    Step 4:

    Now that you have your phone talking to Asterisk you need to setup and outbound phone call carrier. There are may different places that offer this service but for simplicity my example will be of a connection to NuFone. With most of the companies out there they will be using a different protocol than what your phone uses. This protocol, IAX, is configured on the Asterisk server in the /etc/asterisk/iax.conf file. The configuration file is very similar to the sip.conf file and should be no problem to configure by now. After you have registered with a carrier and received a username and password you can get started configuring Asterisk to allow for that connection. Here is what my iax.conf entry looks like:

    [NuFone]
    type=peer
    user=your username
    host=switch-1.nufone.net
    secret=your password
    disallow=all
    allow=gsm
    ;allow=ulaw
    callerid="David DeLauro"<219866XXXX>


    You can see that the format is very similar to what you setup in the sip.conf file. The only things that really have changed are the "host" entry which is the IP address of the carrier's server and the "type." A type "peer" indicates that your Asterisk server will be contacting their server but not vice-verca. You will also notice that instead of 'ulaw' as the codec, I'm using 'gsm.' Now all you have to do is "reload" your Asterisk server from the CLI and you will have made two connections for your Asterisk server to use.

    Step 5:

    You may be asking, "But how do I use them?" Good question! This is where the magic of Asterisk starts to happen and where the learning curve starts to get a little steeper but this is where you will have to most phun with your fone! It is the /etc/asterisk/extensions.conf file. This is where you tie all of the channels you have just created together to do "cool stuff"(tm) for you. I'm only going to show you some simple examples of things you can do but there is so much more. Here is a section of my extensions.conf file that allows you to make a call from the SIP phone you have setup to the IAX channel (the NuFone example) you have available.

    [nufoneout]

    exten => _9XXXXXXXXXX,1,StripMSD,1
    exten => _N.,2,SetCallerID(David DeLauro<(219) 866-XXXX>)
    exten => _N.,3,Prefix,1
    exten => _1N.,4,Dial(IAX2/NuFone/${EXTEN})

    [home]

    exten => _9XXXXXXXXXX,1,Goto(nufoneout|BYEXTENSION|1)


    What happens when you make a call from your SIP phone is as follows:

    1. "Call" enters the [home] context.
    2. The pattern _9XXXXXXXXXX is matched and is sent to the [nufoneout] context
    3. The number is matched again and one number (9 in this case) is removed.
    4. The callerid is reset
    5. A "1" is appended to the dial string.
    6. The number is dialed (sent) to the [NuFone] server.


    This is just a simple example of what you can do to make a call using your IAX channels. You could set the configuration up so that when you dial the phone instead of dialing a 9 you dial a 1 and it would seem as if you were using a real telco phone. Another possibility is to have multiple companies and based on the prefixed number you could use a different company to place your outbound calls. There are countless combinations

    Once you have finished playing in extensions.conf you will need to let Asterisk know about the configuration changes but instead of having Asterisk reload all of it's configurations you can tell Asterisk to only reload the extensions.conf file. In the CLI give the command "extensions reload". If you have the debug/verbose turned up you will see all of your new extensions put into place. After you have reloaded your extensions configuration keep the CLI open in a window, pick up the phone and try and dial you local physical telco line. It's always a trip having two phones in your ear and talking to yourself :-).

    You now have a working outbound Asterisk server. Setting up inbound calling is just as simple. You'll need to add a "register" line to your iax.conf file to announce to your inbound VoIP carrier where you are on the internet as well as setup a preamble for the incoming relationship type ("type=user"). You will also need to setup a new extension for your SIP phone. All of which would be easy now that you have setup the outgoing connections.


  • | Top Exits (0)

    Vote for articles fresher than 14 days!
    Current karma: 3, 2 vote(s) 379628 hits
    David  Thursday, March 10. 2005 @ 10:52
    70 Comments Link to entry

    Trackbacks
    Trackback specific URI for this entry

    No Trackbacks

    Comments
    Display comments as (Linear | Threaded)

    I have a WRT54 GS 1.1, running the experimental build openwrt (13th March, 2.4.29 Kernel) but on this version of openwrt, Asterisk's SIP interface fails to initialise :o(, stating IP address cannot obtained. Also, to get Asterisk-cvs running from Brian Capouch's packages you need the postgress libraries installed as Brian uses Postgress as the database for the call accouting system. If anyone has solution to the SIP problem, please let me know :o)
    #1 Les on 2005-03-21 03:35 (Reply)
    You have to have the hostname/IP of the WRT in /etc/hosts if you intend to use SIP. That has been true for some time.

    The res_config_pgsql.so module requires the Postgres library, indeed, but if you specify that it not be loaded in modules.conf, it will run even without them.
    #1.1 Brian Capouch on 2005-03-21 12:54 (Reply)
    Thanks Brian :-)

    I sort of cheated with my sip issue with asterisk on openwrt. Rather than binding to all interfaces bind = 0.0.0.0, specifing the internal IP brought up the interface. As you suggested, IP address etc. were in the /etc/hosts file. However thanks for the postgress module tip. Searched for it but obviously like the SIP problem, missed it due to lack of sleep :-(

    Cheers

    Les
    #1.1.1 Les on 2005-03-21 15:41 (Reply)
    I have one WRTP54G (2 voice ports). Can I use these 2 local voice ports] in OpenWRT+Asterisk to make and receive calls from local TELCO ???

    Thanks,
    Evandro

    http://evandro.net/
    http://evandro.net/poker/
    http://www.poker-regras.com/
    #1.2 Evandro (Homepage) on 2007-10-29 20:07 (Reply)
    First off, is there a better forum for communicating issues? Is there an existing forum that Asterisk OpenWrt users are already using?

    Second, THANKS! I'm still impressed that I can run asterisk on this hardware. Thanks for all of the hard work making this a reality.

    Third, has anyone seen any segmentation faults with this package? I'm running package 1.0.5-1 and am getting segfaults whenever * tries to native bridge two sip calls. Has anyone experience this, or know a way around it?

    -- Chris
    #2 Chris Higgins on 2005-03-21 20:06 (Reply)
    I wish I had more time to devote to this and be more helpful. Perhaps someone at some point will start an actual forum for the WRTs and we can collect things there . . . in the meantime, this is what we've got, I'm afraid.

    Nicolas Hill maintains the stable packages; I only do CVS-HEAD. Because it's CVS, sometimes it isn't as stable as people would like. But this is where things are happening, and where all the really nifty features of Asterisk are to be found.

    I have two SIP phones, running CVS head in file .26 on my server, and the SIP stuff works perfectly.

    I just built a new version a few minutes ago which I am now testing. It includes the res_config.mysql.so module, so that people can use that DB as their backend with the realtime engine.

    This version also has the new jitterbuffer, which for me greatly increases sound quality in lossy environments.

    I'll be moving over the current CVS build, into file .28, tomorrow.
    #2.1 Brian Capouch on 2005-03-22 01:41 (Reply)
    Thanks!

    Evandro
    http://evandro.net/tiss/
    http://evandro.net/pagerank/google.html
    http://www.casinopokerforum.com
    #2.2 Evandro (Homepage) on 2008-01-17 08:59 (Reply)
    Someone has tried G729 in asterisk into a WRT54G?

    I have purchase licences for G729 but wonder if I can place it into WRT.


    Regards

    Humberto
    #3 Humberto A on 2005-03-22 02:28 (Reply)
    In an effort to lend what little I can to the conversation, I have phpBB set up on my site and just created a forum for OpenWRT, so if people want to discuss it there they are more than welcome.

    Here is a link to the forum directly http://www.mcnelis.biz/talk/viewforum.php?f=13, or you can find it by going to http://talk.mcnelis.biz.
    #4 David M (Homepage) on 2005-03-22 11:08 (Reply)
    you don't need to be whoring your site out on my blog McNelis.

    Do you even have an openWRT with asterisk box? :-)

    peace brother!
    #4.1 David (Homepage) on 2005-03-22 11:57 (Reply)
    Pot (to Kettle): "Hey whore!"
    #4.1.1 Justin (Homepage) on 2005-03-22 13:29 (Reply)
    Anyone have any ideas on getting asterisk to email voicemail from the wrt54g? the setup in asterisk isn't bad, but i am having trouble finding and setting up sendmail...
    #5 Dalon Westergreen on 2005-04-12 22:47 (Reply)
    There is a thread on the openWRT forum about using a "tiny" version of sendmail that you can get as an ipk and install on the WRT. Then you can just email out all of the voicemails instead of worrying about storage problems.

    You can also get the NFS ipk and mount an NFS drive on the WRT for voicemail.

    Orrrrr, a third option is to move the vm stuff onto ramdisk (/var on the standard openWRT distro) each time it boots, and then periodically watch the size or move the older messages onto archives, etc.
    #5.1 Brian Capouch on 2005-05-10 17:47 (Reply)
    I'm beginer, fool and my englis is bad.
    I need know about how to make hard ware (stuft) so I can have cheper ( free if posible) internet in my home, in my country internet was so expensive.
    please send me detail to make this stuft and how its can work.
    now I using internet form local public telepon, i need try using wlan or anything to make beter conection and free
    #6 one herliawan, ST (Homepage) on 2005-05-11 12:59 (Reply)
    Does anyone have a solution for this:

    asterisk: can't load library 'libpthread.so.0'


    Thanks,
    Joe
    #7 Joe on 2005-06-04 19:11 (Reply)
    ipkg install libpthread

    I had the same problem and it worked for me.
    #7.1 Kenn Sebesta on 2005-08-31 15:02 (Reply)
    Is there anyone out there want to sale me a WRT moded for SD card and install with Asterisk@home on it? Has to be fully working Asterisk@home and SD card as hard drive for program as well as voicemail storage...
    #8 Kevin on 2005-06-05 11:11 (Reply)
    how much are you williing to pay? contact me at rickyjibbons at yahoo dot com
    #8.1 ricky on 2005-06-16 01:16 (Reply)
    not enough space ??

    what can I do in this case ?
    thanks for your help

    === IMPORTANT ============================
    root@OpenWrt:/etc# ipkg install asterisk-cvs
    Installing asterisk-cvs (1.0.27) to root...
    Downloading http://12.176.248.4/ipkg/./asterisk-cvs_1.0.28_mipsel.ipk
    Installing libncurses (5.2-6) to root...
    Downloading http://openwrt.org/downloads/experimental/bin/packages/libncurses_5.
    2-6_mipsel.ipk
    Installing libpthread (0.9.27-1) to root...
    Downloading http://openwrt.org/downloads/experimental/bin/packages/libpthread_0.
    9.27-1_mipsel.ipk
    ipkg: write: No space left on device
    ipkg: /usr/lib/asterisk/modules/codec_alaw.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/codec_a_mu.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/codec_g726.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_gsm.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_wav.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_wav_gsm.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_vox.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_pcm.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_g729.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_pcm_alaw.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_h263.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_g726.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_ilbc.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_sln.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_jpeg.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/format_g723.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/cdr_csv.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/cdr_manager.so: No space left on device
    ipkg: /usr/lib/asterisk/modules/cdr_pgsql.so: No space left on device
    ipkg: extract_archive: /usr/lib/asterisk/keys/: No space left on device
    ipkg: /usr/lib/asterisk/keys/iaxtel.pub: No such file or directory
    ipkg: /usr/lib/asterisk/keys/freeworlddialup.pub: No such file or directory
    ipkg: /usr/sbin/asterisk: No space left on device
    ipkg: /usr/sbin/autosupport: No space left on device
    ipkg: /usr/sbin/safe_asterisk: No space left on device
    ipkg: /usr/sbin/stereorize: No space left on device
    Could not open //usr/lib/ipkg/info/asterisk-cvs.list for writing: No space left
    #9 jl on 2005-06-16 17:47 (Reply)
    Delete other packages that you have installed? You are out of "disk" space. On the WRT this means you've filled up the flash RAM. On a WRT54G, this is 4MB, on a WRT54GS, 8MB.

    Expect * to take a couple of MB installed. Make sure you have at least that much free space before installing it. Or upgrade to a GS if you have only a G and just can't clear any space.
    #9.1 Chris Higgins on 2005-06-16 18:21 (Reply)
    Starting with a fresh install of the latest OpenWRT (White Russion RC1, 2005-06-25), I don't know if it is possible with the WRT54G. I installed no additional packages and still didn't have enough space to install asterisk.

    Any ideas on what I could delete to have enough space? Any idea on the bare minimum space needed?

    [code]
    root@OpenWrt:/# cat /proc/version
    Linux version 2.4.30 (root@reboot2.lan) (gcc version 3.4.4) #1 Sat Jun 25 03:30:46 EDT 2005

    root@OpenWrt:/# mount
    /dev/root on /rom type squashfs (ro)
    none on /rom/dev type devfs (rw)
    none on /rom/dev/pts type devpts (rw)
    /dev/mtdblock/4 on / type jffs2 (rw)
    none on /proc type proc (rw)
    none on /dev type devfs (rw)
    none on /tmp type ramfs (rw)

    root@OpenWrt:/# df
    Filesystem 1k-blocks Used Available Use% Mounted on
    /dev/root 1024 1024 0 100% /rom
    /dev/mtdblock/4 2240 364 1876 16% /

    root@OpenWrt:/etc# ipkg update
    Downloading http://downloads.openwrt.org/whiterussian/packages/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/experimental
    Downloading http://openwrt.org/ipkg/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/openwrt
    Downloading http://12.176.248.4/ipkg/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/acvs
    Downloading http://nthill.free.fr/openwrt/ipkg/stable/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/nico
    Downloading http://nthill.free.fr/openwrt/ipkg/testing/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/nico-t
    Downloading http://www.wildcatwireless.net/wrt54g/Packages
    Updated list of available packages in /usr/lib/ipkg/lists/ab0oo
    Successfully terminated.

    root@OpenWrt:/etc# ipkg install asterisk-cvs
    Installing asterisk-cvs (1.0.33) to root...
    Downloading http://12.176.248.4/ipkg/./asterisk-cvs_1.0.33_mipsel.ipk
    Installing libncurses (5.2-6) to root...
    Downloading http://downloads.openwrt.org/whiterussian/packages/libncurses_5.2-6_mipsel.ipk
    Installing libpthread (0.9.27-1) to root...
    Downloading http://downloads.openwrt.org/whiterussian/packages/libpthread_0.9.27-1_mipsel.ipk
    ipkg: write: No space left on device
    Configuring asterisk-cvs
    Configuring libncurses
    Configuring libpthread
    ipkg_conf_write_status_files: Can't open status file: //usr/lib/ipkg/status for writing: No space left on device
    pkg_write_filelist pkg=asterisk-cvs returned 28
    pkg_write_filelist pkg=libncurses returned 28
    pkg_write_filelist pkg=libpthread returned 28
    Successfully terminated.
    Collected errors:
    Could not open //usr/lib/ipkg/info/asterisk-cvs.list for writing: No space left on device
    Could not open //usr/lib/ipkg/info/asterisk-cvs.list for writing: No space left on device
    Could not open //usr/lib/ipkg/info/libncurses.list for writing: No space left on device
    Could not open //usr/lib/ipkg/info/libpthread.list for writing: No space left on device

    root@OpenWrt:/etc# df
    Filesystem 1k-blocks Used Available Use% Mounted on
    /dev/root 1024 1024 0 100% /rom
    /dev/mtdblock/4 2240 2196 44 98% /
    root@OpenWrt:/etc#
    [/code]
    #9.1.1 Rammer on 2005-07-16 15:33 (Reply)
    I haven't made any attempts to optimize the -cvs build to fit on the (much) smaller footprint of the vanilla WRT54.

    At some point I'll try to "slim" the ipk down by removing a lot of the modules that aren't necssary. For instance, all the SSL stuff adds a huge amount to the flash memory requirement.

    The other option might be to use one of the "stable" releases from Nico. I don't know what their memory size is, but it may be smaller.

    HTH
    #9.1.1.1 Brian Capouch on 2005-07-16 16:22 (Reply)
    I was able to get a "successful" install by opening a second ssh and removing possibly unneeded modules while doing "ipkg -force_reinstall install asterisk_cvs" in the other secure shell.

    For using the /etc/asterisk/modules.conf you have above, does anyone know which modules can safely be removed from /usr/lib/asterisk/modules?
    #9.1.1.1.1 Rammer on 2005-07-16 19:26 (Reply)
    I made a "slimmed down" version of the CVS-HEAD version tonight. I removed the crypto stuff, which took up a lot of room, as well as other modules that are less-often used in the production servers I maintain.

    That slimmed it down by about 700K. I don't know a) if that's enough to allow it to fit on the WRT54, and I haven't tested it, so I don't know for sure (although I'm pretty sure) I didn't take something out that really has to be there.

    I left most of the important stuff in, and you could always add and subtract modules (e.g. the stuff for realtime, ael, voicemail, etc.) to get it to do what you want to do--assuming it will fit in the first place.

    You can get it at splurge.peoples-wireless.com/ipkg/asterisk-cvs_1.0.33_mipsel-slim.ipk

    Let me know if you do fetch it if you can get it to work.
    #9.1.1.2 Brian Capouch on 2005-07-17 03:48 (Reply)
    Ooops. I took out crypto originally, and then put it back in. I was fearful the authentication stuff would break. I can try removing it if it turns out the version I put up there is still too large, but I don't know what all else in the system might depend upon it.
    #9.1.1.2.1 Brian Capouch on 2005-07-17 03:50 (Reply)
    Thank you so much for the extra slimmed version. I successfully installed it on one of the WRT54GS v.4 units running whiterussian rc4 and it runs better than expected! It is used for an offsite extension for a telecommuter. I set it up only to handle the calls. If the user is unavailable it routs the call back to the "real" asterisk at the server for voicemail. Thanks to all that have worked so hard to make this project work! :-). Anyone else trying to get Asterisk running on the WRT54GS v.4 here is what I did:
    1: Download and install whiterussian rc4 (I did it through the web interface) on the WRT54GS v.4
    2: Add "src astslim http://splurge.peoples-wireless.com/ipkg" to the ipkg.conf file type ipkg update.
    3: From the whiterussian web interface enter a password to disable telnet and enable ssh.
    4: Go to the system category and select installed software. Here you will see the astslim entries. Install Asterisk.
    5: SSH into your linksys and configure asterisk.
    6: If you want asterisk to start when the Linksys boots add "::respawn:/usr/sbin/asterisk -f" to the /etc/inittab file.
    Hope this helps someone out there.
    #9.1.1.2.1.1 Chris Chesnut on 2005-12-19 13:23 (Reply)
    Greeting. It is curious that physical courage should be so common in the world and moral courage so rare.
    I am from San and too poorly know English, give true I wrote the following sentence: "Cheap airline tickets to switzerland, flights no visa required for a stay up to days."

    Thank you very much :-(. Frances.
    #9.2 Frances (Homepage) on 2009-03-14 14:51 (Reply)
    How many ingoing/outgoing lines/extensions can a WRT45GS handle without causing performance issues?

    I guess, since I'll only ever have 1-2 incoming lines, I'm mostly interested in how many inuse extensions it can support. Has anyone tested this? Thanks!
    #10 Doug Lgoan (Homepage) on 2005-07-19 13:36 (Reply)
    yes, i am also interested in also finding out how many simultaneous calls this router/softwsitch will be able to handle.I will be testing this out in the next couple of weeks. I want to assume sizing of 30mhz/call = approx. between 2 and 4 calls,depending on the type of cpu in the box.This is using g729 codec. This is from official digium website.
    #10.1 oka61 on 2008-04-17 08:36 (Reply)
    Hi,

    I've got a new WRT54GS 1.1, installed OpenWrt and Asterisk as per instructions above. I seem to have asterisk downloaded and installed with the ipkg command, however trying to run asterisk as per last paragraph of step 2 does not seem to work (or at least the asterisk -r command is not working out properly). Here's the output from my command prompt:

    root@OpenWrt:~# asterisk
    root@OpenWrt:~# asterisk -r
    Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)

    I looked in to see if that file asterisk.ctl exists, but it does not - is this something missing from the install procedure or have I done something wrong?

    Thanks for your help. Phil_
    #11 Phil_ on 2005-07-19 19:05 (Reply)
    Try starting with "asterisk -cvvvv" and see where it stops.
    #11.1 Rammer on 2005-07-19 22:43 (Reply)
    root@OpenWrt:~# asterisk
    root@OpenWrt:~# asterisk -r
    Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)

    I looked in to see if that file asterisk.ctl exists, but it does not - is this something missing from the install procedure or have I done something wrong?

    I am having the exact same problem. I have installed RC2 and followed the instructions. What did I do wrong?
    #12 David Hay (Homepage) on 2005-07-19 23:05 (Reply)
    Rammer has the right idea...

    The first asterisk cmd you use add the options -cvvvv and see where it stops...

    Also, if you look in /var/adm/asterisk/messages you might find some helpful information.

    I've found the the problem usually arrises from a non-slimmed /etc/asterisk/modules.conf

    What modules are being loaded?
    #12.1 David (Homepage) on 2005-07-19 23:54 (Reply)
    Thanks Rammer and David for replying. I believe I've tired out the slim as stated above. I've uplaoded the output I get when I run the 'asterisk -cvvvv' command to http://www.puresoft.co.uk/downloads/asterisk.txt and here is a copy of my config http://www.puresoft.co.uk/downloads/modules.conf.

    My messages file is as follows:
    Jan 1 00:03:47 NOTICE[593] cdr.c: CDR simple logging enabled.
    Jan 1 00:03:47 WARNING[593] loader.c: File not found
    Jan 1 00:03:47 WARNING[593] loader.c: Loading module res_config_mysql.so failed!

    When I try the asterisk -r command after that I still get the 'Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)' message.

    Thanks, philip
    #12.1.1 Phil_ on 2005-07-20 05:51 (Reply)
    Starting "asterisk" with no arguments defaults to running it as a daemon in the background. The subsequent "asterisk -r" attaches a remote console to that daemon. By the time you do the latter command, the daemon has already aborted due to an error and that is why the it is unable to connect to remote asterisk.

    The "-c" option causes asterisk to stay in the foreground with a console. The "-v" option turns on "verbosity" and the more v's the more verbosity. When you run with "asterisk -cvvvv", you do not need to do a "asterisk -r".

    The first asterisk error is:
    [res_config_mysql.so]Jan 1 00:01:06 WARNING[587]: loader.c:313 __load_resource: File not found
    Jan 1 00:01:06 WARNING[587]: loader.c:541 load_modules: Loading module res_config_mysql.so failed!

    Try "mv /usr/lib/asterisk/modules/res_config_mysql.so /tmp" (or explicitly say noload for this module in /etc/asterisk/modules.conf") and restarting with "asterisk -cvvvv".

    You may have to remove a few more modules before you get the "Asterisk Ready." prompt. BTW, it can close to 3 minutes to come up, but that can be shortened by eliminating unneeded modules.

    Finally, once asterisk it up, what do you want to do?
    #12.1.1.1 Rammer on 2005-07-20 07:35 (Reply)
    Hi,

    Thanks for the help. I added the following 2 lines in the /etc/asterisk/modules.conf file and it works through.

    noload => res_config_mysql.so
    noload => res_config_pgsql.so

    Now I have it up and runnign I will be using it to rout calls between my two work locations, so I can have my calls sent through to me as I choose. I will also be planning to try and get things set up so I can ditch one or both of my PSTN business lines and use VOIP instead. Sorting out the hardware for that now.

    Philip.
    #12.1.1.1.1 Phil_ on 2005-07-20 10:42 (Reply)
    This is a great tutorial. I found this post on linksysonline that might also be of some use.

    http://www.linksysonline.com/forum/showthread.php?t=49
    #13 Mark (Homepage) on 2005-07-20 15:29 (Reply)
    Thanks for the tips about noloading modules.

    I now have a new problem. When I start asterisk by typing asterisk -vccc I am seeing these three errors

    Jan 2 12:28:19 WARNING[1004]: chan_iax2.c:1341 reload_firmware: Error opening firmware directory '/usr/lib/asterisk/firmware/iax': No such file or directory

    Jan 2 12:28:20 WARNING[1004]: pbx.c:6098 ast_context_verify_includes: Context 'local' tries includes nonexistent context 'default'

    Jan 2 12:28:20 WARNING[1004]: pbx.c:6098 ast_context_verify_includes: Context 'local' tries includes nonexistent context 'iaxtel700'

    Now I don't understand why I am getting the firmware error I am using sip not IAX. I am not sure how not to load that.

    Error two I think has something to do with my extensions.conf

    I think error three I can fix.
    #14 David (Homepage) on 2005-07-21 13:53 (Reply)
    Thanks for all the work with asterisk on openwrt. I just loaded a wrt54g ver 2.2 with white russian RC2. I download the slimmed down version of asterisk, asterisk-cvs_1.0.33_mipsel-slim.ipk but I get a crypto error running asterisk -cvvvv. I have pretty much everything turned off in modules.conf. I get the error even if I have the crypto module shut off in modules.conf I have to rename the res_crypto.so to something else so that asterisk will even start. The following is the error I get when starting asterisk.


    [res_crypto.so]Jan 1 22:35:43 WARNING[1022]: loader.c:313 __load_resource: File not found
    Jan 1 22:35:43 WARNING[1022]: loader.c:541 load_modules: Loading module res_crypto.so failed!



    Here is a copy of my modules.conf

    [modules]
    autoload=no

    load=res_adsi.so ; ADSI Resource
    load=chan_iax2.so ; Inter Asterisk eXchange (Ver 2)
    load=chan_local.so ; Local Proxy Channel
    load=chan_sip.so ; Session Initiation Protocol (SIP)
    load=codec_gsm.so ; GSM/PCM16 (signed linear) Codec Translat
    load=codec_ilbc.so ; iLBC/PCM16 (signed linear) Codec Transla
    load=codec_ulaw.so ; Mu-law Coder/Decoder
    load=format_gsm.so ; Raw GSM data
    load=format_ilbc.so ; Raw iLBC data
    load=format_pcm.so ; Raw uLaw 8khz Audio support (PCM)
    load=format_wav.so ; Microsoft WAV format (8000hz Signed Line
    load=format_wav_gsm.so ; Microsoft WAV format (Proprietary GSM)
    load=app_dial.so ; Dialing Application
    load=app_echo.so ; Simple Echo Application
    load=app_macro.so ; Extension Macros
    load=app_milliwatt.so ; Digital Milliwatt (mu-law) Test Applicat
    load=app_playback.so ; Trivial Playback Application
    load=app_verbose.so ; Send verbose output
    load=pbx_config.so ; Text Extension Configuration

    [global]



    thank you for any help
    #15 Jerol on 2005-07-21 20:31 (Reply)
    Does anyone know where I can find the files needed to setup voicemail? I am using the cvs version of asterisk on a wrt54gs. Thanks in advance.
    #16 Ted on 2005-07-27 15:34 (Reply)
    I'm not sure you want to put voicemail on the machine. It can't record the messages fast enough and you get garbage... There are ways around this but they take quite a bit of fiddling and I believe you lose all messages if the power goes out on the box.... but if you want the sounds... get a regular install of asterisk and just tar them up.
    #16.1 David (Homepage) on 2005-07-27 16:57 (Reply)
    I forgot to mention - it's the sound files that I am looking for. Is there a way to install them via ipkg? Again, thanks.
    #17 Ted on 2005-07-27 15:36 (Reply)
    Hi,

    I am trying to install asterisk on wrt54gs. i hv installed whiterussian rc2 and downloaded the latest asterisk version as mentioned in this document. My module.config is

    [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
    noload => res_config_mysql.so
    noload => res_config_pgsql.so
    [global]
    ; chan_modem.so=yes

    when i try to start asterisk i am getting the following error
    res_crypto.so - Warning __load_resource: File not found
    Loading module res_crypto.so failed!

    How can i load this module.
    thanks for your help,
    -B
    #18 Balaji on 2005-08-05 20:41 (Reply)
    Hi Balaji,
    Look at my post #15 above. I had the same problem. I was able to get around it by downloading the RC2 CVS snapshot and compiling it myself. If you have a linux box availabe you may want to try that instead.
    -Jerol
    #18.1 Jerol on 2005-08-07 10:01 (Reply)
    Has anyone tried loading an iscsi initiator to the wrt54g to mount storage on an external box?

    --Colin
    #19 Colin McNamara (Homepage) on 2005-08-14 14:08 (Reply)
    Can anyone tell me where to put the sound files.

    I would like to use DISA on my Linksys with OpenWRT nd asterisk installed, but when the DISA command is invoked I get error messages about missing sound files.

    ast_openstream_full: File agent-pass does not exist in any format

    I created a directory /var/lib/asterisk/sounds and copied the missing sound files in there, but asterisk still does not find them.
    #20 Reinhard on 2005-08-17 17:20 (Reply)
    Hello. im new to linux. got a job wit it. but you see i need some help using it .and i need to knoe asterisk by the end of today.can you guys please give me a hand?


    Mojoe
    #21 Mojoe (Homepage) on 2005-10-24 03:12 (Reply)
    your best bet would be to visit these sites:

    http://www.tldp.org/
    http://www.voip-info.org/wiki/
    http://www.asterisk.org/
    #21.1 David (Homepage) on 2005-10-24 09:11 (Reply)
    I installed openwrt and I did replace ipgk..conf
    WHen I do update it says lots of tmp no such file ..
    ANy ideas of what might be incorrectly done ?
    Thanks
    #22 Nick Nite on 2005-10-26 20:26 (Reply)
    Has anybody connected a pstn phone line to the Wrt54G ?Or has anybody some advise to do so on one way or another ?
    Thanks
    #23 Stef on 2005-12-08 02:28 (Reply)
    I've use a GrandStream HandyTone 488 (Discontinued) and connect the both the FXS and FX0 line to the Asterisk Server. I put in translation that when I dial the FXO line#, I get a second stage dialton/dialing to connect to the PSTN. In essense, this is a SIP-PSTN Gateway Solution /w the Asterisk Server as the SIP Server.

    Usage: I have free local/LD calling plan on my PSTN line, When I am on the Inet at International location that have access to my home network (Asterisk), I register a Softphone and dial the FXO number/extension and make PSTN call as if I am making the call from my physical home location.
    #23.1 Minh on 2009-02-26 11:22 (Reply)
    Hi,

    This seems really cool that you can run asterisk off a WRT54gs box. Has anybody tried the G711u codec and does it work off this box? The reason I ask, I use VOIPSTUNT to make free calls worldwide but I think they only support G711u not GSM.

    Does the IVR / Auto attendant / Hold music features still work?

    I'm correctly new to Linux / Asterisk. Current playing around with Asterisk@home 2.5 image installed in VMWARE.. pretty cool for practice and no major timing issues. Call quality is pretty good to.. Running off my XP PC Pentium 4 - 1400 with 256mb / SDRAM. (128mb xp / 128mb Asterisk server)

    I currently have WRT54G version 2.0 - would it work on this? I guess not because of 4mb flash?
    #24 Ravi from UK on 2006-02-26 05:25 (Reply)
    Ravi,

    I had a look at this last summer, the wrt just doesn't have enough horsepower :-(
    #24.1 Anonymous on 2006-04-01 12:17 (Reply)
    Guys

    If someone could package channel_sccp (this one http://chan-sccp.berlios.de rather then the original one) I'd be very interested.

    There's a Cisco 7960G phone for the person who can get it working.

    I'm UK based so if the phone has to be shipped overseas we'll have to come to some agreement on the shipping costs. I'll install either SIP or SCCP firmware on the phone.

    P
    #25 Paul on 2006-04-01 01:57 (Reply)
    Is it possible to use this method to make Asterisk work on dd-wrt?
    I tried but I got some errors.

    Cris
    #26 Cris on 2006-05-03 21:06 (Reply)
    I think the ultimate implimentation of Asterisk on a wireless router would be on the WRTP54G. With wireless capabilities, and 2 phone ports to use with Asterisk, this would be like an All-in-One kickass devise. Has anyone thought of attacking something like this???
    #27 Christian on 2006-05-28 01:38 (Reply)
    I had two things go weird...

    asterisk: can't load library 'libgcc_s.so.1'

    and

    asterisk: can't load library 'libssl.so.0.9.7'

    I created a link from /usr/lib/libssl.so.0.9.8 to /usr/lib/libssl.so.0.9.7 and ln -s /lib/libc.so.0 /lib/libgcc_s.so.1

    I was then able to get asterisk running.... Not sure if i missed something and that caused the error. If anyone has anything better or knows what the real issue was it would be great to know...
    #28 Ren on 2006-08-12 03:18 (Reply)
    i am having these prb can n e pl z help me to solve it


    [root@dhcppc2 asterisk]# asterisk -r
    Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)



    [root@dhcppc2 asterisk]# tail /var/log/asterisk/messages
    Aug 26 11:38:21 NOTICE[5500] cdr.c: CDR simple logging enabled.


    Aug 26 11:38:21 WARNING[5500] res_musiconhold.c: Unable to open pseudo channel for timing... Sound may be choppy.


    Aug 26 11:38:22 ERROR[5500] res_config_mysql.c: MySQL RealTime: Failed to connect database server on (err 2002). Check debug for more info.


    Aug 26 11:38:22 WARNING[5500] res_config_mysql.c: MySQL RealTime: Couldn't establish connection. Check debug.


    Aug 26 11:38:22 NOTICE[5500] config.c: Registered Config Engine mysql


    Aug 26 11:38:22 WARNING[5500] pbx_dundi.c: Unable to look up host 'dhcppc2'


    Aug 26 11:38:23 WARNING[5500] chan_mgcp.c: Unable to get our IP address, MGCP disabled


    Aug 26 11:38:23 ERROR[5500] chan_unicall.c: Unable to load config unicall.conf


    Aug 26 11:38:23 WARNING[5500] loader.c: chan_unicall.so: load_module failed, returning -1


    Aug 26 11:38:23 WARNING[5500] loader.c: Loading module chan_unicall.so failed!

    plz try to explain as much as u can becoz i am dumb in linux

    thnx
    #29 Dieno on 2006-08-26 02:45 (Reply)
    What fo you mean by "created a link" ? I am having the same problem and would like to know in detail how you solved it. Thankyou in anticiaption.
    #30 David Read on 2006-09-07 09:44 (Reply)
    HI,

    Thanks for some great reading and ideas. I am looking for a device or a way to configure one analoque phone to a device and then dynamicaly route the calls . If local phone numbers are dialed it must use ZAP if a mobile number or a international number is dialed it must use my * server which is located at a ISP. Any ideas guys?.. can this Linksys device do this?.
    #31 Thomas on 2006-11-08 02:00 (Reply)
    OMG. Could this software be more buggy/cryptic/annoying? Really, don't you guys have something better to do with your lives that mucking about with a half-baked IP PBX? I am amazed at how resilient you are... who the hell is paying your salaries? Or are you just masochists? PLEASE SOMEONE COME UP WITH A VIABLE PRODUCT SOLUTION TO THIS STUPIDITY!!
    #32 Chris on 2007-05-28 12:23 (Reply)
    can asterisk be used to have , say, 20 ppl call in from their normal phones to a live lecture and listen if they're sick or something and can't attend in person?
    looking for suggestions
    #33 PC on 2008-01-16 21:52 (Reply)
    great site! I'm so glad I came across it. so many wonderful pieces of advice! exactly what a new person in this stuff like I need:) have used to find great blogs with useful pieces of information and download great books by http://torrents.rapid4me.com , but always search for smth more. I really liked what your tutoial has to offer. Hopefully one day I will be in the possition to do this stuff without looking up tutorials every step of the way. thanks!
    #34 sam on 2009-10-03 10:19 (Reply)
    great site! I'm so glad I came across it. so many wonderful pieces of advice! exactly what a new person in this stuff like I need:) have used to find great blogs with useful pieces of information and download great books by http://torrents.rapid4me.com , but always search for smth more. I really liked what your tutoial has to offer. Hopefully one day I will be in the possition to do this stuff without looking up tutorials every step of the way. thanks!
    #35 sam on 2009-10-03 10:21 (Reply)

    Add Comment

    Enclosing [B][/B] marks text as bold ([B]some words[/B]), underscore are made via [U]some words[/U], italics are made via [I]some words[/I], hyper-links are made via [LINK]URI[/LINK].

    Standard emoticons like :-) and ;-) are converted to images.
    E-Mail addresses will not be displayed and will only be used for E-Mail notifications

    To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
    CAPTCHA

     
     
     
     

    Google Ads

    YouTube Videos

    Loading...

    I'm currently reading

    Discipline & Punish: The Birth of the PrisonMichel Foucault. Discipline & Punish: The Birth of the Prison.

    The First Urban Christians: The Social World of the Apostle PaulWayne A. Meeks. The First Urban Christians: The Social World of the Apostle Paul.

    The History of Sexuality: The Care of the SelfMichel Foucault. The History of Sexuality Vol. 3: The Care of the Self.

    Book of Common WorshipPresbyterian Church (USA). Book of Common Worship.

    Places of Interest

    Archives

    March 2010
    February 2010
    January 2010
    Recent...
    Older...

    Creative Commons

    Creative Commons License - Some Rights Reserved
    Original content in this work is licensed under a Creative Commons License

    Syndicate This Blog

    XML RSS 2.0 feed
    ATOM/XML ATOM 0.3 feed
    ATOM/XML ATOM 1.0 feed
    XML RSS 2.0 Comments
    XML OPML 1.0 feed

    © David DeLauro | Impressum Design by ceejay | Powered by Serendipity | Login