Asterisk Overview Asterisk “The Future of

Document Sample
Asterisk Overview Asterisk “The Future of Powered By Docstoc
   “The Future of Telecommunications”

            Vincente D’Ingianni
            Director of Professional Services
            Binary Systems, Inc.
               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
Mark Spencer – Creator of Asterisk

                 Mark Spencer and Vincente D‟Ingianni
                    presenting at SIP Sizzles 2003                     3
Asterisk Softswitch System Architecture

 Proprietary API    SIP     H.323      IAX        MGCP      SCCP

  PCI Bus            Ethernet          Ethernet      Ethernet

                   Media Gateways / Endpoints                                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…                    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
Asterisk Goals
   Provide Open-Source implementations of basic PBX
   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 3rd party telephony hardware devices
    (DSP functionality)
   Sell TDM hardware cards for Digium                       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
   Produces TDM cards (“Wildcard” hardware)
    which works particularly well with Asterisk
   Owner of the disclaimers for all contributions
    to Asterisk, holder of copyright                  8
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
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.                      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)
     - free SIP client (“Lite”)
     - Linux SIP client
       Windows Messenger               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
    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
   VMWare and Parallels Virtual Machines                          13
    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.                             14
Regular Expressions (briefly)
   All regular expressions start with “_” character in dial
   “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
Call Flow (cont’d)

exten => 14109850123,1,Answer
exten => 14109850123,2,Wait(2)
exten => 14109850123,3,Playback(monkeys)
exten => 14109850123,4,Goto(more-monkeys,123,1)

exten => _12X,1,Playback(sorry-no-more-monkeys)
exten => _12X,2,Hangup               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
    Redirection of Call Flow

   GotoIf - can parse basic Booleans
   GotoIfTime - handy way to deal with time-based
   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

   ${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
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
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)             21
Some Applications (cont’d)

   Playback(filename)
       Plays a sound file in .gsm format
   Background(filename)
     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
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
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.                         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
   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
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
   Filter your phone lines. Allow or forward
    callers who are on “priority” lists based on
    ANI.              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
    Disaster recovery scenarios
    Move phones into your IT department and away from your
     expensive PBX consulting firm
    Eliminate adds/moves/changes as physical chores                              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
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.

 - Perl module that works with AGI to
    handle grunt work of call handling                       30
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
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:

   TDM over ethernet for front-end processing                 32
Asterisk Resources
 - Latest Source Code

 - Asterisk TDM hardware

 - General VoIP How-To Info

 - Softphone

 - Asterisk to Vonage connectivity

 - Asterisk Consulting & Training Services                                            33

Shared By:
gjmpzlaezgx gjmpzlaezgx