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!

66 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???

Anonymous 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...

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

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

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

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

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

Desi Gaana 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:

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.

Unknown 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

Elon Brown said...

Norton.com/setup - Norton offers top-notch features to protect your online data spread across the various devices. The features include timely updates, customized scanning, detection and protection from virus and malware.
Norton.com/setup

Netflix Activation Code said...

Nice Post Admin!! this is really very good Article.
If you are facing any problem your Netflix account, Please call us today!

Netflix activation code
netflix device activation code

Mr Frudo said...

admin you are really doing great work sharing tech in 2010 support from

UK Discount Codes Website

Eric Kye said...

Locast channel activation guide is here to help you. This channel is popular and telecast the most entertaining channel shows. The top channel networks on Locast include ABC, CBS, FOX, NBC, and a lot more. To begin the activation, add the channel visiting the Amazon Fire TV app store, find the code and then provide the code navigating to the portal, Locast.org/activate. Now pick the top channel network to start streaming. Do not worry, if you find it tough to execute the channel activation on your own, please contact our network support +1-855-626-1730 to get the guidance.

Satta King said...

Satta King game is drawing and lottery-based generally match-up, anyway right now it's sorted in betting.
Satta King
Satta King Gali
Satta King
Satta King Gali
Satta King Desawar
Satta King Faridabad
Satta King Ghaziabad
Satta King Ghaziabad Delhi Darbar
Satta King Peshawar
Satta King Gali
Satta King Game
Satta King Faridabad
Satta King Delhi Darbar
Satta King Desawar
Satta King Ghaziabad
Satta king live result
Satta king online result
Satta king online
Satta king result today
Satta king gali result
Satta king desawar result
Satta king faridabad result
Satta king gaziyabad result
Satta king delhi darbar result
Satta matka king
Satta king up
Satta king desawar
Satta king gali
Satta king 2020 chart
Satta king 2019 chart
Satta king 2021 chart
Satta baba king
Satta king chart
Gali live result
desawar live result
faridabad live result
ghaziabad live result
delhi darbar live result

eCom said...

thank you for the post and content, appreciate it !https://www.aquariumhias.online/2020/07/liburan-akhir-tahun-sekeluarga-kunjungi.html

Apnabuilder said...

Can you please post sections for DNS , NTP , NIS etc in AIX env please . Your notes are so clear to understand , Fibrus Broadband NI Thanks

Orbi Router Setup said...

I have read your blog and it is very informative. I personally really like it.

Mail TWC said...

I have read your blog and it is very informative. I personally really like it.

Belkin Setup Page said...

I really like your post. Such an incredible post.

Dropcam Login said...

Very informative. Incredible post. I really like it.

Nest Com Login said...

I really like your post, Very interesting.

SBC Mail said...

I have read your blog and it is very informative. I personally really like it.

Tim Pegios said...

If you are facing any kind of issues regarding Orbi Router Won’t Connect to Internet, then no need to worry; just you can make a call us to toll-free helpline numbers at USA/CA: +1-855-869-7373 and UK/London: +44-800-041-8324. Our experts are experienced and help to resolve your issues.

Kevin Booth said...

Blockchain Customer Service for Your Blockchain Related Queries
Learning everything about Blockchain isn't easy especially when you don't have the correct resources or help. Don't even think about playing with cryptocurrency until you grab enough knowledge of Blockchain and stuff. But where can you find reliable resources to boost your knowledge? You can find all the information for Blockchain and cryptocurrency right here at our blockchain customer service page in a few clicks and get started with your new journey. Moreover, you can also get assistance directly from our Blockchain experts in case of queries and issues regarding the matter.

MSN Support said...

I hope it will be helpful for almost all peoples that are searching for this type of topic. I think this website is best for such a topic. good work and quality of article.
There are numerous individuals utilizing MSN for their work, we as a whole realize that MSN is a web-based interface dispatched by Microsoft.
reset password for msn email account

msn email password reset

Stephanie said...

Nice Post thanks for the information, good information & very helpful for others,Thanks for Fantastic blog
reset outlook password


Router Login Online said...

Great Post!!!

Thanks For Sharing Blog.

We have tried to provide the best user guide for Tp Link Router Login. Therefore we suggest you come to us for router login issues and any other router issues. There are a lot of reasons for which you should come to us. One of such reasons is that the Verizon Router Login is the easiest way to log in. There are many more great things that you will find on our website.


Tp Link Login<
Tplink Login
Tplinklogin
Tp-Link Login
Tplink Router Login

Nick said...

Orbi login
orbi router setup

Nick said...

Orbilogin.com is easy to access. If you want to do orbi login and setup in your orbi device then with the help of orbilogin.com you can do it easily because it is the default web address of orbi. Open a browser and type orbilogin.com in the address bar and press enter. If you face any error while accessing orbilogin.com then you can visit our site in order to solve your issues with our team.

Nick said...

Users must use wifi.wavlink.com to do wavlink router setup. To wavlink router setup, open a browser and type wifi.wavlink.com  into the URL box. You'll be taken to a page where you may set up your wavlink router. Now you have to fill out the necessary details which are used to wavlink router setup. However, if you encounter any errors while setting up your wave link router setup and are unable to resolve problems, you can visit our website and seek assistance from our specialists, who are available 24 hours per day live chat or on a toll-free phone.

tplink repeater setup said...

Tplinkrepeater.net is the default web address for accessing the tplink repeater's web interface. You will be able to browse the settings of your extender and see how many devices are connected to your network once you have completed the Tplink repeater login steps. Tplinkrepeater.net can be used to access the Tplink repeater setup website and configure the extended network. Tplinkrepeater.net improves your wireless networks overall strength. Tplinkrepeater.net may be set up in two ways: manually or using WPS. If you wish to log into Tplinkrepeater.net, open a browser and type Tplinkrepeater.net into the address bar. You will see a Tplinkrepeater.net login window open, and you will need to put in the relevant information in the forms. If you encounter an error while setting up or logging onto Tplinkrepeater.net, please contact our support team, who will assist you in resolving your Tplinkrepeater.net issue

linksyssmartwifi.com said...

The web address linksmartwifi.com allows the users to configure their router effortlessly through linksyssmartwifi.com. In case, you want to log into the Smart Wi-Fi Router or wanted to configure its settings by router login. You can choose to access the default web address of your router. However, the Linksys router setup is also made easy by using the Linksys Router Smart Wi-Fi App. You can also set up linksys router through web interface on your computer by accessing linksyssmartwifi.com setup.
linksys router firmware update

QuickBooks Enterprise Support said...

Quickbooks services like payroll may encounter errors like QuickBooks Payroll Error Code PS058. Error PS058 may appear when you try downloading the update or when the installation fails.

What is QuickBooks Error 17337?.


Simple Steps to fix QuickBooks Payroll Error Code 15102.

Webmail Roadrunner said...

I really like your post. Such an incredible post. We at our facility provide the help to Roadrunner user. If you want to set up your Webmail Roadrunner on a different device other than the device that you are using currently, visit our website.

HBOMax/Tvsignin said...

Very informative. Incredible post. I really like it. HBOMax is an all-inclusive app that has all the content that HBO has to offer. You can watch thousands of movies, TV shows and documentaries on HBOMax, but make sure to you have an account on the platform.

Tom Cook said...
This comment has been removed by the author.
my blog said...

As you can see in the list above, there are many options to choose from, and they all differ based on the context. Bank Ka Balance Check Karne Ka Number I’ve jotted down a couple of ways to deal with informal and formal situations

Kito Infocom said...

CapitalGrocery is Online Grocery Sopping and online Supermarket in Delhi.
Amul Cow Ghee (Tin) (1 litre)
Amul Pure Ghee (Tin) (1 litre)
Amul Pure Ghee (Carton) (500 ml)
Aashirvaad Svasti Pure Cow Ghee (Carton) (1 litre)
Dalda Vanaspati Vanaspati (1 litre)

Imlekhpal@gmail.com said...

Thankyou for delivering your thoughts to us it being ni r pleasure to us to grab this knowledgeble .it was awesome keep sharing it

Nick said...

You can access the Orbi router at any time and from any device using Orbilogin, i.e. orbilogin.net or orbilogin.com. Between the Orbi router and the Orbi satellite, the Orbi WiFi Mesh system is simple to set up. For the Orbi router or the orbilogin admin page, change the Orbi password and the Wi-Fi password. With the push of a button, you can start syncing your Orbi router with Orbi satellites. You can change your Orbi password via Orbilogin.

Australia's-Best-Chauffeur-Car-Service said...

If you're looking to boost your SoundCloud profile, you've come to the right place. At BuySoundCloudPlays.com, we The best site to buy SoundCloud plays offer an easy and affordable way to get more plays, followers, and likes for your music. We specialize in helping artists of all levels get the exposure they need to succeed.

Why choose us?

- We offer high-quality SoundCloud plays at an affordable price
- Our services are safe and secure, and will never harm your account
- We offer a 100% satisfaction guarantee on all of our services
- We are the most trusted and reliable provider of SoundCloud plays in the industry

Sign up today and see the difference that BuySoundCloudPlays.

Mark peterson said...

writting is very well. visit my profile. Click here

Nest account login said...

The Nest account login page can be accessed using the Nest home app. Download and install the app on your smartphone and proceed with the installation process using the in-app instructions. The app can be used to complete the wifi setup part of your device. If you are looking for help with the account login process, you can always reach out to the team at our end or visit the website for additional information.

packers and movers in banaswadi bangalore said...

I learned a lot of useful information from your article.
We are dedicated to giving each client dependable and prompt services as a reputable moving company.

Abhi said...


This blog in very informative for us

Anonymous said...

best paclers and movers in peenya Finding the right packers and movers for your move can be a daunting task. With so many companies offering packing and moving services, how do you know which one to choose?

Post a Comment