C# Класс SIPSorcery.SIP.SIPTransport

Record number of each type of request received.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
BlackholeAddress System.Net.IPAddress
ContactIPAddress System.Net.IPAddress
PerformanceMonitorPrefix string

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

Метод Описание
AddSIPChannel ( List sipChannels ) : void

Adds additional SIP Channels to the transport layer.

AddSIPChannel ( SIPChannel sipChannel ) : void

Adds an additional SIP Channel to the transport layer.

CreateCancelTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, UASInviteTransaction inviteTransaction ) : SIPCancelTransaction
CreateNonInviteTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy ) : SIPNonInviteTransaction
CreateUACTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy, bool sendOkAckManually = false ) : UACInviteTransaction
CreateUASTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy, bool noCDR = false ) : UASInviteTransaction
DoesTransactionExist ( SIPRequest sipRequest ) : bool
FindSIPChannel ( SIPEndPoint localSIPEndPoint ) : SIPChannel

Attempts to match a SIPChannel for this process that has the specified local end point and protocol.

GetDefaultSIPEndPoint ( ) : SIPEndPoint
GetDefaultSIPEndPoint ( SIPEndPoint destinationEP ) : SIPEndPoint
GetDefaultSIPEndPoint ( SIPProtocolsEnum protocol ) : SIPEndPoint
GetDefaultTransportContact ( SIPProtocolsEnum protocol ) : SIPEndPoint
GetHostEndPoint ( string host, bool async ) : SIPDNSLookupResult
GetListeningSIPEndPoints ( ) : List
GetRequest ( SIPMethodsEnum method, SIPURI uri ) : SIPRequest
GetRequest ( SIPMethodsEnum method, SIPURI uri, SIPToHeader to, SIPEndPoint localSIPEndPoint ) : SIPRequest
GetRequestEndPoint ( SIPRequest sipRequest, SIPEndPoint outboundProxy, bool async ) : SIPDNSLookupResult

Based on the information in the SIP request attempts to determine the end point the request should be sent to.

GetResponse ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : SIPResponse

Used to create a SIP response when it was not possible to parse the incoming SIP request.

GetResponse ( SIPRequest sipRequest, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : SIPResponse
GetTransaction ( SIPRequest sipRequest ) : SIPTransaction
GetTransaction ( string transactionId ) : SIPTransaction
GetURIEndPoint ( SIPURI uri, bool async ) : SIPDNSLookupResult
IsLocalSIPEndPoint ( SIPEndPoint sipEndPoint ) : bool
PreProcessRouteInfo ( SIPRequest sipRequest ) : void

This function performs processing on a request to handle any actions that need to be taken based on the Route header.

The main sections in the RFC3261 dealing with Route header processing are sections 12.2.1.1 for request processing and 16.4 for proxy processing. The steps to process requests for Route headers are: 1. If route set is empty no further action is required, forward to destination resolved from request URI, 2. If the request URI is identified as a value that was previously set as a Route by this SIP agent it means the previous hop was a strict router. Replace the reqest URI with the last Route header and go to next step, 3. If the top most route header was set by this SIP agent then remove it and go to next step, 4. If the top most route set does contain the lr parameter then forward to the destination resolved by it, 5. If the top most route header does NOT contain the lr parameter is must be popped and inserted as the request URI and the original request URI must be added to the end of the route set, forward to destination resolved from request URI,

ReceiveMessage ( SIPChannel sipChannel, SIPEndPoint remoteEndPoint, byte buffer ) : void
RemoveSIPChannel ( SIPChannel sipChannel ) : void
SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine ) : NUnit.Framework
SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine, SIPChannel sipChannel, bool queueIncoming ) : NUnit.Framework
SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine, bool queueIncoming ) : NUnit.Framework
SendRaw ( SIPEndPoint localSIPEndPoint, SIPEndPoint destinationEndPoint, byte buffer ) : void

Allows raw bytes to be sent from one of the SIPTransport sockets. This should not be used for SIP payloads and instead is provided to allow other types of payloads to be multi-plexed on the SIP socket. Examples are sending NAT keep alives and STUN responses where it's useful to use the same socket as the SIP packets.

SendRequest ( SIPEndPoint dstEndPoint, SIPRequest sipRequest ) : void
SendRequest ( SIPRequest sipRequest ) : void
SendResponse ( SIPEndPoint dstEndPoint, SIPResponse sipResponse ) : void
SendResponse ( SIPResponse sipResponse ) : void
SendSIPReliable ( SIPTransaction sipTransaction ) : void

Sends a SIP request/response and keeps track of whether a response/acknowledgement has been received. If no response is received then periodic retransmits are made for up to T1 x 64 seconds.

Shutdown ( ) : void

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

Метод Описание
CheckTransactionEngineExists ( ) : void
FireSIPBadRequestInTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, string message, SIPValidationFieldsEnum sipErrorField, string rawMessage ) : void
FireSIPBadResponseInTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, string message, SIPValidationFieldsEnum sipErrorField, string rawMessage ) : void
FireSIPRequestInTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPRequest sipRequest ) : void
FireSIPRequestOutTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPRequest sipRequest ) : void
FireSIPResponseInTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPResponse sipResponse ) : void
FireSIPResponseOutTraceEvent ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPResponse sipResponse ) : void
GetDefaultChannel ( SIPProtocolsEnum protocol ) : SIPChannel

Returns the first SIPChannel found for the requested protocol.

ProcessInMessage ( ) : void
ProcessPendingReliableTransactions ( ) : void
SIPMessageReceived ( SIPChannel sipChannel, SIPEndPoint remoteEndPoint, byte buffer ) : void
SendRequest ( SIPChannel sipChannel, SIPEndPoint dstEndPoint, SIPRequest sipRequest ) : void
SendResponse ( SIPChannel sipChannel, SIPEndPoint dstEndPoint, SIPResponse sipResponse ) : void
SendResponse ( SIPChannel sipChannel, SIPResponse sipResponse ) : void
StartReliableTransmissionsThread ( ) : void
StartTransportThread ( ) : void

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

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

Adds additional SIP Channels to the transport layer.
public AddSIPChannel ( List sipChannels ) : void
sipChannels List
Результат void

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

Adds an additional SIP Channel to the transport layer.
public AddSIPChannel ( SIPChannel sipChannel ) : void
sipChannel SIPChannel
Результат void

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

public CreateCancelTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, UASInviteTransaction inviteTransaction ) : SIPCancelTransaction
sipRequest SIPRequest
dstEndPoint SIPEndPoint
localSIPEndPoint SIPEndPoint
inviteTransaction UASInviteTransaction
Результат SIPCancelTransaction

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

public CreateNonInviteTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy ) : SIPNonInviteTransaction
sipRequest SIPRequest
dstEndPoint SIPEndPoint
localSIPEndPoint SIPEndPoint
outboundProxy SIPEndPoint
Результат SIPNonInviteTransaction

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

public CreateUACTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy, bool sendOkAckManually = false ) : UACInviteTransaction
sipRequest SIPRequest
dstEndPoint SIPEndPoint
localSIPEndPoint SIPEndPoint
outboundProxy SIPEndPoint
sendOkAckManually bool
Результат UACInviteTransaction

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

public CreateUASTransaction ( SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy, bool noCDR = false ) : UASInviteTransaction
sipRequest SIPRequest
dstEndPoint SIPEndPoint
localSIPEndPoint SIPEndPoint
outboundProxy SIPEndPoint
noCDR bool
Результат UASInviteTransaction

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

public DoesTransactionExist ( SIPRequest sipRequest ) : bool
sipRequest SIPRequest
Результат bool

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

Attempts to match a SIPChannel for this process that has the specified local end point and protocol.
public FindSIPChannel ( SIPEndPoint localSIPEndPoint ) : SIPChannel
localSIPEndPoint SIPEndPoint
Результат SIPChannel

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

public GetDefaultSIPEndPoint ( ) : SIPEndPoint
Результат SIPEndPoint

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

public GetDefaultSIPEndPoint ( SIPEndPoint destinationEP ) : SIPEndPoint
destinationEP SIPEndPoint
Результат SIPEndPoint

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

public GetDefaultSIPEndPoint ( SIPProtocolsEnum protocol ) : SIPEndPoint
protocol SIPProtocolsEnum
Результат SIPEndPoint

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

public GetDefaultTransportContact ( SIPProtocolsEnum protocol ) : SIPEndPoint
protocol SIPProtocolsEnum
Результат SIPEndPoint

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

public GetHostEndPoint ( string host, bool async ) : SIPDNSLookupResult
host string
async bool
Результат SIPDNSLookupResult

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

public GetListeningSIPEndPoints ( ) : List
Результат List

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

public GetRequest ( SIPMethodsEnum method, SIPURI uri ) : SIPRequest
method SIPMethodsEnum
uri SIPURI
Результат SIPRequest

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

public GetRequest ( SIPMethodsEnum method, SIPURI uri, SIPToHeader to, SIPEndPoint localSIPEndPoint ) : SIPRequest
method SIPMethodsEnum
uri SIPURI
to SIPToHeader
localSIPEndPoint SIPEndPoint
Результат SIPRequest

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

Based on the information in the SIP request attempts to determine the end point the request should be sent to.
public GetRequestEndPoint ( SIPRequest sipRequest, SIPEndPoint outboundProxy, bool async ) : SIPDNSLookupResult
sipRequest SIPRequest
outboundProxy SIPEndPoint
async bool
Результат SIPDNSLookupResult

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

Used to create a SIP response when it was not possible to parse the incoming SIP request.
public GetResponse ( SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : SIPResponse
localSIPEndPoint SIPEndPoint
remoteEndPoint SIPEndPoint
responseCode SIPResponseStatusCodesEnum
reasonPhrase string
Результат SIPResponse

GetResponse() публичный статический Метод

public static GetResponse ( SIPRequest sipRequest, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : SIPResponse
sipRequest SIPRequest
responseCode SIPResponseStatusCodesEnum
reasonPhrase string
Результат SIPResponse

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

public GetTransaction ( SIPRequest sipRequest ) : SIPTransaction
sipRequest SIPRequest
Результат SIPTransaction

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

public GetTransaction ( string transactionId ) : SIPTransaction
transactionId string
Результат SIPTransaction

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

public GetURIEndPoint ( SIPURI uri, bool async ) : SIPDNSLookupResult
uri SIPURI
async bool
Результат SIPDNSLookupResult

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

public IsLocalSIPEndPoint ( SIPEndPoint sipEndPoint ) : bool
sipEndPoint SIPEndPoint
Результат bool

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

This function performs processing on a request to handle any actions that need to be taken based on the Route header.
The main sections in the RFC3261 dealing with Route header processing are sections 12.2.1.1 for request processing and 16.4 for proxy processing. The steps to process requests for Route headers are: 1. If route set is empty no further action is required, forward to destination resolved from request URI, 2. If the request URI is identified as a value that was previously set as a Route by this SIP agent it means the previous hop was a strict router. Replace the reqest URI with the last Route header and go to next step, 3. If the top most route header was set by this SIP agent then remove it and go to next step, 4. If the top most route set does contain the lr parameter then forward to the destination resolved by it, 5. If the top most route header does NOT contain the lr parameter is must be popped and inserted as the request URI and the original request URI must be added to the end of the route set, forward to destination resolved from request URI,
public PreProcessRouteInfo ( SIPRequest sipRequest ) : void
sipRequest SIPRequest
Результат void

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

public ReceiveMessage ( SIPChannel sipChannel, SIPEndPoint remoteEndPoint, byte buffer ) : void
sipChannel SIPChannel
remoteEndPoint SIPEndPoint
buffer byte
Результат void

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

public RemoveSIPChannel ( SIPChannel sipChannel ) : void
sipChannel SIPChannel
Результат void

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

public SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine ) : NUnit.Framework
sipResolver ResolveSIPEndPointDelegate
transactionEngine SIPTransactionEngine
Результат NUnit.Framework

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

public SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine, SIPChannel sipChannel, bool queueIncoming ) : NUnit.Framework
sipResolver ResolveSIPEndPointDelegate
transactionEngine SIPTransactionEngine
sipChannel SIPChannel
queueIncoming bool
Результат NUnit.Framework

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

public SIPTransport ( ResolveSIPEndPointDelegate sipResolver, SIPTransactionEngine transactionEngine, bool queueIncoming ) : NUnit.Framework
sipResolver ResolveSIPEndPointDelegate
transactionEngine SIPTransactionEngine
queueIncoming bool
Результат NUnit.Framework

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

Allows raw bytes to be sent from one of the SIPTransport sockets. This should not be used for SIP payloads and instead is provided to allow other types of payloads to be multi-plexed on the SIP socket. Examples are sending NAT keep alives and STUN responses where it's useful to use the same socket as the SIP packets.
public SendRaw ( SIPEndPoint localSIPEndPoint, SIPEndPoint destinationEndPoint, byte buffer ) : void
localSIPEndPoint SIPEndPoint
destinationEndPoint SIPEndPoint
buffer byte
Результат void

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

public SendRequest ( SIPEndPoint dstEndPoint, SIPRequest sipRequest ) : void
dstEndPoint SIPEndPoint
sipRequest SIPRequest
Результат void

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

public SendRequest ( SIPRequest sipRequest ) : void
sipRequest SIPRequest
Результат void

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

public SendResponse ( SIPEndPoint dstEndPoint, SIPResponse sipResponse ) : void
dstEndPoint SIPEndPoint
sipResponse SIPResponse
Результат void

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

public SendResponse ( SIPResponse sipResponse ) : void
sipResponse SIPResponse
Результат void

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

Sends a SIP request/response and keeps track of whether a response/acknowledgement has been received. If no response is received then periodic retransmits are made for up to T1 x 64 seconds.
public SendSIPReliable ( SIPTransaction sipTransaction ) : void
sipTransaction SIPTransaction
Результат void

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

public Shutdown ( ) : void
Результат void

Описание свойств

BlackholeAddress публичное статическое свойство

public static IPAddress,System.Net BlackholeAddress
Результат System.Net.IPAddress

ContactIPAddress публичное свойство

public IPAddress,System.Net ContactIPAddress
Результат System.Net.IPAddress

PerformanceMonitorPrefix публичное свойство

public string PerformanceMonitorPrefix
Результат string