Asterisk
- Server application for everything telephony
- Currently very single server based but future development is to address scalability concerns.
Terms
- Channel - connection between Asterisk and some telephony endpoint
- Channel bridging - connect channels together to pass data between them
- Generic - handle audio - high level
- Native - understands underlying comms layer and can possibly use hardware to improve efficiency
- Frames
- media frames - portion of a stream
- signalling frames - call events e.g. hang up, digit pressed etc.
Abstractions
- Core acts as a module registry - connects abstract interfaces to make calls work
- Concrete implementations of those interfaces are in loadable modules
- Channel Driver - translates between Asterisk channel abstraction and underlying telephony technology. Examples of methods are:
- call
- answer
- read/write frames
- Dialplan - handles extensions in a cofig file
- loads applications for specifc number e.g. answer, playback(sound), voicemail
- series of steps for each extension can allow for chains of applications to be executed
- can pass parameters to applications e.g. caller id, time call started.
- Codec translators
- encoding media
- compress audio, increase volume etc.
Threads
- Heavily threaded application - uses POSIX threads
- Network Monitor Threads: monitor a network e.g. ip, pstn. Responsible for initial connectin setup and then hand over to a channel thread.
- Channel Threads: Created for each channel that executes a dialplan. Dialplan applications always execute in the context of a channel thread.
Call Scenarios
Checking Voicemail
- Channel thread handles dialplan execution. Eventually gets to VoicemailMain application.
- This handles call interaction but underlying tech to enter button presses etc is abstracted away from it.
- If the Voicemail application needs to play a sound to the user then the Asterisk channel may need to setu a codec translator to convert the audio to the correct format.
Bridged Call
- Dialplan executes the Dial application which knows the typed of protocol to use to create the outgoing connection.
- Once both channels have been setup then the bridging of the channels begins
- During a bridge audio and signalling events are passed from one channel to the other via a codec translator until an event occurs that causes the bridge to end e.g. one side hangs up.
- The codec translator communicates with the channel core using framein and frameout calls.