Thursday, June 23, 2011

Synology NAsterisk: Stage One Installing Ipkg and Asterisk

Alrighty, so as you may have guessed it has been a little hectic over here but I am finally getting a chance to start on the glorious plan that I hatched in Synology NAS hosted home Asterisk Server: The plan.

Actually I should probably say I started doing this 3 months ago, before the wedding and all that and have almost zero spare time since then as I am now studying and travelling a lot for work at the same time.

I am basically following the instructions given on the Overview of modifying the Synology Server.

Enabling the CLI
The first step to getting ipkg installed is setting up the command line interface (check out this CLI overview from Synology for more info). There is a handy guide to Enabling the CLI on the Synology forums which has instructions for much older versions of DSM than I have, but no worries it is just as simple in DSM 3. Simply open up the Control Panel and select terminal from the second row. I'd always pick SSH for my systems but if you feel like using Telnet then go for it. Once enabled reboot.

Downloading IPKG
Once you're in via terminal you'll need to download the correct ipkg bootstrap for your Synology system, go to What kind of CPU does my NAS have to figure out which one you need, you can double check your NAS version on the System info page. In my case for the DS211J its the Marvell Kirkwood mv6281 1.2Ghz ARM Processor. This means I need to use http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh. Once it was downloaded I executed the script using the instructions provided and rebooted the system, then updated as instructed, unsurprisingly there was nothing new to install.

BackupCentre> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.
BackupCentre> ipkg upgrade
Nothing to be done
Successfully terminated.
BackupCentre>
Installing Asterisk
After ipkg is installed and upgraded it is time to install Asterisk, outputting the list of available packages gives.

BackupCentre> ipkg list | grep asterisk
asterisk - 1.2.24-1 - Open Source VoIP PBX System
asterisk-gui - 2.0.4-1 - Asterisk-GUI is a framework for the creation of graphical interfaces for configuring Asterisk.
asterisk-sounds - 1.2.1-1 - Supplementary asterisk-sounds.
asterisk14 - 1.4.22.1-1 - Asterisk is an Open Source PBX and telephony toolkit.
asterisk14-chan-capi - 1.0.1-1 - capi module for asterisk
asterisk14-core-sounds-en-alaw - 1.4.19-1 - asterisk-core-sounds-en-alaw
asterisk14-core-sounds-en-g729 - 1.4.19-1 - asterisk-core-sounds-en-g729
asterisk14-core-sounds-en-gsm - 1.4.19-1 - asterisk-core-sounds-en-gsm
asterisk14-core-sounds-en-ulaw - 1.4.19-1 - asterisk-core-sounds-en-ulaw
asterisk14-extra-sounds-en-alaw - 1.4.11-1 - asterisk-extra-sounds-en-alaw
asterisk14-extra-sounds-en-g729 - 1.4.11-1 - asterisk-extra-sounds-en-g729
asterisk14-extra-sounds-en-gsm - 1.4.11-1 - asterisk-extra-sounds-en-gsm
asterisk14-extra-sounds-en-ulaw - 1.4.11-1 - asterisk-extra-sounds-en-ulaw
asterisk14-moh-freeplay-alaw - 0.0.0-1 - asterisk-moh-freeplay-alaw
asterisk14-moh-freeplay-g729 - 0.0.0-1 - asterisk-moh-freeplay-g729
asterisk14-moh-freeplay-gsm - 0.0.0-1 - asterisk-moh-freeplay-gsm
asterisk14-moh-freeplay-ulaw - 0.0.0-1 - asterisk-moh-freeplay-ulaw
asterisk14-moh-opsound-alaw - 2.03-1 - asterisk-moh-opsound-alaw
asterisk14-moh-opsound-g729 - 2.03-1 - asterisk-moh-opsound-g729
asterisk14-moh-opsound-gsm - 2.03-1 - asterisk-moh-opsound-gsm
asterisk14-moh-opsound-ulaw - 2.03-1 - asterisk-moh-opsound-ulaw
asterisk16 - 1.6.2.13-1 - Asterisk is an Open Source PBX and telephony toolkit.
asterisk16-addons - 1.6.2.2-2 - Asterisk extras
asterisk18 - 1.8.4-1 - Asterisk is an Open Source PBX and telephony toolkit.
BackupCentre>
I'm going to install version 1.6 and the GUI, I chose 1.6 because some people are having issues with getting the GUI working with 1.8.

Installation was as easy as ipkg install asterisk16 and ipkg install asterisk-gui.

Following that I attempted to start asterisk and was presented with the following error.

BackupCentre> cd /opt/etc/asterisk/
BackupCentre> asterisk -vvvvr
Asterisk 1.8.4, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/opt/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/opt/etc/asterisk/extconfig.conf':   == Found
Unable to connect to remote asterisk (does /opt/var/run/asterisk/asterisk.ctl exist?)
BackupCentre>
I had to start it with asterisk first and then I can reconnect to it... duh!

Following that I made the changes suggested in this awesomely timely post  from the Synology IPKG Forum and now, after a quick reboot, I can connect to the webpage front end.

Now all I have to do is determine the correct password..... :)

Until next time when I configure some extensions and start making test calls.

6 comments:

  1. Oh right, I have to restart the service to get it to read the manager.conf file after I make the changes.

    Edit manager.conf to include the following to create the 'admin' user with 'YourPassword'

    [admin]
    secret=YourPassword
    read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
    write = system,call,agent,user,config,command,reporting,originate

    ReplyDelete
  2. Thanks so much for your diy, it's really helped me with my own setup.

    ReplyDelete
  3. Made the exact manager.confL
    [admin]
    secret=YourPassword
    read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
    write = system,call,agent,user,config,command,reporting,originate

    But i am still not able to login.

    Need some help plz

    ReplyDelete
  4. and my Asterisk server only show the following 3 lines.
    /asterisk/httpstatus => Asterisk HTTP General Status
    /asterisk/phoneprov/... => Asterisk HTTP Phone Provisioning Tool
    /asterisk/static/... => Asterisk HTTP Static Delivery

    instead of:

    Enabled URI's:
    /asterisk/httpstatus => Asterisk HTTP General Status
    /asterisk/phoneprov/... => Asterisk HTTP Phone Provisioning Tool
    /asterisk/manager => HTML Manager Event Interface
    /asterisk/rawman => Raw HTTP Manager Event Interface
    /asterisk/static/... => Asterisk HTTP Static Delivery
    /asterisk/mxml => XML Manager Event Interface

    ReplyDelete
  5. I am sorry you are having trouble. Unfortunately I can't provide much more information. I simply followed the instructions on the site that I linked. They may be able to help you out some more.

    ReplyDelete
  6. I installed asterisk16 and asterisk-gui on my DS with ARM CPU, but I cannot start the service. The packages are visible in "ipkg list_installed". But when I do "ipkg" or "ipkg -r" it cannot be found.
    I tried uninstall (en reinstall), but it didn't work. I also modified two files, since IPKG isn't working anymore with DSM 4.0.

    ReplyDelete