Title: Real-time%20multimedia%20and%20communication%20in%20packet%20networks
1Real-time multimedia and communication in packet
networks
Asterisk The open source IP PBX
2Some House Rules
- Practical component of the course
- Workings and power of asterisk, an IP Private
Branch eXchange (PBX) - Small tutorials will be given on a daily basis
before each lecture - Large practical write your own application that
adds value to an Asterisk PBX - This will be demonstrated to the class at the end
of the course. - Practical to be done on a Linux machine you can
ssh into cc
3Some Admin
You should have by now - found your extension
on pbx.ict.ru.ac.za - registered on iLanga your
two phones (sj and hardphone) - explored the
messaging between the two phones and the SIP
proxy server in iLanga at least in these
situations 1. Registration 2. Call
establishment with callee answering and without
answer (voicemail) - checked the media stream in
iLanga and discovered possible difference with
respect to the case of calling directly an end
point. What happens if you call a telephone
registered with iLanga directly via its IP
number? Please make sure that problems that you
had yesterday are cleared in the first part of
the lecture. Enjoy Asterisk!
4Some House Rules
- Practical component of the course
- Workings and power of asterisk, an IP Private
Branch eXchange (PBX) - Small tutorials will be given on a daily basis
before each lecture - Large practical write your own application that
adds value to an Asterisk PBX - This will be demonstrated to the class at the end
of the course. - Practical to be done on a Linux machine you can
ssh into cc
5What is Asterisk ()?
- A private or enterprise grade exchange generally
referred to as a private branch exchange (PBX)? - Designed to interface telephony hardware or
software with any telephony application
seamlessly and consistently - i.e. Asterisk can be moulded to fit any telephony
application - Asterisk can be used in any of these applications
- Heterogeneous Voice over IP gateway (MGCP, SIP,
IAX, H.323)? - Private Branch eXchange (PBX)?
- Custom Interactive Voice Response (IVR) server
- Conferencing server
- Softswitch?
6What is Asterisk ()?
- A private or enterprise grade exchange generally
referred to as a private branch exchange (PBX)? - Designed to interface telephony hardware or
software with any telephony application
seamlessly and consistently - i.e. Asterisk can be moulded to fit any telephony
application - Asterisk can be used in any of these applications
- Heterogeneous Voice over IP gateway (MGCP, SIP,
IAX, H.323)? - Private Branch eXchange (PBX)?
- Custom Interactive Voice Response (IVR) server
- Conferencing server
- Softswitch?
7What is Asterisk ()?
- A private or enterprise grade exchange generally
referred to as a private branch exchange (PBX)? - Designed to interface telephony hardware or
software with any telephony application
seamlessly and consistently - i.e. Asterisk can be moulded to fit any telephony
application - Asterisk can be used in any of these applications
- Heterogeneous Voice over IP gateway (MGCP, SIP,
IAX, H.323)? - Private Branch eXchange (PBX)?
- Custom Interactive Voice Response (IVR) server
- Conferencing server
- Softswitch?
8Asterisk Supported Communication Technologies
- Asterisk is designed to allow new interfaces and
technologies to be added easily - Asterisks goal is to support every kind of
telephony technology possible - Asterisk interfaces divided into 3
- Zaptel hardware
- Non-Zaptel hardware
- Packet voice
9Zaptel Hardware
- Check out http//www.zapatatelephony.org/
- Provide integration with traditional and legacy
analogue and digital telephone interfaces - Zaptel interfaces available from Digium
(www.digiumcards.com)? - Zaptel interfaces available for a number of
telephony interfaces - ISDN Basic Rate Interface (BRI)?
- ISDN Primary Rate Interface (PRI)?
- Analog FXS interface connect to a station i.e.
analogue phone - Analog FXO interface connect to an office i.e.
PBX
10Zaptel Hardware
Digium 4 x FXS card 342 USD
Digium 2 x FXS, 2 x FXO card 360 USD
Digium BRI card 469 USD
Digium BRI card 1345 USD
11Packet Voice Protocols
- Standard protocols for communication over packet
networks - Only interfaces that do not require specialised
hardware - E.g.
- SIP
- IAX
- H.323
- IAX
- MGCP
12Asterisks Architecture
13Modules and Applications
- Asterisks core contains several engines that
play a critical role in the softwares operation - At startup, Dynamic module loader loads various
modules for - Channel drivers
- File formats
- Codecs
- Applications
- Custom applications launcher i.e. the iLanga
Prepaid Application - Asterisks switching core accepts calls from any
of the various interfaces and routes them
according to the dialplan - Codec translator permits channels which are
compressed with different codecs to talk to each
other - Scheduler and IO Manager which can be used by
applications and drivers
14Asterisks Architecture
- Modular API for Asterisk responsible for
Asterisks success - Channel API, File Format API, Codec API,
Application API
15Some Asterisk configurations (basic)?
- Asterisk box contains
- 1 analog interface for telephone (FXS interface)?
- 1 analog interface to PSTN (FXO interface)?
- Ethernet interface for VoIP
16Some Asterisk configurations
- Asterisk box contains
- One E1 or (PRI) interface connected to a digital
to analog converter or channel bank - 15 phones connected channel bank
- 15 lines to PSTN (i.e. Telkom)?
17Some Asterisk configurations
- In this example we illustrate the possibility of
distributing a number of Asterisk boxes - Each Asterisk box can be interconnected using
- TDM technology e.g. BRI or PRI
- Data technology/VoIP e.g. Inter Asterisk Exchange
(IAX)?
18Asterisk Filesystem Organisation
- /etc/asterisk
- Contains Asterisk configuration files NB
directory - /usr/sbin
- Contains Asterisk binaries
- /usr/lib/asterisk/modules
- Contains runtime modules for channel drivers,
codecs, file formats, applications - /usr/include/asterisk
- Contains Asterisk C header files for the building
the software - /var/lib/asterisk/agi-bin
- Location of Asterisk Gateway Interface (AGI) for
use in dialplan
19Asterisk Filesystem Organisation
- /var/lib/asterisk/astdb
- Asterisk internal database
- Roughly equivalent to Windows registry
- /var/lib/asterisk/mohmp3
- Storage directory mp3s used for music on hold
- /var/lib/asterisk/sounds
- Storage directory for Asterisk audio files e.g.
voice prompts to be used in IVR menus - /var/spool/asterisk/outgoing
- Spooling directory for making outgoing calls
- Can be used for callback function
- /var/spool/asterisk/voicemail
- Storage directory for Asterisk voicemail boxes,
announcements, etc
20Asterisk Channels
- Channel naming convention in Asterisk is standard
- Outgoing channel names (used in Dial application)
named in format - lttechnologygt/ltdialstringgt
- lttechnologygt represents type of interface you
want to address or use - E.g. Zap, SIP, IAX2, etc
- ltdialstringgt is a driver-specific string
representing destination desired
21Asterisk Channels (Zap)?
- lttechnologygt/ltdialstringgt
- Zap / g ltidentifiergt
- ltidentifiergt number of the channel you are
trying to address - If ltidentifiergt prefixed by g then number is
interpreted as a group instead of as a channel - e.g.
- Zap/g1/0027466223458 (Any available line in group
1)? - Zap/1/0027466223458 (TDM channel 1)?
22Asterisk Channels (SIP)?
- Outgoing channels typical of the form
- SIP / exten_at_ ltdomaingt ltportnogt
- E.g.
- SIP/mos
- SIP3000_at_sip.ict.ru.ac.za
- SIP/3000_at_sip.ict.ru.ac.za5060
23Asterisk Channels (IAX)?
- IAX2 / ltusergt ltsecretgt _at_ ltdomaingt
ltportnogt /ltextengt_at_ltcontextgt/ltoptionsgt - Where ltusergt and ltsecretgt are optional username
and secret to connect to the host identified by
ltpeergt and - ltportnogt optional port number,
- ltextengt specific extension at an optional
context ltcontextgt, and optionally with ltoptionsgt
connection options - E.g
- IAX2/authnamesecretpass_at_voiptalk.org/442081234567
_at_default - Call to voiptalk.org using authname as username
and secretpass as password, and requesting
extension 442081234567 in default context
24Running Asterisk and Environment
- Asterisk can be run in console mode or as a
daemon process - E.g. asterisk vvvgc (console mode with verbose3
debugging - Asterisk (daemon) started by typing asterisk
- Please always run asterisk as daemon and connect
to daemon process using - asterisk r
- asterisk -vvvvvr
- When connecting to daemon process you will be
connected to the command line interface of
Astrerisk (CLI)? - vitalstatistixCLIgt
25Asterisk CLI
- When connected to the Asterisk CLI there are a
number of commands you can use - Go and test them out, see what they do,
familiarise yourself with the environment - E.g.
- help
- show applications
- show application x
- show codecs'
- show translation'
- extensions reload
- sip reload
- CLI include command completion via the tab key
26sip.conf
- Please set your phones up to connect to your
development box - Box
- IP 146.231.121.165
- Create a sip.conf file in your home directory,
you can use the reference http//www.voip-info.org
/wiki/view/Asteriskconfigsip.conf -
27Tomorrows Tutorial
- Create an account for your phone
- Play around with some of the settings in the
sip.conf file