AMiProxy Class

The core of the Suite, the AMIProxy class. This is the class that accepts new connections and also connects to your Asterisk PBX.

Accepting Client connections

> Instantiate AMIProxy
> Initialise Server
> Wait for connections
> Accept and thread new connection

StartServer.png
Blue underlined text is an async running method

Connecting to Asterisk

> Call InitiateConection()
> Connect to Asterisk AMI and listen for messages
> Waits for Welcome message from Asterisk AMI
> Sends Login details to Asterisk AMI
> Waits for response
> If login authenticated issue sippeers to find all sippeers
> Continue to listen to messages and process each one using LogEvent();

Initialise.png
Blue underlined text is an async running method

Public Methods

public void InitiateConnection(String username, String password, String hostName, Int32 port, String sendFromAddress, String sendToAddress, String smtpServer, String logPath, Boolean logging)
public void ShutdownServer()

InitiateConnection

Creates a new connection to the Asterisk AMI server within its own Delegate.

Paramater Description
username Username for Asterisk AMI
password Password for Asterisk AMI
hostName Asterisk server hostname or IP
port Asterisk AMI port number
sendFromAddress Any errors that the AMiProxy encounters will get sent from this address
sendToAddress The E-mail address errors will get sent to
smtpServer SMTP server to use for sending E-mails
logPath A path to save all output sent from Asterisk - For debugging reasons
logging Turn on logging - For debugging

ShutdownServer

Closes the socket to the Asterisk AMI and all connected clients.

Last edited Jun 15, 2011 at 10:14 AM by Cadey, version 2

Comments

No comments yet.