Documente Academic
Documente Profesional
Documente Cultură
Agenda
Asterisk
o
o
o
What is Asterisk?
What Does Asterisk Do?
Asterisk Benefits
Asterisk Architecture
Asterisk as an Application based Platform
o
o
o
o
What is Asterisk?
IP PBXs
VoIP gateways
Call center ACDs
IVR systems
Mobile based applications
applications.
Includes all the building blocks needed to create
o PBX system
o IVR system
o Communications solution
The "blocks" in the kit include:
o Drivers for various VoIP protocols and for PSTN interface cards.
o Routing and call handling (incoming and Outbound calls).
o Media management functions (record, play, generate tone, etc.).
o Call detail recording for accounting and billing.
o Transcoding (conversion from one media format to another).
o Protocol conversion (conversion from one protocol to another).
o Database integration.
o Web services integration.
Interface (AGI).
o Event notification via Asterisk Manager Interface (AMI).
o Speech synthesis "text-to-speech" in various languages.
o Speech recognition in various languages using third party recognition
engines.
Asterisk Benefits
Source code availability, your guarantee for business
continuity
Use of generic hardware means no proprietary lockin
Freely and easily extensible
Reduce cost, improve productivity and improve
customer service
Easy to integrate into External API modules
Extremely cost effective
Asterisk Architecture
Asterisk Architecture
DAHDI
CLI
Applicati
on
Digital
card
drivers
SIP
IAX2
Asterisk
Core
Dialpla
n
Audio/Vid
eo
Codecs
Sys
Config
Drivers
H323
Manager
Interfac
e
Resourc
es
AGI
Dialplan:
Core also contains the dialplan, logic of any Asterisk
system
Dialplan contains a list of instructions that Asterisk should
follow to know how to handle incoming and outgoing calls
on the system
Asterisk Dialplan
Heart of any Asterisk system.
List of rules, instructions and steps guiding the flow of inbound and
branching
It even provides support for advanced AGI
Dialpla
n
Externa
l
Resour
ce
Sound
File
Asteris
k Core
AGI
Externa
l
Resour
ce
Channe
ls
Externa
l
Resour
ce
o
o
Services Request
Services Response
User
Asterisk
Asterisk
Core
Core
Dialplan
Dialplan
DB
DB
ExternalAPI
Programmed API
AGI
AGI Script
Script
3
HOST
HOST
Query to ExternalAPI
Dialplan
Dialplan
AGI
AGI
Script
Script
External
External
API
API
Step 1 (Call
triggered)
Step 2 (Dialplan
Executed)
Step 3 (AGI
Executed)
Step 6
Step 4 (Query to
ExternalAPI)
Step 5 (Query
Response)
Step 7
Step 8 (AGI
Step 9 (Released)
Termination)
Step 10 (Released)
Steps that occur when an AGI script is executed from within the
Asterisk dialplan
ExternalAPI
ExternalAPI is a programmable application is used to allow external systems
External API
External
API
DB & Provisioning
Server
Web Server
Asterisk
Asterisk
AGI
AGI
ExternalAPI
ExternalAPI
Request
<methodcall>
Response
<Response>
Request being
process
Process
completed
Name
<methodCall>
result
<function>provisionService</function>
<Msisdn>0133309331</Msisdn>
resultCode
<cosProfileId>3 </cosProfileId>
<provChannel>IVR</provChannel>
</methodCall>
Sample response message:
<Response>
<result>1</result >
<resultCode>000</resultCode>
</Response>
Data
Type
Int
String
Description
1 - Result Accept,
2 Result Rejected
000 Success
101 msisdn already
registered
102 invalid msisdn
402 Unknown subscriber
604 Timeout, System Busy
605 Error, System Busy
606 db error
E1 Line
Configuration
extensions.conf
[cs_deposit]
exten => _x.,1,Answer()
exten =>
_x.,n,agi(agi://localhost/cs_deposit.a
gi)
AGI can run a Java application (on the same machine that runs Asterisk
or on a separate machine).
Combined with Java's multithreading support can build pretty fast AGI
scripts using this protocol.
using AGI are not bound by the Asterisk License and are not
required to be re-distributed with the source.
Very much similar to a CGI interface used by web server, where
communications between Asterisk and your AGI program is
performed via an STDIN/STDOUT interface.
Invoked from Dialplan (AGI() application)
exten => 123, 1, Answer()
exten => 123, 2, AGI(test.agi)
...
It allows the use of high level languages like Java, Perl, PHP and
Code
200
result=0
510
511
520
so:
exten => 1,2,agi,test.php|${CALLERID}
states.
AMI is built in a simple concept of a line protocol using key:value pairs
over TCP.
Allows external programs to control and monitor Asterisk
If you have lots of connections to AMI consider using Asterisk Manager
Proxy.
AMI Communication:
Asterisk
AMI
TCP
Sock
et
Servi
ce
Action:
Originate
Response:
Success
Event: Dial
Event:
PeerStatus
Event: DTMF
Event: Registry
PHP, JAVA,
C
Application
dial plan.
Action: <action type><CRLF>
<Key 1>: <Value 1><CRLF>
<Key 2>: <Value 2><CRLF>
Variable: <Variable 1>=<Value 1><CRLF>
Variable: <Variable 2>=<Value 2><CRLF>
...
<CRLF>
telnet interface.
Thank You