Asterisk Overview - National Convergence Technology Center

Download Report

Transcript Asterisk Overview - National Convergence Technology Center

Asterisk

“The Future of Telecommunications” Vincente D’Ingianni

Director of Professional Services Binary Systems, Inc.

[email protected]

www.convergencetechnologycenter.org

DUE 402356

What is Asterisk?

 Asterisk is a complete VoIP Softswitch, designed to reproduce the features of standard office PBX system.

 Asterisk is also a Voice over IP toolkit which allows interaction between these PBX features and IP-based networks (local and remote.)  Asterisk is hardware independent, and is designed to run on numerous operating systems.

2 www.convergencetechnologycenter.org

Mark Spencer – Creator of Asterisk

Mark Spencer and Vincente D’Ingianni presenting at SIP Sizzles 2003 www.convergencetechnologycenter.org

3

Asterisk Softswitch System Architecture

Proprietary API SIP

Asterisk

H.323

IAX MGCP SCCP PCI Bus Ethernet Ethernet Ethernet Media Gateways / Endpoints www.convergencetechnologycenter.org

4

Asterisk Capabilities

 Telephony gateway (TDM channels - PRI,POTS)  VoIP Gateway (IP channels)  IVR system (Interactive Voice Response)  Voicemail System  Scriptable telephony-to-anything (Perl, C, etc.)  much, much more… www.convergencetechnologycenter.org

5

Asterisk is not…

 A Billing system  A CRM system  A web server or XML server  A configuration tool for VoIP devices  A voice recognition system  A USENET or email client

…but it is often bundled with these subsystems to form a complete solution.

6 www.convergencetechnologycenter.org

Asterisk Goals

       Provide Open-Source implementations of basic PBX functionality Be vendor neutral (despite last point here) Be as all-encompassing as possible for features Be flexible and provide hooks for advanced features

Move proprietary hardware features into open source software (HMP functionality) Integrate with 3 rd party telephony hardware devices (DSP functionality)

Sell TDM hardware cards for Digium www.convergencetechnologycenter.org

7

Who is Digium?

 Primary supporter of Asterisk development.

 Owner of the CVS server/bug system/mailing list boxes/etc.

  Approves all patches and features by community Produces TDM cards (“Wildcard” hardware) which works particularly well with Asterisk  Owner of the disclaimers for all contributions to Asterisk, holder of copyright 8 www.convergencetechnologycenter.org

Asterisk is not quite GPL

 Asterisk

is

GPL, but with an important clause  Digium can license branches of the source such that those branches are not GPL  Digium gets disclaimers from all contributors saying that Digium can license branches of the code.

9 www.convergencetechnologycenter.org

VoIP Channels

  SIP - Session Initiation Protocol (internal stack) H.323 – via OpenH323 Project   MGCP - Media Gateway Control Protocol (internal stack) SCCP – Cisco Skinny Protocol (internal stack)  IAX – Inter-Asterisk eXcange Protocol  Special open-source protocol developed for communicaiton between Asterisk servers.

www.convergencetechnologycenter.org

10

VoIP Channel Endpoints

 Phones for VoIP (SIP):        Grandstream 102 Cisco ATA 186 Sipura Cisco 7960/7940 Polycom IP-501, IP-601, etc.

Snome Many others  Software for VoIP (SIP)  www.xten.com free SIP client (“Lite”)  gnophone.com - Linux SIP client  Windows Messenger www.convergencetechnologycenter.org

11

TDM and Other Channels

 TDM POTS cards (Digium, Zapata, Voicetronix, etc.)       TDM Digital (AdTran VoFR, Digium E1/T1, etc.) All TDM cards require install of Zaptel driver suite CAPI (ISDN card support for Linux ISDN driver) USB dongle for FXS Modem drivers for certain modems Speaker/headphones 12 www.convergencetechnologycenter.org

System Requirements

       No clear rule of thumb on processor size; at least 500 MHz PIII recommended.

Almost any version of Linux is supported.

Source & binaries (including sounds) are ~35 MB Using complex codecs (i.e.: G.729, Speex, etc.) will increase processor load dramatically  Remember this is processed on the host processor – HMP Best to have a > 1.5 GHz machine for multi-channel use.

Mac OS X / FreeBSD is becoming stable for non-hardware channels.

VMWare and Parallels Virtual Machines 13 www.convergencetechnologycenter.org

Call Flow (briefly)

 Calls come in on

channels

and are then handed to the “extensions.conf” file, which is the

dialplan

 Dialplan contains logical sections of matches called ‘Contexts,’ and each channel sends a call into the dialplan with a context name and a dialed number.

 The dialplan then matches (with modified regexp’s) the number being

dialed

, and runs applications accordingly  Each match on the dialed number has an order of steps called ‘Priorities’, and are indicated with an integral incrementing number.

www.convergencetechnologycenter.org

14

Regular Expressions (briefly)

     All regular expressions start with “_” character in dial examinations.

“X” means any number, “N” is any number other than 0 or 1 “.” means any number of characters Brackets represent groups, with standard “-” and “,” meanings ([1-9] or [0,1,2]) Example: _1410985012X is the same as _1410985012[0-9] 15 www.convergencetechnologycenter.org

Call Flow (cont’d)

[from-my-pri] exten => 14109850123,1,Answer exten => 14109850123,2,Wait(2) exten => 14109850123,3,Playback(monkeys) exten => 14109850123,4,Goto(more-monkeys,123,1) [more-monkeys] exten => _12X,1,Playback(sorry-no-more-monkeys) exten => _12X,2,Hangup www.convergencetechnologycenter.org

16

Redirection based on ANI

   You can match against calling number instead of called number. This is known as “The ex-girlfriend filter” by the inventor of the routines This pattern matches against called number (1410…) and also against calling numer (301…)

exten => 14109850123/3013659999,1,Busy

17 www.convergencetechnologycenter.org

Redirection of Call Flow

   GotoIf - can parse basic Booleans GotoIfTime - handy way to deal with time-based redirection Some applications will add 101 to the existing priority when certain errors occur (notably, Dial does this on busy, and DBget/DBput do this on errors reading from the internal database)  Any other type of errors result in channel hangup 18 www.convergencetechnologycenter.org

Variables

 ${VARNAME} is how variables are used   Variables must be declared before Booleans can be performed Variables can be nested during setting exten => 123,1,SetVar(BAR=blah) exten => 123,2,SetVar(FOO=3) exten => 123,3,SetVar(NEWVAR.${FOO} = ${BAR}) This results in ${NEWVAR.3} being set to “blah” 19 www.convergencetechnologycenter.org

Special Variables

   ${EXTEN} - always the most important variable. This is the number that is being currently evaluated.

${CALLERIDNUM} - the ANI (if available) of the call leg that is creating the call Some others, less used: ${EPOCH}, ${ENV(var)}, ${CONTEXT}, ${PRIORITY}, several other descriptors of the call leg we’re processing 20 www.convergencetechnologycenter.org

Some Applications

 Dial - connects an inbound call with some other channel. The first argument specifies the technology (SIP, Zap, H323, etc.) and the number to be dialed, the Ring-No-Answer delay, and options (if desired) exten => 1234,1,Dial(SIP/1234,25) exten => 1234,2,Voicemail2(u1234) www.convergencetechnologycenter.org

21

Some Applications (cont’d)

 Playback(filename)  Plays a sound file in .gsm format  Background(filename)  [test] Plays a sound file while listening for DTMF (touch tone) input exten => 123,1,Background(press-a-number) exten => 123,2,Goto(1) exten => _X,1,SayDigits(${EXTEN}) 22 www.convergencetechnologycenter.org

Some Applications (cont’d)

 MeetMe(conf#)  Adds the caller to a conference room (optionally muted or unmuted)  Monitor  Records channel (in and out) to .wav or .gsm files  PrivacyManager  Forces anonymous calls to enter valid ANI 23 www.convergencetechnologycenter.org

Some Applications (cont’d)

  DISA  Lets callers from one channel get dialtone on another channel SetMusicOnHold  You can specify .mp3 files as music on hold selections (random or sequential)  MP3Player  Fairly useless, but fun. You can specify files or streams of .mp3 to be played to callers.

www.convergencetechnologycenter.org

24

Some Applications (cont’d)

 There are over 80 different applications in the system – more created each day.

  Applications are easily created and added if you’re a decent C coder or scripting coder.

Channels are generic, so you don’t have to know about any of the ugly VoIP or TDM stuff. 25 www.convergencetechnologycenter.org

Voicemail

 Voicemail can be sent as email as well as stored on disk  (1 minute = 100KB)     Short pages can be sent to email addresses when VM received Customizable timezones and time readouts per user - supports multiple languages WAV or GSM file format for storage or

email

Dial by name directory hinges on VM data 26 www.convergencetechnologycenter.org

Practical Uses

 Ditch your long distance company! SIP long distance (domestic and int) providers starting to crop up at low rates. Use Asterisk to gateway to them.

 Prevent phone spam! Callers with no CID get ditched.

 Filter your phone lines. Allow or forward callers who are on “priority” lists based on ANI.

www.convergencetechnologycenter.org

27

Practical Uses

 Enterprise-quality SIP connection services are now available.

      Interconnect office PBXs at zero network cost Get “Unified Messaging” Give ubiquitous access to the PBX for home/traveling employees Disaster recovery scenarios Move phones into your IT department and away from your expensive PBX consulting firm Eliminate adds/moves/changes as physical chores www.convergencetechnologycenter.org

28

Advanced Topics

 Call queues - you can build a call center with Asterisk, with various call weightings and agent logins/hot seating  Multi-ring, cascading ring with different technologies (inbound calls forward to your desk line and your cell phone - first answer gets it)  Multi-language support with same dialplan  Festival integration for voice synthesis 29 www.convergencetechnologycenter.org

Really Advanced Topics

 Manager interface: TCP socket based interface for controlling and monitoring the system; meant for automated manager tools (see: gastman)  AGI scripts: built-in scriptable hooks to allow passing of data back and forth between Asterisk and external programs.

 Asterisk.pm - Perl module that works with AGI to handle grunt work of call handling 30 www.convergencetechnologycenter.org

Really Advanced Topics (cont)

 Sybase and MySQL modules  CDR (call detail record) output can be customized or put into database instead of flat file  Use IAX2 trunk mode to get up to 200% more calls in the same bandwidth as other VoIP systems  Dynamically Route your calls to least-cost providers 31 www.convergencetechnologycenter.org

Other Asterisk Applications

 Can run PPP or HDLC over channels  Asterisk can be a RAS server or a router  Can use speaker/microphone as a “phone line”  Video Calls or Conferencing  ENUM e.164 DNS-based call routing  Example: 2.1.2.1.2.5.4.3.0.5.1.e164.arpa.

 TDM over ethernet for front-end processing www.convergencetechnologycenter.org

32

Asterisk Resources

 http://www.asterisk.org/ - Latest Source Code  http://www.digium.com/ - Asterisk TDM hardware  http://www.voip-info.org/ - General VoIP How-To Info  http://www.xten.com/ - Softphone  http://www.asterisk-vonage.com/ - Asterisk to Vonage connectivity  http://www.binary-systems.com/ - Asterisk Consulting & Training Services www.convergencetechnologycenter.org

33