Subscribe to News

Asterisk

Author : Jbuenol

From TechnologicalWiki

Jump to: navigation, search
VoIP Scheme

Contents

[edit] What's Asterisk ?

Asterisk® is an open source telephony engine ( PBX[1] ) and tool kit. Offering flexibility unheard of in the world of proprietary communications, Asterisk empowers developers and integrators to create advanced communication solutions.

Asterisk® creates a PBX that rivals the features and functionality of traditional telephony switches. Asterisk is cost-effective, low-maintenance, and flexible enough to handle all voice and data networking.

With Asterisk® software, Telephony hardware, and a common PC, anyone can replace an existing switch or complement a PBX by adding VoiceOverIP, voicemail, conferencing, and many other capabilities. Asterisk integrates with analog phones and most standards-based IP telephone handsets and software.

Asterisk® is released as open source under the GNU General Public License (GPL), and it is available for download free of charge. Asterisk® is the most popular open source software available, with the Asterisk Community being the top influencer in VoIP.

Asterisk® was created by Mark Spencer of Digium, Inc in 1999. Code has been contributed from open source coders around the world, and testing and bug-patches from the community have provided invaluable aid to the development of this software.

Like any PBX switchboard it allows to interconnect phones and connect them to the conventional telephone network (PSTN - basic telephone network).

At the beginning, it was created for Linux Systems, but nowadays it works also in OpenBSD, FreeBSD, Mac OS X, Solaris Sun and Windows systems. Anyway, Linux is the platform which has most technical support.

[edit] Features

The basic Asterisk software includes many features available in proprietary PBX systems: voice mail, conference calling, interactive voice response (phone menus), and automatic call distribution. Users can create new functionality by writing dial plan scripts in Asterisk's own language, by adding custom modules written in C, or by writing Asterisk Gateway Interface (AGI) scripts in Perl or other languages.

To attach ordinary telephones to a Linux server running Asterisk, or to connect to PSTN trunk lines, the server must be fitted with special hardware. Digium and a number of other firms sell PCI cards to attach telephones, telephone lines, T1 and E1 lines, and other analog and digital phone services to a server.

Perhaps of more interest to many deployers today, Asterisk also supports a wide range of Voice over IP protocols, including SIP[2], MGCP[3] and H.323[4]. Asterisk can interoperate with most SIP telephones, acting both as registrar and as a gateway between IP phones and the PSTN. Asterisk developers have also designed a new protocol, Inter-Asterisk eXchange (IAX2), for efficient trunking of calls among Asterisk PBXes, and to VoIP service providers who support it. Some telephones support the IAX2 protocol directly for communicating with an Asterisk server (see Comparison of VoIP software for examples).

By supporting a mix of traditional and VoIP telephony services, Asterisk allows deployers to build new telephone systems, or gradually migrate existing systems to new technologies. Some sites are using Asterisk servers to replace proprietary PBXes; others to provide additional features (such as voice mail or phone menus) or to cut costs by carrying long-distance calls over the Internet (toll bypass).

VoIP telephone companies have begun to support Asterisk; many now offer IAX2 or SIP trunking direct to an Asterisk box as an alternative to providing the customer with an ATA[5].

Asterisk was one of the first open-source PBX server systems, of which there are now many.

[edit] Structure & Hardware

A Voip System requires the following components :

  • An IP Phone / USB Phone (connected to the PC) / Soft Phone ( Phone IP Emulator for PC).
  • A IP PBX Device which provides IP service to the users ( ASTERISK in this case ).

This scheme is enough to build a Local Network System. Also you can found other components in a VoIP network, depending of the communications devices. For example, It's not the same, calling with a phone from the PSTN and calling from a SIP Phone from internet. Some additional modules are necessaries to get a calling through these ways. In the first case, it's necessary a VoIP Gateway to convert the analog signal to IP packets, to transports these through the VoIP network. If you need to make / receive calling to / from internet a router (or similar device) is necessary ( Internet <-> Local VoIP network ). FXO (WAP Version) ( Foreign Exchange Office ) is a computer device that allows it to connect to the PSTN, and through a special software, make and receive phone calls. It serves mainly to implement telephone exchange (PBX) with a computer. Devices for connecting a phone to a computer are so-called FXS (WAP Version). There are devices that are called FXO and are used in VoIP gateway, as well as cards with computer functions of telephone exchanges. A clear example of FXO is a typical modem.

[edit] External Lines

[edit] Releases

For Linux:

Complete source code for the most current Asterisk release and Asterisk in Beta.

[edit] Linux Versions

  • Asterisk : Basic Software Package. This is a totally free package of Asterisk which contains the basical and advanced PBX features of Asterik Software. Also is available the Community-based Support and the source code.
  • AsteriskNOW™ : Wizard Software Package. This version includes a graphical interface to easily configure your Asterisk software (included). AsteriskNOW™ includes all the Linux components necessary to run, debug and build Asterisk, and only those components, so installation is easy.

AsteriskNOW™ Overview.

  • Asterisk Business Edition : This is the package which contains more support than the other ones, including a technical manual. Also, this package has got special testing & certification.


For Windows:

AsteriskWin32 0.66b build from Asterisk 1.2.26.2

Note: Looking for source code

Deprecated: AsteriskWin32 0.60 build from Asterisk 1.2.14

[edit] Installation

[edit] For Linux

Once you have downloaded the source code for Asterisk, to continue with the general installation you need to compile these sources to create the binaries.

  • General Asterisk Installation :

Accomplish this by opening the folder in which the source codes were extracted (if you are using tarball files), or go to the /usr/src/asterisk folder (if using CVS server) to get the required packages.

To go to this directory, see example:

  • #cd /usr/src/asterisk

Once here, the final step is to compile:


>>> Important: Follow this installation order: libpri ( digital connections Support ), zaptel ( Zaptel cards Support ), asterisk <<<


-Installing libpri

  • #cd /usr/src/asterisk/libpri
  • #make clean
  • #make
  • #make install

-Installing zaptel

  • #cd /usr/src/asterisk/zaptel
  • #make clean

Note: If you are using kernel 2.6 enter the following command '#make linux26', before doing '#make install'.

  • #make install

-Installing asterisk

  • #cd /usr/src/asterisk/asterisk
  • #make clean

Note: If you want to use a mp3 file for music-on-hold enter the following command '#make mpg123', before doing '#make install'.

  • #make install

How to install Asterisk.

If this is your first installation perform 'make samples' to install sample configuration files. From this moment Asterisk is already installed and working. You can use the command "help" for help. The Asterisk configuration files will be installed in the directory /etc/asterisk where you can find a lot of information.

You can configure a softphone ( as SJPhone ) to gain access to our own Asterisk. The configuration we have done brings two users by default.

[edit] For Windows

AsteriskWin32 ( Asterisk running under Cygwin[6] ) Install & Notes Run under NT/2000/XP


  • Installation:

- Download, run : AsteriskWin32Setup-0.66.exe

- By default AsteriskWin32 is installed in a directory named cygroot on your system. It will create four subdirs asterisk, bin, lib, tmp. AsteriskWin32 executables are located in bin directory.

- If you have already cygwin installed on your system you must install AsteriskWin32 inside cygwin root directory, so change the default cygroot: install directory to your cygwin directory.


  • Configuration:

- Launch PBX Manager F.E.

- Open administration panel: default password: admin

- Default Setup: USERS: Setup your default users: SIP or IAX phones device, password, mailbox, email for extensions:3000-3004

- SMTP: Setup your smtp parameters for voicemail delivery.

- PSTN connection: AsteriskWin32 will autodetect your two first avaible voice modems. (channel details)

- ISDN connection: AsteriskWin32 will autodetect your first avaible ISDN controller. (channel details)

- CELLULAR Network connection: AsteriskWin32 use your soundcard connected to your cellphone. (channel details)

- Now you can launch the PBX from the Manager or connect to the PBX running in background.


  • Run it:

- GUI version: AsteriskWin32 GUI. stay in tray.

- Console version: AsteriskWin32 Console. could be installed as a service.

- Check on the LOGGER for Errors.

for AsteriskWin32 Applications Notes : click here


  • Setup your SoftPhones:

Have fun !

To see several demo videos about Asterisk Installation for Windows click here

[edit] Running Asterisk

Finally you can start the Asterisk with the command:

  1. Asterisk -vvvc

If you're using a debian based distribution, you can start Asterisk such as:

/etc/init.d/asterisk start

Then, you can connect to Asterisk with:

 asterisk -rvvvvvvv 

You'll see a lot of messages on the screen when Asterisk is initialized. (vvv belong to the way "very very verbose" and the c indicates that it will be shown a line at the end command in console)

*CLI

From this moment Asterisk is already installed and working. You can use the command "help" for help.

You can also use the command "man asterisk" on the command line Linux for details on how to start and stop the Asterisk server.

The Asterisk configuration files will be installed in the directory /etc/asterisk where you can find a lot of information.


[edit] A simple example of use

Configuring a softphone as SJPhone (for more info consult configuration sjphone) to gain access to our own Asterisk. The configuration we have done brings two users by default we can use:

A: User: 3000 password = any is valid.

B: User: 3001 password = any is valid.

Once you have configured and the user has signed up for our server we can call to test some numbers that come by default in the numbering plan:

1000 - Main Menu.

1234 - Skip call to console (see the call on the console).

1235 - Answering machine console.

1236 - Call the console.

3000 - Called the user SIP 3000.

3001 - Called the user SIP 3001.

500 - Call Digium.

600 - echo test.

8500 - answering's Menu.

99990 Test AGI.

99991 Test EAGI.

99992 You can listen the time.

99999 Susic sounds so infinite.

700 Call waited.

701-720 waited calls.

A good test at this time is to set up 2 softphones in two different computers, one with the user 3000 and another with the 3001 user and try to make a call between the two phones. If it works, we can move on to learn how to configure Asterisk and create new users and Plans numbering.

How to run Asterisk.

[edit] Management

Creating users

Creating extensions for users

Configuring the SoftPhones

[edit] See also

http://www.voip-info.org/wiki/view/Asterisk+quickstart

http://en.wikipedia.org/wiki/FXO

http://en.wikipedia.org/wiki/TAPI

http://en.wikipedia.org/wiki/VOIP

http://en.wikipedia.org/wiki/MGCP

http://en.wikipedia.org/wiki/H.323

http://en.wikipedia.org/wiki/Private_branch_exchange

http://en.wikipedia.org/wiki/Session_Initiation_Protocol

http://en.wikipedia.org/wiki/Analog_telephony_adapter

http://en.wikipedia.org/wiki/FXO

http://en.wikipedia.org/wiki/Foreign_exchange_station

[edit] References

http://www.asteriskguru.com/tutorials/asterisk_installation.html

http://en.wikipedia.org/wiki/Asterisk_(PBX)

[edit] Notes

  1. A private branch exchange (PBX) is a telephone exchange that serves a particular business or office, as opposed to one that a common carrier or telephone company operates for many businesses or for the general public. ..see more
  2. The Session Initiation Protocol (SIP) is a signalling protocol, widely used for setting up and tearing down multimedia communication sessions such as voice and video calls over the Internet. ...see more
  3. MGCP is an implementation of the Media Gateway Control Protocol architecture for controlling Media Gateways on Internet Protocol (IP) networks and the public switched telephone network (PSTN). ...see more
  4. H.323 is an umbrella Recommendation from the ITU Telecommunication Standardization Sector (ITU-T) that defines the protocols to provide audio-visual communication sessions on any packet network. ...see more
  5. Device used to connect one or more standard analog telephones to a digital and/or non-standard telephone system such as a Voice over IP based network. ...see more
  6. Cygwin is a Linux-like environment for Windows. It consists of two parts:
    • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
    • A collection of tools which provide Linux look and feel. ...see more
Main Collaborators