C# Class SIPSorcery.Servers.SIPAppServerManager

Example call dispatcher workers node: C:\Temp\sipsorcery-appsvr1\sipsorcery-appsvr.exe -sip:{0} -cms:{1} 127.0.0.1:5070 http://localhost:8081/callmanager
Inheritance: ISIPCallDispatcher
Show file Open project: sipsorcery/sipsorcery Class Usage Examples

Public Methods

Method Description
GetCallManagerClient ( ) : CallManagerProxy

Retrieves the first healthy application server WCF call manager proxy from the list of worker processes. This proxy can be used for initiating web calls and is the interface between the web and the SIP application servers.

GetFirstHealthyWorker ( ) : SIPAppServerWorker

Retrieves the first healthy application server worker from the list.

SIPAppServerManager ( SIPMonitorLogDelegate logDelegate, SIPTransport sipTransport, XmlNode appServerWorkersNode, string appServerEndPointsPath ) : System
Stop ( ) : void

Called when the SIPAppServerManager is being shutdown. Informs each of the threads they should halt whatever they are doing and exit.

Private Methods

Method Description
AppServerCallFailed ( ISIPClientUserAgent uac, string errorMessage, int workerProcessID, System.DateTime probeSentAt, bool isInitialProbe ) : void

Event handler for a failed probe response.

AppServerCallSucceeded ( ISIPClientUserAgent uac ) : void

Event handler for a successful probe response.

GetWorkerForEndPoint ( string host ) : SIPAppServerWorker

Matches a SIP end point to an app server worker process.

ManageWorker ( XmlNode appServerWorkerNode ) : void

Method that gets spawned on a dedicated thread to manage an app server process.

ProbeWorker ( SIPAppServerWorker worker, bool isInitialProbe ) : void

Sends the SIP INVITE probe request.

ProbeWorkers ( ) : void

Sends a probe, which is a SIP INVITE request, to the first healthy application server. Probes will also be resent to any application servers that have not responded to their initial probe.

RecycleAppServer ( SIPAppServerWorker badAppServerWorker, int delaySeconds, XmlNode appServerWorkerNode ) : SIPAppServerWorker
SpawnWorkers ( ) : void

Runs a persistent thread that does the initial start up of the SIP application server workers and then restarts the process as necessary.

StartWorkerProcess ( SIPAppServerWorker worker ) : void

Starts a new SIP application server worker process.

WorkerIsHealthy ( SIPAppServerWorker worker ) : void

Event handler that gets fired when a worker process is identified as being healthy after start up.

WorkerIsUnhealthy ( SIPAppServerWorker worker ) : void

Event handler that gets fired when a worker process is identified as being unhealthy at any point in its lifetime.

Method Details

GetCallManagerClient() public method

Retrieves the first healthy application server WCF call manager proxy from the list of worker processes. This proxy can be used for initiating web calls and is the interface between the web and the SIP application servers.
public GetCallManagerClient ( ) : CallManagerProxy
return CallManagerProxy

GetFirstHealthyWorker() public method

Retrieves the first healthy application server worker from the list.
public GetFirstHealthyWorker ( ) : SIPAppServerWorker
return SIPAppServerWorker

SIPAppServerManager() public method

public SIPAppServerManager ( SIPMonitorLogDelegate logDelegate, SIPTransport sipTransport, XmlNode appServerWorkersNode, string appServerEndPointsPath ) : System
logDelegate SIPMonitorLogDelegate
sipTransport SIPSorcery.SIP.SIPTransport
appServerWorkersNode System.Xml.XmlNode
appServerEndPointsPath string
return System

Stop() public method

Called when the SIPAppServerManager is being shutdown. Informs each of the threads they should halt whatever they are doing and exit.
public Stop ( ) : void
return void