Message processing

The guts of the Asterisk AMI Proxy isnt how it proxies the messages but how it uses the messages from Asterisk to maintain its own version of what is going on with your PBX.

Some of you may find this a little strange as the project is called "Asterisk AMI Proxy suite" but we had to start from somthing :)

Message processing - from Clients


ClientHandler.png

When a client has connected to the AMI Proxy Suite they can join diffrent chains of output which will be sent to there socket. The following commands can be sent to the AMI Proxy, each one has a simple diagram explaining what the AMP Proxy does when the message is received by the client.

ListenHandler

Message to send from client:-
string message = "Command: Listen\r\nExtension: 2000,2001\r\n\r\n";

ListenHandler.png

AMIProxyHandler

Message to send from client:-
string message = "Command: AMIProxy\r\n\r\n";

AMIProxyHandler.png

CallStatsHandler

Message to send from client:-
string message = "Command: CallStat\r\n\r\n";

CallStatsHandler.png

PhoneStateMonitorHandler

Messages to send from client:-
string message = "Command: PhoneStateMonitor\r\nExtension: 2000,2001\r\n\r\n";
string message = "Command: PhoneStateMonitor\r\nExtension: all\r\n\r\n";

PhoneStateMonitorHandler.png

RelaytoAsterisk

The replay to Asterisk handler handles any message which you can send to the Asterisk AMI if connected to it directly.

Messages to send from client:-
string message = "Action: sippeers\r\nActionID: myAction\r\n\r\n";

RelaytoAsterisk.png

Message processing - from Asterisk

Messages from Asterisk

When a new message from Asterisk arrives at the AMI Proxy quite a lot happens, most of which is because of the additional features the AMI Proxy manages for you. We will start by explaining the main proxy functionality and them move onto the extra features such as the Extension monitor, Line monitor and calls stats.

Basic proxy feature

ProxyHandler.png

The following methods are all used to power the extra feature of the AMI Proxy, Extension monitor, Line monitor and the call stat processor. It would be still remain very unclear on what these handlers do if we explained them all individualy and so we will explain what these handlers do in the diffrent contexts they are used. For example, how the AMI Proxy keeps an interneal list of each extensions channels and each channels status up to date.

 private void PeerStatusHandler(string text)
 private void ResponseHandler(string text);
 private void NewStateHandler(string text);
 private void HangupHandler(string text);
 private void RenameHandler(string text);
 private void MusicOnHoldHandler(string text);
 private void DialHandler(string text);
 private void PeerEntryHandler(string text);
 private void VarSetHandler(string text);
 private void MasqueradeHandler(string text);
 private void TransferHandler(string text);
 private void BridegHandler(string text);
 private void LeaveHandler(string text);
 private void JoinHandler(string text);
 private void NewExten(string text);

Last edited Jun 15, 2011 at 11:11 AM by Cadey, version 6

Comments

No comments yet.