Asterisk Presentation
Asterisk Presentation
Agenda
Asterisk
o What is Asterisk?
o What Does Asterisk Do?
o 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
Drivers for various VoIP protocols and for PSTN interface cards.
Routing and call handling (incoming and Outbound calls).
Media management functions (record, play, generate tone, etc.).
Call detail recording for accounting and billing.
Transcoding (conversion from one media format to another).
Protocol conversion (conversion from one protocol to another).
Database integration.
Web services integration.
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
Supports a large variety of VoIP and signaling
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:
Asterisk Dialplan
Dialpla
n
Externa
l
Resour
ce
Sound
File
Asteris
k Core
AGI
Externa
l
Resour
ce
Channe
ls
Externa
l
Resour
ce
Services Request
Services Response
User
Asterisk
Core
Dialplan
DB
ExternalAPI
Programmed API
AGI Script
3
HOST
Query to ExternalAPI
Asterisk
Dialplan
AGI
Script
External
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
2010 Unified Communications Holdings Limited Group. All Rights Reserved.
ExternalAPI
External
API
Web Server
Asterisk
AGI
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
[cs_deposit]
extensions.conf
exten => _x.,1,Answer()
exten =>
_x.,n,agi(agi://localhost/cs_deposit.a
gi)
Configuration
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.
2010 Unified Communications Holdings Limited Group. All Rights Reserved.
Application level API, which means that application developed using AGI
are not bound by the Asterisk License and are not required to be redistributed 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 Python
to extend Asterisks functionality.
2010 Unified Communications Holdings Limited Group. All Rights Reserved.
- The first line of a packet will have the key Action when sent from a
client
- The first line of a packet will have a key Response or Event when
coming from Asterisk
- Packages can be transmitted in any direction after the authentication
- Action: A packet sent from a client connected to AMI asking for a specific
action. The loaded modules determine these actions. A packet contains the
action name and its parameters.
- Response: The response sent from Asterisk to the last action sent from
the client.
- Event: Data belonging to an event generated in the Asterisk core or by a
module. When a client sends packets of the Action type, a parameter named
ActionID is included. Since the order in which the responses sent from Asterisk
cannot be predicted, ActionID is used to correlate actions and responses.
2010 Unified Communications Holdings Limited Group. All Rights Reserved.
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
It is also possible too pass channel and global variables to the 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>
There are simply too many options like Java, PHP, Perl, C, C#,
Python, and several others.
Its possible to use AMI with any language that supports a socket
or telnet interface.
Thank You