Asterisk Architecture Xtreme
Transcript of Asterisk Architecture Xtreme
-
8/11/2019 Asterisk Architecture Xtreme
1/27
Asterisk ArchitectureA glimpse under the hood
Joshua Colp
Software DeveloperDigium, Inc.
-
8/11/2019 Asterisk Architecture Xtreme
2/27
What will be covered
General Overview
Incoming Call Flow
Outgoing Call Flow
Call Bridging
Transfers (Attended/Blind)
-
8/11/2019 Asterisk Architecture Xtreme
3/27
General Overview
Modularized easy to plug new stuff
in
Abstracted everything internallyspeaks the same
-
8/11/2019 Asterisk Architecture Xtreme
4/27
Module Types
Channel Drivers
Applications
Dialplan Functions
Resource Modules
Codecs File Formats
-
8/11/2019 Asterisk Architecture Xtreme
5/27
Abstraction
All module types have defined
callbacks
Each module must implement thedefined callbacks
Core API calls use the callbacks to
interact
-
8/11/2019 Asterisk Architecture Xtreme
6/27
-
8/11/2019 Asterisk Architecture Xtreme
7/27
Channel
No knowledge of underlying protocol
Has link back to channel driver
Contains audio/video format
information
Contains context/extension/priority
information
-
8/11/2019 Asterisk Architecture Xtreme
8/27
PBX
Knows of
contexts/extensions/priorities
Executes applications/dialplanfunctions on channels
Cleans up channel when it has hung
up
-
8/11/2019 Asterisk Architecture Xtreme
9/27
Application
No knowledge of underlying protocol
Interacts with channel through
standard API
-
8/11/2019 Asterisk Architecture Xtreme
10/27
Incoming Call (Simple)
Channel driver accepts call
Asterisk channel is created
Sent into dialplan
Applications are executed on it
Channel is hung up
-
8/11/2019 Asterisk Architecture Xtreme
11/27
Incoming Call (API)
ast_channel_alloc
ast_pbx_start
ast_read calls read
ast_write calls write
ast_hangup calls hangup
-
8/11/2019 Asterisk Architecture Xtreme
12/27
Incoming Call (Diagram)
Channel Driver
Core
PBX
Application
ast_channel_alloc
ast_pbx_start
ast_readast_write
-
8/11/2019 Asterisk Architecture Xtreme
13/27
Outgoing Call (Simple)
Channel is requested from channel
driver
Channel is called
Calling thread handles channel
Channel is hung up
-
8/11/2019 Asterisk Architecture Xtreme
14/27
Outgoing Call (API)
ast_request calls requester
ast_call calls call
ast_read calls read
ast_write calls write
ast_hangup calls hangup
-
8/11/2019 Asterisk Architecture Xtreme
15/27
Outgoing Call (Future)
ast_dial_new
ast_dial_append
ast_dial_run
ast_dial_answered
ast_dial_destroy
-
8/11/2019 Asterisk Architecture Xtreme
16/27
-
8/11/2019 Asterisk Architecture Xtreme
17/27
Bridging (API)
ast_bridge
ast_waitfor_nandfds
ast_read
ast_write
-
8/11/2019 Asterisk Architecture Xtreme
18/27
Bridging (Diagram)
ast_bridge_call
ast_waitfor_nandfds
Core
ast_read
ast_write
-
8/11/2019 Asterisk Architecture Xtreme
19/27
Bridging (Internal)
Channels are waited on
If a frame is read from one it is written
to the other
If a channel hangs up the bridge is
broken
-
8/11/2019 Asterisk Architecture Xtreme
20/27
Bridging (Future)
ast_bridge_new
ast_bridge_join
ast_bridge_impart
ast_bridge_destroy
-
8/11/2019 Asterisk Architecture Xtreme
21/27
Blind Transfer (Simple)
Dialtone is provided
Digits are collected
Remote party is sent to new extension
-
8/11/2019 Asterisk Architecture Xtreme
22/27
Blind Transfer (API)
ast_app_dtget (if Asterisk side)
ast_async_goto
-
8/11/2019 Asterisk Architecture Xtreme
23/27
-
8/11/2019 Asterisk Architecture Xtreme
24/27
Attended Transfer (Simple)
Dialtone is provided
Digits are collected
New party is called
Caller transfers new party to existing
remote party
-
8/11/2019 Asterisk Architecture Xtreme
25/27
Attended Transfer (API)
ast_app_dtget (if Asterisk side)
ast_channel_masquerade
-
8/11/2019 Asterisk Architecture Xtreme
26/27
Masquerading
Allows a channel to take the place of
another at any time
Mostly used by attended transfers
Contents of each channel are
exchanged
One becomes a zombie, the other
goes on normal
-
8/11/2019 Asterisk Architecture Xtreme
27/27
Questions?