C# Class SIPSorcery.AppServer.DialPlan.ForkCall

Show file Open project: sipsorcery/sipsorcery Class Usage Examples

Public Methods

Method Description
CancelNotRequiredCallLegs ( CallCancelCause cancelCause ) : void
ForkCall ( SIPTransport sipTransport, SIPMonitorLogDelegate statefulProxyLogEvent, QueueNewCallDelegate queueNewCall, DialStringParser dialStringParser, string username, string adminMemberId, SIPEndPoint outboundProxy, ISIPCallManager callManager, DialPlanContext dialPlanContext ) : System The ForkCall allows a SIP call to be forked to multiple destinations. To do this it utilises multiple simultaneous SIPCallDescriptor objects and consolidates their responses to work out what should and shouldn't be forwarded onto the client that initiated the call. The ForkCall acts as a classic SIP forking proxy. The ForkCall is capable of both multiple forwards and also of follow on forwarding in the event of a call leg of multiple forwards not succeeding. As an example: Dial(provider1&provider2|provider3&provider4|provider5&provider6) The handling of this call would be: 1. The call would be simultaneously forwarded to provider1 and provider2, 2. If the call was not successfully answered in step 1 the call would be simultaneously forwarded to provider3 and provider4, 3. If the call was not successfully answered in step 2 the call would be simultaneously forwarded to provider5 and provider6, 4. If the call was not successfully answered in step 3 the client call would be sent an error response. 5. If the client cancels the call at any time during the call all forwarding operations will halt.
ForkCall ( SIPTransport sipTransport, SIPMonitorLogDelegate statefulProxyLogEvent, QueueNewCallDelegate queueNewCall, DialStringParser dialStringParser, string username, string adminMemberId, SIPEndPoint outboundProxy, ISIPCallManager callManager, DialPlanContext dialPlanContext, List &switchCallTransactions ) : System

See overload.

Start ( List callDescriptors ) : void

Starts a call based on a single multi forward call leg.

Start ( Queue callsQueue ) : void

Starts a call based on multiple forking call legs. As each call leg fails the next leg is popped off the queue and attempted.

Private Methods

Method Description
CallLegCompleted ( ) : void

Fired after each call leg forward attempt is completed.

FireProxyLogEvent ( SIPMonitorEvent monitorEvent ) : void
ProcessRedirect ( ISIPClientUserAgent answeredUAC, SIPResponse answeredResponse ) : void
StartNewCallAsync ( SIPCallDescriptor callDescriptor ) : void
StartNewCallSync ( SIPCallDescriptor callDescriptor ) : void
UACCallAnswered ( ISIPClientUserAgent answeredUAC, SIPResponse answeredResponse ) : void
UACCallFailed ( ISIPClientUserAgent uac, string errorMessage ) : void

This event occurs if it was not possible to initiate a call to the destination specified in the forwarded call. An example would be an unresolvable hostname in the destination URI.

UACCallProgress ( ISIPClientUserAgent uac, SIPResponse progressResponse ) : void

Method Details

CancelNotRequiredCallLegs() public method

public CancelNotRequiredCallLegs ( CallCancelCause cancelCause ) : void
cancelCause CallCancelCause
return void

ForkCall() public method

The ForkCall allows a SIP call to be forked to multiple destinations. To do this it utilises multiple simultaneous SIPCallDescriptor objects and consolidates their responses to work out what should and shouldn't be forwarded onto the client that initiated the call. The ForkCall acts as a classic SIP forking proxy. The ForkCall is capable of both multiple forwards and also of follow on forwarding in the event of a call leg of multiple forwards not succeeding. As an example: Dial(provider1&provider2|provider3&provider4|provider5&provider6) The handling of this call would be: 1. The call would be simultaneously forwarded to provider1 and provider2, 2. If the call was not successfully answered in step 1 the call would be simultaneously forwarded to provider3 and provider4, 3. If the call was not successfully answered in step 2 the call would be simultaneously forwarded to provider5 and provider6, 4. If the call was not successfully answered in step 3 the client call would be sent an error response. 5. If the client cancels the call at any time during the call all forwarding operations will halt.
public ForkCall ( SIPTransport sipTransport, SIPMonitorLogDelegate statefulProxyLogEvent, QueueNewCallDelegate queueNewCall, DialStringParser dialStringParser, string username, string adminMemberId, SIPEndPoint outboundProxy, ISIPCallManager callManager, DialPlanContext dialPlanContext ) : System
sipTransport SIPSorcery.SIP.SIPTransport The SIP transport layer that will handle the forked calls.
statefulProxyLogEvent SIPMonitorLogDelegate A delegate that allows the owning object to receive notifications from the ForkCall.
queueNewCall QueueNewCallDelegate A delegate that can be used to queue a new call with the SIP application server call manager. This /// delegate is used when a fork call generates a B2B call that requires the incoming dialplan for a called user to be processed.
dialStringParser DialStringParser The dial string parser is used when a redirect response is received on a forked call leg. The /// parser can then be applied to the redirect SIP URI to generate new call legs to be added to the ForkCall.
username string The username of the call owner.
adminMemberId string The admin ID of the call owner.
outboundProxy SIPSorcery.SIP.SIPEndPoint The outbound proxy to use for all SIP traffic originated. Can be null if an outbound proxy is not /// being used.
callManager ISIPCallManager
dialPlanContext DialPlanContext
return System

ForkCall() public method

See overload.
public ForkCall ( SIPTransport sipTransport, SIPMonitorLogDelegate statefulProxyLogEvent, QueueNewCallDelegate queueNewCall, DialStringParser dialStringParser, string username, string adminMemberId, SIPEndPoint outboundProxy, ISIPCallManager callManager, DialPlanContext dialPlanContext, List &switchCallTransactions ) : System
sipTransport SIPSorcery.SIP.SIPTransport
statefulProxyLogEvent SIPMonitorLogDelegate
queueNewCall QueueNewCallDelegate
dialStringParser DialStringParser
username string
adminMemberId string
outboundProxy SIPSorcery.SIP.SIPEndPoint
callManager ISIPCallManager
dialPlanContext DialPlanContext
switchCallTransactions List An empty list that will be filled with transactions that the ForkCall creates and that each /// represent an outgoing call. The calling object can use the list to check response codes to determine the result of each leg in the /// ForkCall.
return System

Start() public method

Starts a call based on a single multi forward call leg.
public Start ( List callDescriptors ) : void
callDescriptors List
return void

Start() public method

Starts a call based on multiple forking call legs. As each call leg fails the next leg is popped off the queue and attempted.
public Start ( Queue callsQueue ) : void
callsQueue Queue
return void