C# Класс 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.
Наследование: SIPLib.SIP.UserAgent
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CreateRequest() публичный Метод

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.
Результат Message

CreateTransaction() публичный Метод

Simply passed the request on to the receivedRequest function when acting as a proxy.
public CreateTransaction ( Message request ) : Transaction
request Message The request.
Результат Transaction

Error() публичный Метод

Raises an error (Service unavailable etc)
public Error ( Transaction transaction, string error ) : void
transaction Transaction The transaction.
error string The error.
Результат void

IsLocal() публичный Метод

Determines whether the specified URI is local.
public IsLocal ( SIPURI uri ) : bool
uri SIPURI The URI.
Результат bool

Proxy() публичный Метод

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].
Результат System

ReceivedRequest() публичный Метод

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.
Результат void

ReceivedResponse() публичный Метод

Receives the SIP response
public ReceivedResponse ( Transaction transaction, Message response ) : void
transaction Transaction The transaction.
response Message The response.
Результат void

SendCancel() публичный Метод

Sends a SIP cancel request
public SendCancel ( ) : void
Результат void

SendRequest() публичный Метод

Sends the SIP request.
public SendRequest ( Message request ) : void
request Message The request.
Результат void

SendResponse() публичный Метод

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.
Результат void