real-time multimedia and communication in packet networks

27
Real-time multimedia and communication in packet networks Asterisk The open source IP PBX

Upload: gordy

Post on 16-Jan-2016

34 views

Category:

Documents


0 download

DESCRIPTION

Real-time multimedia and communication in packet networks. Asterisk The open source IP PBX. Some 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Real-time multimedia and communication in packet networks

Real-time multimedia and communication in packet networks

AsteriskThe open source IP PBX

Page 2: Real-time multimedia and communication in packet networks

Some 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

Page 3: Real-time multimedia and communication in packet networks

Some AdminYou 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 establishmentwith 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 itsIP number?

Please make sure that problems that you had yesterday are cleared in thefirst part of the lecture.

Enjoy Asterisk!

Page 4: Real-time multimedia and communication in packet networks

Some 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

Page 5: Real-time multimedia and communication in packet networks

What 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?

Page 6: Real-time multimedia and communication in packet networks

What 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?

Page 7: Real-time multimedia and communication in packet networks

What 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?

Page 8: Real-time multimedia and communication in packet networks

Asterisk – Supported Communication Technologies

• Asterisk is designed to allow new interfaces and technologies to be added easily

• Asterisk’s goal is to support every kind of telephony technology possible

• Asterisk interfaces divided into 3:• Zaptel hardware• Non-Zaptel hardware• Packet voice

Page 9: Real-time multimedia and communication in packet networks

Zaptel 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

Page 10: Real-time multimedia and communication in packet networks

Zaptel 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

Page 11: Real-time multimedia and communication in packet networks

Packet 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

Page 12: Real-time multimedia and communication in packet networks

Asterisk’s Architecture

Page 13: Real-time multimedia and communication in packet networks

Modules and Applications

• Asterisk’s core contains several engines that play a critical role in the software’s 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

• Asterisk’s 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

Page 14: Real-time multimedia and communication in packet networks

Asterisk’s Architecture

• Modular API for Asterisk responsible for Asterisk’s success• Channel API, File Format API, Codec API, Application

API

Page 15: Real-time multimedia and communication in packet networks

Some Asterisk configurations (basic)

• Asterisk box contains• 1 analog interface for telephone (FXS interface)• 1 analog interface to PSTN (FXO interface)• Ethernet interface for VoIP

Page 16: Real-time multimedia and communication in packet networks

Some 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)

Page 17: Real-time multimedia and communication in packet networks

Some 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)

Page 18: Real-time multimedia and communication in packet networks

Asterisk 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

Page 19: Real-time multimedia and communication in packet networks

Asterisk 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

Page 20: Real-time multimedia and communication in packet networks

Asterisk Channels

• Channel naming convention in Asterisk is standard• Outgoing channel names (used in Dial application) named in

format:• <technology>/<dialstring>

• <technology> represents type of interface you want to address or use• E.g. Zap, SIP, IAX2, etc

• <dialstring> is a driver-specific string representing destination desired

Page 21: Real-time multimedia and communication in packet networks

Asterisk Channels (Zap)

• <technology>/<dialstring>• Zap / [g] <identifier>

• <identifier> = number of the channel you are trying to address

• If <identifier> 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)

Page 22: Real-time multimedia and communication in packet networks

Asterisk Channels (SIP)

• Outgoing channels typical of the form• SIP / [exten@] <domain> [:<portno>]

• E.g.• SIP/mos• SIP:[email protected]• SIP/[email protected]:5060

Page 23: Real-time multimedia and communication in packet networks

Asterisk Channels (IAX)

• IAX2 / [<user> [:<secret>] @] <domain> [:<portno>] [/<exten>[@<context>][/<options>]]

• Where <user> and <secret> are optional username and secret to connect to the host identified by <peer> and

• <portno> = optional port number, • <exten> = specific extension at an optional context

<context>, and optionally with <options> connection options

• E.g• IAX2/authname:[email protected]/

442081234567@default • Call to voiptalk.org using “authname” as username and

“secretpass” as password, and requesting extension 442081234567 in default context

Page 24: Real-time multimedia and communication in packet networks

Running Asterisk and Environment

• Asterisk can be run in console mode or as a daemon process• E.g. asterisk –vvvgc (console mode with verbose=3

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)• vitalstatistix*CLI>

Page 25: Real-time multimedia and communication in packet networks

Asterisk 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

Page 26: Real-time multimedia and communication in packet networks

sip.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/Asterisk+config+sip.conf

Page 27: Real-time multimedia and communication in packet networks

Tomorrow’s Tutorial

1) Create an account for your phone

2) Play around with some of the settings in the sip.conf file