By AdNovea – Mars 2009
HOWTO on Asterisk IP-PABX* (SIP/IAX VoIP)
Students have a good opportunity to type term papers online and get help.
SIP (Session Initiation Protocol) is a protocol for VoIP (Voice over IP) used to carry audio exchanges between users through the Internet infrastructure rather than hardwired telephone lines (PSTN). In order to do so there two requirements:
- Need to have the relevant pieces of software to handle this protocol (it is implemented into the ISP boxes)
- Need to have a capability to connect from Internet to the PSTN (handled by your ISP when you have the capability to use VoIP with your ISP boxes)
What we suggest to do here is:
- To first implement on a QNAP server a local PBX (such as an old telephone switchboard) to support several phone lines. The handsets may be either softphones on PCs or IP-Phones.
- To connect our internet phone network to the outside using our ISP SIP capability.
There are 2 possibilities to install Asterisk on your NAS
- Through the Asterisk QPKG available from the QNAP forum
- Using the IPKG Manual installation (requires IPKG-Optware QPKG to be installed and enabled on your NAS)
IMPORTANT:On your router forward the port 5060 to your NAS server Asterisk Web interface default ID/PWD is admin/password
Source(s): Asterisk IP-PABX*(SIP/IAX VoIP)
Installation of ASTERISK
- Download, install and enable the Asterisk QPKG
- Click the Web page hyperlink (http: //<your_nas>:8088/asterisk/static/config/cfgbasic.html)
- Enter the default A/C (admin/password) and you will be prompted to change the password right away
- Under Dial plan create a new dial plan (see below Configure your Asterisk PBX server)
- Under Users create two new users
- Install 2 soft phones (see below Testing the PBX )
Manual installation on x86/ARM platforms# ipkg update # ipkg install asterisk14 # ipkg install asterisk-gui # ipkg install asterisk-sounds
I recommand to select the GUI v2.0 as mentioned above.
There is also a "asterisk14-gui" package for the GUI 1.4. but it may lead you to the wizard and lock. You can come back to the login page and select from the left panel the actions to perform but you may also encounter issues to create users.
The asterisk16 package has some issues and the GUI is keeping reloading - There are some known bugs and until the ipkg will not download the fixed v1.6 version, we recommand to use the v1.4
IMPORTANT: with the IPKG installation, replace "/usr" by "/opt"
Save the default configuration files
It is recommended to back up your configuration files before you continue.
To achieve this just copy /etc/asterisk under different name:
cp -r /opt/etc/asterisk /opt/etc/asterisk.backup NOTE: on X86 /opt = /share/xx0_DATA/.qpkg/Optware/ on ARM /opt = /share/xx0_DATA/optware/opt
Configure ASTERISK (manual installation)
There are mainly two files that you should modify.
The /opt/etc/asterisk/manager.conf file will be modified and a new user added. The administrator user will enable the Asterisk Administation through the GUI.
(much easier than editing the files for a begineer)enabled = yes webenabled = yes httptimeout = 60 [administrator] secret = mypassword read = system,call,log,verbose,command,agent,user,config write = system,call,log,verbose,command,agent,user,config
Then you have to modify /opt/etc/asterisk/http.conf:enabled=yes enablestatic=yes bindaddr=0.0.0.0
Start & Stop Asterisk
Using a SSH console
Asterisk can be launched as a deamon or with the CLI (Command Line Interface)
IPKG installation (manual installation)# /opt/sbin/asterisk –vvvgc Start in debug mode with the CLI *CLI> stop now Stop Asterisk from the CLI *CLI> module reload Restart Asterisk (for example after a file configuration modification) # /opt/sbin/asterisk Start as a deamon # /opt/sbin/asterisk -rx 'stop now' Stop Asterisk (-rx sends a CLI command) # /opt/sbin/asterisk -r Open the CLI console (type quit to exit the CLI)
QPKG installation# /usr/sbin/asterisk -vvvgc -C /etc/asterisk/asterisk.conf # /usr/sbin/asterisk -r -C /etc/asterisk/asterisk.conf ...
Using the QPKG page
- Enable or Disable Asterisk from the QPKG administration page
Asterisk web GUI administration
In order to be able to load the asterisk-gui, the configuration files must be modifies as stated and the Asterisk server restarted.
Then you can use asterisk-gui: http: //<your_nas>:8088/asterisk/static/config/cfgbasic.html NOTE: When the "Advanced options" is enable in the GUI, a CLI console will also be available from the GUI.
Backup the Asterisk configuration
In the left panel click on Backup then on Download from Unit. You can save your configuration files on your local disk for future restore if needed.
Required details: How to reload the saved file from the PC to Asterisk for restoring the settings.
Configure your Asterisk PBX server
Create profiles (DialPlan)You may have different types of phone usages to manage (conference rooms, employees, guests, etc.).
Each will have different privileges to access or not some areas such as international calls. The profiles are stored in DialPlans.
To create the first profile, click on Dial Plans and Save. Leave options as is for this very first profile.
Create new users
In order to test our Asterisk PBX, we need at least 2 users.
Create the users with the here below parametersCallerID: 6000 and 60001 Name : User1 and User2 DiaPlan: DialPlan1 Enable Voicemail for this User: Checked
Click on Voicemail on the left panel and setup as follow: (we use 999 for the because it's the one used by default our softphones)Extension for checking messages 999 Direct Voicemail Dial checked Say message Caller-ID checked Say message duration checked Play envelope checked Allow users to review checked
Set the language
On the left panel select Options and click on the tab "Languages".
Select the preferred language.
Display Advanced options
On the left panel select Options and click on the tab "Advanced options".
Click on "Show Advanced Options", additional actions are displayed at the bottom of the left pane.
Testing the PBX
Install on two (Windows) computers two softphones for examples. We have used 3CX softphones (http://www.3cx.com).
- Configure each phone numbers extension 6000 and 6001.
- Set an ID (name of PC user for example)
- Click on “Advanced setting” and check “I’m in the office – local IP” and enter your nas IP address
- Click on button "Appy Changes".
If you forget this step you get error message: "Not connected: Destination not found"
You must be able to talk to each other and do much more like leaving message, parking a call, etc…
DebuggingShall you encounter issues with Asterisk and 3CX, you may enable the debugging window to get some information regarding the problem.
Connect your PBX to the outside (add a Service provider trunk)
From the left panel, select Trunks and a new page is displayed with four tabs. There are 4 possibility to connect your IPBX to the outside:
- using an external hardware box to connect to a standard PSTN line
- using the VOIP capability and pre-setting of your ISP box if listed
- setting manually the SIP/IAX parameters for your trunk using the VOIP capability of your ISP box
- using an hardware to use your connection to support VOIP
Depend of your external hardware.
Select "Configure Hardware" from the Asterisk Control Panel left pane and setup the Analog Hardware parameters.
The list of providers is stored under /etc/asterisk/providers.conf. By default such a list is empty. The provider parameters may be listed in the "providers.conf" file for easy future installation of the trunk. I have created (but of course, I have no way to test all the configuration inside) a list to help the trunk configuration.
Here is an sample of providers.conf for some ISPs.
Depend of your ISP.
Select the type (IAX/SIP), enter Provider Name, Hostname, Username and Password.
It assumes the "Provider name" parameters to be define somewhere else in the configuration files.
Depend of your digital hardware.
Select "Configure Hardware" or "mISDN Config" from the Asterisk Control Panel left pane and setup the parameters.
Remove Asterisk (IPKG installation)
After manual installation# /opt/sbin/asterisk -rx 'stop now' # ipkg remove asterisk-sounds # ipkg remove asterisk-gui # ipkg remove asterisk14
- Uninstall Asterisk QPKG from the QNAP Admin page (this is a small QPKG)
- Uninstall Asterisk QPKG from the QNAP Admin page (this is the "official" QPKG)
Need to configure a softphone, an IP Phone, the voicemail, etc …