Tuesday, June 29, 2010

Asterisk, the VoIP Server on DD-WRT

I'm a big fan of Asterisk on router -- imho, it's the perfect platform for anyone want to try Asterisk at home -- 24x7, fanless and even the cheapest router can handle at least 2-3 concurrent conversation. Before this WZR-HP-G300NH, I had Asterisk running on a WRT54G-TM for over a year with lots of fun.

Installing Asterisk on the router is easier now as current OpenWrt trunk build(the one we use) includes prebuilt Asterisk binaries. As always, since OpenWrt is designed to work with / not /opt, some adjustment is required to get Asterisk working properly.

  1. Install Asterisk 1.6
    Believe it or not, DD-WRT MEGA also has Asterisk included -- it's an old ver1.4 and some important files are missing -- I have no idea why DD-WRT decided to do so, too much flash ROM? Anyway, to install Asterisk 1.6 on our opkg enabled router, run
    opkg install asterisk16

    You may also want to install some additional modules like:
    opkg install asterisk16-res-agi
    opkg install asterisk16-res-musiconhold

    To view a full list of Asterisk packages(lots of them!), run
    opkg list | grep asterisk16

  2. The configuration file: asterisk.conf
    With our installation, the asterisk.conf is in /opt/etc/asterisk/asterisk.conf. Change it to the contents below:

    [directories] ; remove the (!) to enable this
    astetcdir => /opt/etc/asterisk
    astmoddir => /opt/usr/lib/asterisk/modules
    astvarlibdir => /opt/usr/lib/asterisk
    astdbdir => /opt/usr/lib/asterisk
    astkeydir => /opt/usr/lib/asterisk
    astdatadir => /opt/usr/lib/asterisk
    astagidir => /opt/usr/lib/asterisk/agi-bin
    astspooldir => /var/spool/asterisk
    astrundir => /var/run/asterisk
    astlogdir => /var/log/asterisk
  3. [compat]
    pbx_realtime=1.6
    res_agi=1.6
    app_set=1.6


    As you can see, by modifying this file, we tell Asterisk to look for files at /opt/etc/asterisk and /opt/usr/lib/asterisk instead of default locations, which fits our installation.

    Now try to launch asterisk by running:
    asterisk -vvvvvc
    Exit by pressing ctrl+c

  4. Asterisk configuration
    By default, asterisk loads lots of modules, you can change the settings to fit your needs and reduce memory usage.

    Below is a sample of /opt/etc/asterisk/modules.conf with reduced modules:

    [modules]
    autoload=no                ; only load explicitly declared modules
    load => app_dial.so
    load => app_echo.so
    load => app_macro.so
    load => app_playback.so
    load => chan_sip.so
    load => codec_ulaw.so
    load => pbx_config.so
    load => format_pcm.so
    load => format_wav.so
    load => func_callerid.so
    load => func_strings.so
    load => res_musiconhold.so
    load => res_agi.so

    For SIP users, other important files including /opt/etc/asterisk/extensions.conf and /opt/etc/asterisk/sip.conf. These are not covered here, please refer to website about Asterisk like asteriskguru and voip-info.org. Also, here is a must-read  ebook: Asterisk: The Future of Telephony Second Edition(download the PDF book)

  5. Run it as service
    Create file /opt/etc/init.d/asterisk with below(delete previous contents if its not empty)

    source /mnt/root/.profile
    mkdir -p /var/run/asterisk
    mkdir -p /var/spool/asterisk
    mkdir -p /var/log/asterisk/cdr-csv
    /opt/usr/sbin/asterisk -C /opt/etc/asterisk/asterisk.conf

    And run
    chmod a+x /opt/etc/init.d/asterisk
    ln -s /opt/etc/init.d/asterisk /opt/etc/init.d/S95asterisk

That's all. Enjoy Asterisk and happy VoIP!

53 comments:

Kevin said...

Great blog!

Any chance you can write a tutorial on using ushare? I tried following the DD-WRT tutorial and so far I'm stuck at trying to run it.
My error:

Interface ath0 is down.
Recheck uShare's configuration and try again !
ioctl: Cannot assign requested address

Ath0 is the wireless interface.

Anonymous said...

Please write how to configure opendchub with scripts

Anonymous said...

Thanks for this great blog!
I am considering running Asterisk and/or Wireless Hostspot manager(Chillispot, FreeRadius) on a suitable router. This blog sure shed a light on my choice of router. Do you plan to write a tutorial on configuring the WZR-HP-G300NH as a Wireless Hotspot soon.
Evans, Netherlands

Anonymous said...

Do you have any idea how I could get my Nokia CS-15 3g modem to start on the wzr using dd-wrt?!
On ubuntu I had the same problem until I found a post saying I just have to type " eject /dev/sr1 " in the terminal! And it works great there!
Could it be that simple on the wzr too? What should the commandline look like ?
I´m not an expert on linux but I´m not a retard either :P

Magnus, Finland

Anonymous said...

sounds great - does having the VOIP system affect the quality of the VPN system at all? im concerned that it will become a bit too much to handle for a small office (4 pcs 2 sip phones)

Anonymous said...

Can anyone help please... i'm new and i get this error..

root@DD-WRT:/opt# opkg install asterisk16
Collected errors:
* make_directory: Cannot create directory `//usr/lib/opkg': Read-only file system.
* make_directory: Cannot create directory `/usr/lib/opkg': Read-only file system.
* make_directory: Cannot create directory `//usr/lib/opkg': Read-only file system.
* opkg_install_cmd: Cannot install package asterisk16.
root@DD-WRT:/opt#


Thanks in advance.

Unknown said...

When I'm trying to run this command: "opkg install asterisk16", dd-wrt says that "-sh: opkg: not found". I have dd-wrt v24 sp2 installed on my router. Can you help me plz?

Anonymous said...

It would be great if this would work...
In my case when I start asterisk I get huge number of messages like:

loader.c:726 inspect_module: Module 'func_timeout.so' was not compiled with the same compile-time options as this version of Asterisk.

loader.c:727 inspect_module: Module 'res_adsi.so' will not be initialized as it may cause instability.


As result of this... or may be something else I can not load dial plan.
So "dialplan reload" is not valid command with OpenWRT asterisk. If I use "dialplan show" -- my dial plan is not there.

So I can not get working what works fine in Asterisk 1.6 on my desktop.

Anybody was able to get this working???

Unknown said...

Great list, just give me a couple of new ideas on what to do next!
hp p1505 driver

Anonymous said...

Can anyone put here some working sip.conf and extension.conf for several interior phones and for multiple SIP-VSP (voice service provider) accounts ?

Unknown said...

I followed step by step and was able to pass through a D-Link DIR-857. My internet works, but my second box gets on TV, but can not pause, record or records access ect. After 3 hours with the support of TELUS, there was an impasse. Anyone else having this problem?

Norton Antivirus Support | Mcafee Antivirus Support

Unknown said...

Gear oil if you want oil products for your CNC products you can purchase from us.

Unknown said...

Nice info ! There are many people who are using tech support services and their experience is great.

Norton Antivirus Security Scan | McAfee Antivirus Security Scan

Anonymous said...

nice tutorial !

Voip Sip Client

Unknown said...

Hey, Your post is very informative and helpful for us. In fact i am looking this type of article from some days. Thanks a lot to share this informative article.
You can also see this MicFlip: World's First Reversible Micro USB Cable .

Thanks

Router Login said...

Thanks for sharing this post.It is very extraordinary post.
Routerlogin
Routerlogin Net

Unknown said...

Hey...

I M ... lauder jane

Read blog helpful technique , if any person need help read this blog step top solve error. thanks so much

Support For D-Link
Support For Belkin
Support For Netgear
Support For Asus Router
Support For Cisco-Linksys
Technical Support For Apple Router
Support For TP-Link
Support For JCG Router
Support For HP Router
Support For Trend net Router

Amelia said...

Such a nice post, Thanks for sharing Such a valuable features and other relevant information. .. If you have any issues regarding AOL Desktop gold so just follow the link

Download AOL Desktop GoldDownload AOL GoldInstall AOL Desktop GoldInstall AOL GoldDownload AOL Desktop Gold SoftwareAOL Gold Download LinkAOL Desktop Gold DownloadAOL Desktop Gold SoftwareReinstall AOL Desktop GoldDownload AOL Gold SoftwareUpdate AOL GoldInstall AOL Desktop Gold SoftwareInstall AOL Gold SoftwareDownload AOL Desktop Gold AOL Desktop Gold support numberAOL Desktop Gold Technical support AOL Desktop Gold customer support AOL Desktop Gold Login AOL Gold Sign inDownload AOL Desktop Gold for windows 10Latest AOL gold softwareAOL desktop goldFree AOL Gold Desktop 9.7 Download Download AOL Gold 9.7 Desktop AOL Gold AOL Gold Support Number install aol gold desktop on mac os x AOL gold login AOL gold upgradeAOL desktop gold for macAOL desktop gold upgrade

www 123 hp com setup said...

123.hp.com setup
www 123 hp com setup
123.hp.com/setup

James Aultman said...

Such a more valuable information. I also read your all Blogs. This is awesome!! I’ve always enjoyed reading that type of blog. Keep writing such kind of info on the page. I am really impressed with this type of writing. Thanks for sharing with us. Norton.com/setup

AT%T Customer Care said...

Reset your att email password

reset at&t password | at&t password reset | at&t email password reset | reset at&t email password | forgot at&t email password | recover at&t password | at&t password recovery | forgot my at&t password | reset my at&t email password | at&t mail password reset | forgot at&t password | contact at&t password reset | how to reset at&t password | change password at&t email | recover at&t email password | reset at&t mail password | at&t password reset contact | contact at&t forgot password | at&t password reset contact number | contact at&t for password reset | at&t password reset phone number | att password reset | reset att password | att email password reset | reset att email password | forgot att email password | recover att password | att password recovery

Erin Moses said...

canon printer support australia
hp printer support
brother printer support australia

aryanoone said...

Outlook Phone number
www trendmicro com bestbuypc
kaspersky phone number
activate my norton product key
AVG Customer Service Number
webroot activation code free

aryanoone said...


kaspersky support number


800tollfreenumber said...

Nice Post..!
Why you need to install Norton Antivirus in your computer
Some Important Things About Computer Security
The Importance And Necessity Of Computer Security

Erin Moses said...

Sbcglobal Email Support Phone Number
Outlook Customer Service Number
Norton support australia

freelance said...

Delete Internet History Online
How to Delete Browser Search History Online
How to Clear Instagram Search History Online
How to Delete Facebook Search History Online
How to Delete Skype Search History Online

Printer Setup and Support said...

I truly appreciate that you've posted an educational article. Much obliged to you for sharing this good post. Likewise visit our website.
123.hp.com || 123.hp.com/setup || 123HP Setup || hp.com/setup || hp.com/123 || 123.hp.com setup || 123 HP Printer Setup || 123 HP Printer Support || 123 HP Setup Install || 123hpcom || 123 HP Printer Install || 123hpcomsetup || 123 HP Printer Setup || 123HP Install || hpcom/123 || 123hpcominstall || 123HP Setup || 123 HP Smart App || Install 123 HP || HP 123 Setup

Jacob Black said...

Thanks for sharing such a nice Blog.I like it.
openstreetmap
trello
data.world
community.spiceworks
logopond
roleplaygateway

alexhydra11 said...

keep sharing usefull Post like this, Your Post Is As usual Very Important For Us
mcafee.com/activate

Emma Ludwig said...

Thanks for sharing such a nice Blog.I like it.
Guest Blogging Sites
Guest Blogging Services
Guest Posting Services
Guest Posting Services
Guest Blogging Sites

AOL Desktop Gold Download said...

Hi I’m mick tracker is a professional service provider who is an experienced technician and has more than 5 years of hand on experience. If you are facing any kind of technical glitch in your download aol desktop gold then it’s time that you must definitely consider us. We will help you to solve your query within minutes

Alex Jones said...

It’s time to execute 123.hp.com/setup for HP printer models. It’s the device setup manual where the instructions are available in detail. The setup steps include connecting the hardware, finding the matching software and execute the instructions of the wizard one by one. If the Auto wireless connect feature is available for any of the models, enable it to proceed further. Resolve the errors if you end up with 123.hp.com/setup issues. Dial the customer support number for guidance

sam linda said...

Hi,I must Say is a best article.
I have taken a lot of notes from this article. I must say am highly overwhelmed by your whole story.
One Vanilla Prepaid Gift Card Balance

Gorge More said...

Hi I’m Gorge More is a professional service provider who is an experienced technician and has more than 5 years of hand on experience. If you are facing any kind of technical glitch in your Amazon gift card balance then it’s time that you must definitely consider us. We will help you to solve your query within minutes.
More Info :
Amazon Gift Card Balance Check | refund Amazon gift card | Amazon.com balance | check Amazon gift card balance | Amazon gift card activation | register Amazon gift card |Redeem Amazon Gift Card | Amazon Check Balance | Amazon Card Balance

admin said...

AOL Desktop Gold Downloadis a complete software suite to enable instant messaging, emailing or search content. AOL Desktop integrates numerous features over the internet including instant messenger, Media Player, and a fast web browser.

tech support said...

printer setup

Robert Charles said...

Nice Blog Post thanks for sharing it.

Go for the best services and devices to help yourself. Talk to the customer care executives with the free spirit if some kinds of issues stop you to make the necessary decisions.

netgear router not login
netgear router customer service number
netgear router customer support number
netgear routercustomer care number
netgear router setup without modem
How do I fix my Netgear router?

Download AOL Desktop Gold said...

This is very informative and intresting.Those who need any help regarding download aol gold visit:

download aol gold software | download aol gold now | download aol desktop gold software | aol desktop gold software | download aol gold desktop | install aol gold desktop | install aol gold | download aol desktop gold | aol gold download | aol gold desktop download | aol desktop gold download | download aol desktop | aol gold installaol desktop gold upgrade | aol gold support number | reinstall aol desktop gold | download aol gold | aol gold desktop download install | install aol desktop gold | aol desktop gold install | aol desktop gold reinstall | support aol gold | aol desktop gold

Magick jack Customer Support Service Helpline Number said...

Nice Blog Post Thanks for sharing this.

MagicJack uses the internet connection for allowing you to make calls on this device. The best part of this device is that you can get customer support service on phone.


magicjack customer support number
magicjack customer service number
magicjack phone number
magicjack tech helpline number
magicjack support phone number
How can improve the quality of Magic Jackgo and MagicJackplus

Magick jack Customer Support Service Helpline Number said...

Nice Blog Post Thanks for sharing this.

The best part of this device is that you can get customer support service on phone.

How to activate magicjack.com
How To Set Up magicJack Go
How to install Magicjack Go
www magicjack tech helpline number
magicjackcom support phone number
Magicjackcare.com phone number

Stella Carlson said...

Are you facing technical kind of stuff on your apple device, don’t know How do I report a problem with AppleCare or contact Apple Support Team for Solutions? So contact on Apple Support Number(+1)855-516-8225 it’s work 24x7 hours for Customers. https://iphone-customerservice.com/report-problem/

Mr Ansari said...

You may similarly have stresses over the legality of the site, anyway it chips away at what is basically a foggy territory. The site itself doesn't generally have any stolen material at all.

The site doesn't consider any customer moved substance and Putlocker and backup locales all have a disclaimer that examines:

"This site doesn't store any archives on its server. All substance are given by non-related untouchables."

Which infers that site itself isn't doing whatever is extremely unlawful. In each commonsense sense, the webpage basically gives a spot to you to find the associations with find content that is starting at now encouraged somewhere else on the web. In this way, you don't have a great deal to worry over.

The Verdict

There is an inspiration driving why Putlocker is well known and the clarification is this: Putlocker offers a help, the upsides of which massively surpass the shortcomings. Right now,

the occasion that you have to watch something on the web and can't remain to pay for the hundred and one assorted spilling organizations that exist, Putlocker hd is a solid choice.

ANIKET said...

Windows 7/8/10: "C:\ProgramData\Nuance\NaturallySpeakingXX\Users"

Note: These zones may not be appeared in Windows generally. In case the "Application Data" envelope (for Windows XP) or the "ProgramData" coordinator (for Windows Vista, 7, 8, 10) are not obvous, you should follow the procedures underneath to show them before proceeding with exchanging or getting a User
dragon customer service..

To interface with the "Application Data" coordinator (for Windows XP):

Snap "Start > My Computer" to open a Windows Explorer window.

Snap "Contraptions > Folder Options".

Snap the "View" tab.

Associate with the "Show guaranteed about records and envelopes" elective.

Snap "OK" to apply the changes.

To interface with the "ProgramData" envelope for Windows Vista and Windows 7:

Digits me said...

You have written such a interesting blog.it is worth of reading.keep updating and sharing with us

Digit me
Zen Watson

Henry Cook said...

Nice Post, I really loved this Blog.

If you are looking for a kind of streaming device that can offer you to watch a large number of TV Programs or movies for the sake of entertainment.

Roku Activation Link code
How Can I Setup Roku Streaming Stick on My TV?
How Do I Activate Hulu Plus on My Roku Device?
How Do I connect Roku to My Wireless Network
How Do I Activate Hulu On My Smart TV

Quickbooks Phone Number said...

Nice! Blog post and the article its amzing will come back to read more How to install diagnostic tool? and call us 8449080801 support team.

Stella Carlson said...

24*7 Apple Technical Support is leading Apple support website where you get services provider of Apple remote tech support the USA for third party products and services. Contact Apple Support phone number +1-855-516-8225.

Apple Customer Service
Macbook Customer Service
iTunes Customere service
iPad Customer Service
Technical Help Number
iPhone Customer Service

Robert Charles said...

Great post.......Thanks for sharing this post.

Talk to the customer care executives with the free spirit if some kinds of issues stop you to make the necessary decisions.

netgear router not login
netgear router customer service number
netgear router customer support number
netgear router customer care number

Roku Help Number said...

Nice Blog Post. Thanks For Sharing this informative post.Roku uses the internet connection for allowing you to make calls on this, Contact +1-855-879-1273.
roku customer help number
roku help number
roku technical help number
roku support phone number

Technical Support and Services By Experts said...

Thanks for sharing such a good content with your blogs. I really enjoying your blog while reading. if you need any kind of information CONNECT BROTHER PRINTER
brother printer support
wireless printer support
laser printer support
inkjet printer support number
printer driver support number

Ojash Yadav said...

putlockers one of the great streaming systems, in which you can watch special films and tv series. Moreover, you may down load various motion pictures of your choice and watch it while you want to observe it subsequent.

At a time, the channels have been close down and plenty of humans had been no longer able to watch the favorite films in their desire. Because of the lack of ability to benefit get right of entry to to their internet site, many human beings have to look for the alternative. Incidentally, there are plenty of alternatives available for you.


You can test the numerous alternatives supplied to you here and use any of them to watch movies on putlocker , tv series, and most significantly, you can down load films of your preference.

You can watch on line movies and also you should make certain that you are secure while watching it. To be safe way that the film website will now not be harm on your machine with viruses. This is one of the risks users encounter in the sort of web page. The possibility of encountering viruses is constantly there.

Before you start to get right of entry to that site, you must make sure that you do not disclose your PC or your telephone or any of the devices you want to watch the video. If you need to download movies, you ought to additionally use sturdy antivirus to ensure which you do no longer down load any film that can damage your machine.

This may be very vital, specifically in case you want to benefit get right of entry to to a free website like maximum of them which might be encouraged here.

Furthermore, to make certain which you live safe, you ought to make certain that you examine the website's guidelines and do now not cross contra to the regulations put in area. Ensure that you do not destroy any rule you can get prosecuted in case you go towards the policies.

Ojash Yadav said...

putlockers one of the great streaming systems, in which you can watch special films and tv series. Moreover, you may down load various motion pictures of your choice and watch it while you want to observe it subsequent.

At a time, the channels have been close down and plenty of humans had been no longer able to watch the favorite films in their desire. Because of the lack of ability to benefit get right of entry to to their internet site, many human beings have to look for the alternative. Incidentally, there are plenty of alternatives available for you.


You can test the numerous alternatives supplied to you here and use any of them to watch movies on putlocker , tv series, and most significantly, you can down load films of your preference.

You can watch on line movies and also you should make certain that you are secure while watching it. To be safe way that the film website will now not be harm on your machine with viruses. This is one of the risks users encounter in the sort of web page. The possibility of encountering viruses is constantly there.

Before you start to get right of entry to that site, you must make sure that you do not disclose your PC or your telephone or any of the devices you want to watch the video. If you need to download movies, you ought to additionally use sturdy antivirus to ensure which you do no longer down load any film that can damage your machine.

This may be very vital, specifically in case you want to benefit get right of entry to to a free website like maximum of them which might be encouraged here.

Furthermore, to make certain which you live safe, you ought to make certain that you examine the website's guidelines and do now not cross contra to the regulations put in area. Ensure that you do not destroy any rule you can get prosecuted in case you go towards the policies.

Post a Comment