Class SipTransactionBase
Base class for SIP transactions. See Section 17 of RFC 3261.
Inheritance
Inherited Members
Namespace: SipLib.Transactions
Assembly: SipLib.dll
Syntax
public class SipTransactionBase
Constructors
| Edit this page View SourceSipTransactionBase(SIPRequest, IPEndPoint, SipTransactionCompleteDelegate?, SipTransport)
Transaction base class constructor
Declaration
public SipTransactionBase(SIPRequest request, IPEndPoint remoteEndPoint, SipTransactionCompleteDelegate? transactionComplete, SipTransport TransportManager)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | SIP request to send for client transactions or the request that was received for server transactions |
IPEndPoint | remoteEndPoint | Destination to send the request to for client transactions or the source of the request for server transactions |
SipTransactionCompleteDelegate | transactionComplete | Notification callback. May be null if a notification is not required.. |
SipTransport | TransportManager | SipTransportManager that is managing this transaction |
Fields
| Edit this page View SourceCompletionSemaphore
Semaphore to signal when a transaction is completed or terminated.
Declaration
protected SemaphoreSlim CompletionSemaphore
Field Value
Type | Description |
---|---|
SemaphoreSlim |
LastSipResponseSent
The most recent SIPResponse that was sent to a client if this transaction is a server transaction. Not used for client transactions.
Declaration
protected SIPResponse? LastSipResponseSent
Field Value
Type | Description |
---|---|
SIPResponse |
MaxAttempts
Maximum number of transmission attempts for a request
Declaration
protected const int MaxAttempts = 3
Field Value
Type | Description |
---|---|
int |
NumAttempts
Number of transmission attempts made so far
Declaration
protected int NumAttempts
Field Value
Type | Description |
---|---|
int |
RemoteEndPoint
Endpoint to send the request to if the transaction is a client transaction or the source of a request if the transaction is a server transaction.
Declaration
public IPEndPoint? RemoteEndPoint
Field Value
Type | Description |
---|---|
IPEndPoint |
Request
SIPRequest for the transaction.
Declaration
public SIPRequest? Request
Field Value
Type | Description |
---|---|
SIPRequest |
RequestReceived
Event that is fired when the transaction receives a SIP request.
Declaration
public TransactionRequestReceivedDelegate? RequestReceived
Field Value
Type | Description |
---|---|
TransactionRequestReceivedDelegate |
RequestSentTime
Time that the request was sent.
Declaration
protected DateTime RequestSentTime
Field Value
Type | Description |
---|---|
DateTime |
ResponseReceived
Event that is fired when the transaction receives a SIP response.
Declaration
public TransactionResponseReceivedDelegate? ResponseReceived
Field Value
Type | Description |
---|---|
TransactionResponseReceivedDelegate |
State
Current state of the transaction.
Declaration
protected TransactionStateEnum State
Field Value
Type | Description |
---|---|
TransactionStateEnum |
StateLockObj
Used by derived classes for locking the state variables
Declaration
protected object StateLockObj
Field Value
Type | Description |
---|---|
object |
StateStartTime
Time that the transaction entered the current state.
Declaration
protected DateTime StateStartTime
Field Value
Type | Description |
---|---|
DateTime |
T1IntervalMs
SIP T1 timer in milliseconds.
Declaration
protected int T1IntervalMs
Field Value
Type | Description |
---|---|
int |
TransactionComplete
Method to call when the transaction either completes or times out
Declaration
protected SipTransactionCompleteDelegate? TransactionComplete
Field Value
Type | Description |
---|---|
SipTransactionCompleteDelegate |
TransactionStartTime
Time that the transaction started.
Declaration
protected DateTime TransactionStartTime
Field Value
Type | Description |
---|---|
DateTime |
m_transportManager
Transport manager to use for sending messages
Declaration
protected SipTransport? m_transportManager
Field Value
Type | Description |
---|---|
SipTransport |
Properties
| Edit this page View SourceLastReceivedResponse
Gets the last response received for a client transaction. Will be null if a response was never received.
Declaration
public SIPResponse? LastReceivedResponse { get; protected set; }
Property Value
Type | Description |
---|---|
SIPResponse |
TerminationReason
Gets the reason that the transaction was terminated.
Declaration
public TransactionTerminationReasonEnum TerminationReason { get; protected set; }
Property Value
Type | Description |
---|---|
TransactionTerminationReasonEnum |
TransactionID
Gets the TransactionID that uniquely identifies the transaction
Declaration
public string? TransactionID { get; protected set; }
Property Value
Type | Description |
---|---|
string |
TransportManager
Gets the SipTransportManager that is managing this transaction
Declaration
public SipTransport? TransportManager { get; }
Property Value
Type | Description |
---|---|
SipTransport |
Methods
| Edit this page View SourceGetClientTransactionID(SIPRequest)
Calculates the TransactionID for a client transaction. See Section 17.1.3 of RFC 3261.
Declaration
protected static string GetClientTransactionID(SIPRequest request)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | Request that was sent. |
Returns
Type | Description |
---|---|
string | Returns the TransactionID for the request. |
GetClientTransactionID(SIPResponse)
Calculates the TransactionID for a client transaction given the response. See Section 17.1.3 of RFC 3261. This method is used for calculating the transaction ID of a SIP response message so that it may be matched to an existing transaction.
Declaration
public static string GetClientTransactionID(SIPResponse response)
Parameters
Type | Name | Description |
---|---|---|
SIPResponse | response |
Returns
Type | Description |
---|---|
string |
GetServerTransactionID(SIPRequest)
Gets the TransactionID for a server transaction. See Section 17.2.3 of RFC 3261.
Declaration
public static string GetServerTransactionID(SIPRequest request)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | request | Request that was received |
Returns
Type | Description |
---|---|
string |
NotifyTransactionUser(SIPRequest, SIPResponse?, IPEndPoint)
Notifies the transaction user that the transaction has either terminated or timed out.
Declaration
protected void NotifyTransactionUser(SIPRequest Request, SIPResponse? Response, IPEndPoint RemoteEndPoint)
Parameters
Type | Name | Description |
---|---|---|
SIPRequest | Request | Request relating to the transaction |
SIPResponse | Response | Response that was received. May be null if a response was never received |
IPEndPoint | RemoteEndPoint | Remote endpoint for the transaction. |
WaitForCompletionAsync()
Asynchronously waits for the transaction to complete.
Declaration
public Task<SipTransactionBase> WaitForCompletionAsync()
Returns
Type | Description |
---|---|
Task<SipTransactionBase> |