C# Class SIPLib.SIP.Proxy

This class is used to build a SIP proxy. It extends the Useragent class to allow correct handling of messages when acting as a SIP proxy.
Inheritance: SIPLib.SIP.UserAgent
Mostrar archivo Open project: richardspiers/C-Sharp-Sip-Lib

Public Methods

Method Description
CreateRequest ( string method, object dest, bool stateless = false, bool recordRoute = false, Dictionary
headers = null, List
route = null ) : Message

Creates a SIP request.

CreateTransaction ( Message request ) : Transaction

Simply passed the request on to the receivedRequest function when acting as a proxy.

Error ( Transaction transaction, string error ) : void

Raises an error (Service unavailable etc)

IsLocal ( SIPURI uri ) : bool

Determines whether the specified URI is local.

Proxy ( SIPStack stack, Message request, bool server ) : System

Initializes a new instance of the T:SIPLib.SIP.Proxy class.

ReceivedRequest ( Transaction transaction, Message request ) : void

Receives the SIP request, modifies headers and passes on to the stack.

ReceivedResponse ( Transaction transaction, Message response ) : void

Receives the SIP response

SendCancel ( ) : void

Sends a SIP cancel request

SendRequest ( Message request ) : void

Sends the SIP request.

SendResponse ( object response, string responseText = "", string content = "", string contentType = "", bool createDialog = true ) : void

Sends a SIP response.

Private Methods

Method Description
GetBranch ( Transaction transaction ) : SIPLib.SIP.ProxyBranch

Returns the branch ID for the specified transaction.

RetryNextCandidate ( SIPLib.SIP.ProxyBranch branch ) : void

Retries the next candidate to send to.

SendResponseIfPossible ( ) : void

Sends a SIP response if possible.

TimeOut ( Transaction transaction ) : void

Handles request timeouts

Method Details

CreateRequest() public method

Creates a SIP request.
public CreateRequest ( string method, object dest, bool stateless = false, bool recordRoute = false, Dictionary
headers = null, List
route = null ) : Message
method string The SIP method.
dest object The dest (either Address or string[]).
stateless bool if set to true [act as a stateless proxy].
recordRoute bool if set to true [record the SIP route].
headers Dictionary
The SIP headers to use.
route List
The route.
return Message

CreateTransaction() public method

Simply passed the request on to the receivedRequest function when acting as a proxy.
public CreateTransaction ( Message request ) : Transaction
request Message The request.
return Transaction

Error() public method

Raises an error (Service unavailable etc)
public Error ( Transaction transaction, string error ) : void
transaction Transaction The transaction.
error string The error.
return void

IsLocal() public method

Determines whether the specified URI is local.
public IsLocal ( SIPURI uri ) : bool
uri SIPURI The URI.
return bool

Proxy() public method

Initializes a new instance of the T:SIPLib.SIP.Proxy class.
public Proxy ( SIPStack stack, Message request, bool server ) : System
stack SIPStack The SIP stack to use.
request Message The incoming request to proxy.
server bool if set to true [server].
return System

ReceivedRequest() public method

Receives the SIP request, modifies headers and passes on to the stack.
public ReceivedRequest ( Transaction transaction, Message request ) : void
transaction Transaction The transaction.
request Message The request.
return void

ReceivedResponse() public method

Receives the SIP response
public ReceivedResponse ( Transaction transaction, Message response ) : void
transaction Transaction The transaction.
response Message The response.
return void

SendCancel() public method

Sends a SIP cancel request
public SendCancel ( ) : void
return void

SendRequest() public method

Sends the SIP request.
public SendRequest ( Message request ) : void
request Message The request.
return void

SendResponse() public method

Sends a SIP response.
public SendResponse ( object response, string responseText = "", string content = "", string contentType = "", bool createDialog = true ) : void
response object The response.
responseText string The response text.
content string The SIP body content.
contentType string Type of the content.
createDialog bool Always false for a Proxy.
return void