Asterisk

From QNAPedia
Revision as of 18:38, 26 October 2015 by Glenn (talk | contribs) (catchg)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

By AdNovea – Mars 2009


Asterisk logo
   

HOWTO on Asterisk IP-PABX* (SIP/IAX VoIP)

  • Internet Protocol Private Automatic Branch eXchange aka IP-PBX or IPBX


Asterisk-based telephony is a versatile IPBX with tons of features (see below!) . It supports classical PBX functionality and advanced features, and interoperates with traditional standards-based telephony systems and Voice over IP systems.

  • ADSI On-Screen Menu System
  • Alarm Receiver
  • Append Message
  • Authentication
  • Automated Attendant
  • Blacklists
  • Blind Transfer
  • Call Detail Records
  • Call Forward on Busy
  • Call Forward on No Answer
  • Call Forward Variable
  • Call Monitoring
  • Call Parking
  • Call Queuing
  • Call Recording
  • Call Retrieval
  • Call Routing (DID & ANI)
  • Call Snooping
  • Call Transfer
  • Call Waiting
  • Caller ID
  • Caller ID Blocking
  • Caller ID on Call Waiting
  • Calling Cards
  • Conference Bridging
  • Database Store / Retrieve
  • Database Integration
  • Dial by Name
  • Direct Inward System Access
  • Distinctive Ring
  • Distributed Universal Number Discovery (DUNDi™)
  • Do Not Disturb
  • E911
  • ENUM
  • Fax Transmit and Receive (3rd Party OSS Package)
  • Flexible Extension Logic
  • Interactive Directory Listing
  • Interactive Voice Response (IVR)
  • Local and Remote Call Agents
  • Macros
  • Music On Hold
  • Music On Transfer:

    - Flexible Mp3-based System
    - Random or Linear Play
    - Volume Control

  • Predictive Dialer
  • Privacy
  • Open Settlement Protocol (OSP)
  • Overhead Paging
  • Protocol Conversion
  • Remote Call Pickup
  • Remote Office Support
  • Roaming Extensions
  • Route by Caller ID
  • SMS Messaging
  • Spell / Say
  • Streaming Media Access
  • Supervised Transfer
  • Talk Detection
  • Text-to-Speech (via Festival)
  • Three-way Calling
  • Time and Date
  • Transcoding
  • Trunking
  • VoIP Gateways
  • Voicemail:

    - Visual Indicator for Message Waiting
    - Stutter Dialtone for Message Waiting
    - Voicemail to email
    - Voicemail Groups
    - Web Voicemail Interface

  • Zapateller

Computer-Telephony Integration

  • AGI (Asterisk Gateway Interface)
  • Graphical Call Manager
  • Outbound Call Spooling
  • Predictive Dialer
  • TCP/IP Management Interface

Scalability

  • TDMoE (Time Division Multiplex over Ethernet)
  • Allows direct connection of Asterisk PBX
  • Zero latency
  • Uses commodity Ethernet hardware
  • Voice-over IP
  • Allows for integration of physically separate installations
  • Uses commonly deployed data connections
  • Allows a unified dialplan across multiple offices


Students have a good opportunity to type term papers online  and get help.

Foreword

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

QPKG installation

  • 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

NOTE:
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.

File:Asterisk Dialplan.jpg


Create new users

In order to test our Asterisk PBX, we need at least 2 users.
Create the users with the here below parameters

  CallerID: 				6000 and 60001
  Name : 				User1 and User2
  DiaPlan: 				DialPlan1
  Enable Voicemail for this User:	Checked
File:Asterisk Users.jpg


Configure Voicemail

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   



Advanced options

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…

Debugging

Shall you encounter issues with Asterisk and 3CX, you may enable the debugging window to get some information regarding the problem.

File:Asterisk 3CX-debug.jpg
Asterisk 3CX-debug.jpg


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

Analog trunk

Depend of your external hardware.
Select "Configure Hardware" from the Asterisk Control Panel left pane and setup the Analog Hardware parameters.

Service providers

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.

WhichVoIP also offers free SIP Trunking Provider comparisons and information
Feel free to correct/update this list.

VOIP trunks

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.

T1/E1/BRI Trunks

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)

Asterisk QPKG

  • Uninstall Asterisk QPKG from the QNAP Admin page (this is the "official" QPKG)


More…

Need to configure a softphone, an IP Phone, the voicemail, etc …
http://www.asteriskguru.com/tutorials/


|}