Class SipTransport
This class manages sending and receiving SIP messages on a single SIPChannel. It also manages SIP transactions for transactions on that SIPChannel.
Inherited Members
Namespace: SipLib.Transactions
Assembly: SipLib.dll
Syntax
public class SipTransport
Constructors
| Edit this page View SourceSipTransport(SIPChannel)
Constructor
Declaration
public SipTransport(SIPChannel sipChannel)
Parameters
Type | Name | Description |
---|---|---|
SIPChannel | sipChannel | SIPChannel to use for sending and receiving SIP messages. |
Properties
| Edit this page View SourceSipChannel
Gets the SIPChannel object that this class is managing.
Declaration
public SIPChannel SipChannel { get; }
Property Value
Type | Description |
---|---|
SIPChannel |
TransactionCount
Gets the number of active transactions.
Declaration
public int TransactionCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceSendSipRequest(SIPRequest, IPEndPoint)
Sends a SIP request on the SIPChannel
Declaration
public void SendSipRequest(SIPRequest Request, IPEndPoint DestEp)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | Request | SIP request to send |
IPEndPoint | DestEp | Destination endpoint |
SendSipResponse(SIPResponse, SIPEndPoint)
Sends a SIP response message on the SIPChannel. This method fires the LogSipResponse event for NG9-1-1 event logging.
Declaration
public void SendSipResponse(SIPResponse Response, SIPEndPoint DestEp)
Parameters
Type | Name | Description |
---|---|---|
SIPResponse | Response | SIP response message to send |
SIPEndPoint | DestEp | Destination SIPEndPoint to send the message to. |
SendSipResponse(SIPResponse, IPEndPoint)
Sends a SIP response message on the SIPChannel. This method fires the LogSipResponse event for NG9-1-1 event logging.
Declaration
public void SendSipResponse(SIPResponse Response, IPEndPoint DestEp)
Parameters
Type | Name | Description |
---|---|---|
SIPResponse | Response | SIP response message to send |
IPEndPoint | DestEp | Destination IPEndPoint to send the message to. |
Shutdown()
Call this method to shutdown the processing thread and close the SIP channel and all current connections.
Declaration
public void Shutdown()
Start()
Call this method after hooking the events to start the message processing thread.
Declaration
public void Start()
StartClientInvite(SIPRequest, IPEndPoint, SipTransactionCompleteDelegate?, TransactionResponseReceivedDelegate?)
Creates and starts a client INVITE transaction.
Declaration
public ClientInviteTransaction StartClientInvite(SIPRequest request, IPEndPoint remoteEndPoint, SipTransactionCompleteDelegate? completeDelegate, TransactionResponseReceivedDelegate? responseReceivedDelegate)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | SIP INVITE request to send |
IPEndPoint | remoteEndPoint | Destination to send the request to |
SipTransactionCompleteDelegate | completeDelegate | Notification callback. Called when the transaction is completed or terminated. May be null if a notification is not required. |
TransactionResponseReceivedDelegate | responseReceivedDelegate | Callback function to call when a response is received for the transaction. Optional, may be null. This may be used when the client transaction user needs to be informed of provisional responses (ex. 180 Ringing or 183 Session Progress) |
Returns
Type | Description |
---|---|
ClientInviteTransaction | Returns a new ClientInviteTransaction object |
StartClientInviteAsync(SIPRequest, IPEndPoint, TransactionResponseReceivedDelegate?)
Creates and starts a client INVITE transaction asynchronously.
Declaration
public Task<ClientInviteTransaction> StartClientInviteAsync(SIPRequest request, IPEndPoint remoteEndPoint, TransactionResponseReceivedDelegate? responseReceivedDelegate)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | SIP INVITE request to send |
IPEndPoint | remoteEndPoint | Destination to send the request to |
TransactionResponseReceivedDelegate | responseReceivedDelegate | Callback function to call when a response is received for the transaction. Optional, may be null. This may be used when the client transaction user needs to be informed of provisional responses (ex. 180 Ringing or 183 Session Progress) |
Returns
Type | Description |
---|---|
Task<ClientInviteTransaction> | Returns a ClientInviteTransaction that contains the results of the transaction |
StartClientNonInviteTransaction(SIPRequest, IPEndPoint, SipTransactionCompleteDelegate?, int)
Creates and starts a client non-INVITE SIP transaction
Declaration
public ClientNonInviteTransaction StartClientNonInviteTransaction(SIPRequest request, IPEndPoint remoteEndPoint, SipTransactionCompleteDelegate? completeDelegate, int FinalResponseTimeoutMs = 32000)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | SIP request to send |
IPEndPoint | remoteEndPoint | Destination to send the request to |
SipTransactionCompleteDelegate | completeDelegate | Notification callback. Called when the transaction is completed or terminated. May be null if a notification is not required. |
int | FinalResponseTimeoutMs | Number of milliseconds to wait for a final response. This corresponds to Timer F shown in Figure 6 of RFC 3261. The default value is 32,000 milliseconds (64 * T1, where T1 is 500 ms). |
Returns
Type | Description |
---|---|
ClientNonInviteTransaction | Returns a new ClientNonInviteTransaction object |
StartServerInviteTransaction(SIPRequest, IPEndPoint, SipTransactionCompleteDelegate?, SIPResponse)
Creates and starts a server INVITE transaction.
Declaration
public ServerInviteTransaction StartServerInviteTransaction(SIPRequest request, IPEndPoint remoteEndPoint, SipTransactionCompleteDelegate? completeDelegate, SIPResponse ResponseToSend)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | INVITE request that was received. |
IPEndPoint | remoteEndPoint | IP endpoint of the remote client that sent the request. |
SipTransactionCompleteDelegate | completeDelegate | Notification callback. Called when the transaction is completed or terminated. May be null if a notification is not required. |
SIPResponse | ResponseToSend | Initial response to send to the client. Will be sent when the transport layer calls the StartTransaction() method. |
Returns
Type | Description |
---|---|
ServerInviteTransaction | Returns a new ServerInviteTransaction object. |
StartServerNonInviteTransaction(SIPRequest, IPEndPoint, SipTransactionCompleteDelegate?, SIPResponse)
Creates and starts a server non-INVITE transaction.
Declaration
public ServerNonInviteTransaction StartServerNonInviteTransaction(SIPRequest request, IPEndPoint remoteEndPoint, SipTransactionCompleteDelegate? completeDelegate, SIPResponse ResponseToSend)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | SIP request that was received by the server. |
IPEndPoint | remoteEndPoint | IP endpoint of the remote client that sent the request. |
SipTransactionCompleteDelegate | completeDelegate | Notification callback. Called when the transaction is completed or terminated. May be null if a notification is not required. |
SIPResponse | ResponseToSend | Initial response to send to the client. Will be sent when the transport layer calls the StartTransaction() method. |
Returns
Type | Description |
---|---|
ServerNonInviteTransaction | Returns a new ServerNonInviteTransaction object |
Events
| Edit this page View SourceLogInvalidSipMessage
Event that is fired if this SipTransport object receives an invalid SIP message.
Declaration
public event LogInvalidSipMessageDelegate? LogInvalidSipMessage
Event Type
Type | Description |
---|---|
LogInvalidSipMessageDelegate |
LogSipRequest
Event that is fired for every SIP request that is sent or received by the SipTransport class. For received requests, this event is fired after the request is sent to a transaction object or to the SipTransport user.
Declaration
public event LogSipRequestDelegate? LogSipRequest
Event Type
Type | Description |
---|---|
LogSipRequestDelegate |
LogSipResponse
Event that is fired for every SIP response that is sent or received by the SipTransport class. For received responses, this event is fired after the response is sent to a transaction object or to the SipTransport user.
Declaration
public event LogSipResponseDelegate? LogSipResponse
Event Type
Type | Description |
---|---|
LogSipResponseDelegate |
SipRequestReceived
Event that is fired when a SIP request is received. This event is not fired if the SIP request is handled by a SIP transaction object (a SipTransactionBase derived class). The SIP transaction layer may pass the request up to the transaction user if required.
Declaration
public event SipRequestReceivedDelegate? SipRequestReceived
Event Type
Type | Description |
---|---|
SipRequestReceivedDelegate |
SipResponseReceived
Event that is fired when a SIP response is received. This event is not fired if the SIP response is handled by a SIP transaction object (a SipTransactionBase derived class). The SIP transaction layer may pass the response up to the transaction user if required.
Declaration
public event SipResponseReceivedDelegate? SipResponseReceived
Event Type
Type | Description |
---|---|
SipResponseReceivedDelegate |