C# Класс SIPSorcery.Servers.SIPProxyScriptFacade

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
DispatcherLookup ( SIPRequest sipRequest ) : SIPEndPoint
DispatcherLookup ( SIPResponse sipResponse ) : SIPEndPoint
GetAppServer ( ) : SIPEndPoint
GetDefaultSIPEndPoint ( SIPProtocolsEnum protocol ) : SIPEndPoint
Log ( string message ) : void
Resolve ( SIPRequest sipRequest ) : SIPDNSLookupResult
Resolve ( SIPURI sipURI ) : SIPDNSLookupResult
Resolve ( SIPResponse sipResponse ) : SIPEndPoint
Respond ( SIPRequest sipRequest, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : void

Helper method for dynamic proxy runtime script.

SIPProxyScriptFacade ( SIPMonitorLogDelegate proxyLogger, SIPTransport sipTransport, SIPProxyDispatcher dispatcher, GetAppServerDelegate getAppServer ) : NUnit.Framework
SendExternal ( SIPEndPoint receivedOnEP, SIPEndPoint dstSIPEndPoint, SIPRequest sipRequest, string proxyBranch, IPAddress publicIPAddress ) : void

Used to send a request from an internal server agent to an external SIP user agent. The difference between this method and the SendTransparent method is that this one will set Via headers in accordance with RFC3261.

SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint ) : void
SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, IPAddress publicIPAddress ) : void
SendInternal ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint ) : void
SendInternal ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, string dstSocket, SIPRequest sipRequest, string proxyBranch, string sendFromSocket ) : void

Used to send a SIP request received from an external user agent to an internal SIP server agent.

SendTransparent ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, SIPEndPoint dstSIPEndPoint, string proxyBranch ) : void

This method is the equivalent to the same named method for sending SIP requests. The two methods are used to allow the Proxy to deliver requests to external SIP agents with only a SINGLE Via header due to a small number of providers rejecting requests with more than one Via header.

SendTransparent ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, string dstSIPEndPoint, string proxyBranch ) : void
SendTransparent ( SIPEndPoint dstSIPEndPoint, SIPRequest sipRequest, IPAddress publicIPAddress ) : void

Forwards a SIP request through the Proxy. This method differs from the standard Send in that irrespective of whether the Proxy is receiving and sending on different sockets only a single Via header will ever be allowed on the request. It is then up to the response processing logic to determine from which Proxy socket to forward the request and to add back on the Via header for the end agent. This method is only ever used for requests destined for EXTERNAL SIP end points.

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

Метод Описание
AdjustContactHeader ( SIPHeader sipHeader, SIPEndPoint localSIPEndPoint, IPAddress publicIPAddress ) : void
IsDestinationValid ( SIPRequest sipRequest, SIPEndPoint dstSIPEndPoint ) : bool
IsDestinationValid ( SIPRequest sipRequest, string dstSIPEndPoint ) : bool

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

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

public DispatcherLookup ( SIPRequest sipRequest ) : SIPEndPoint
sipRequest SIPSorcery.SIP.SIPRequest
Результат SIPSorcery.SIP.SIPEndPoint

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

public DispatcherLookup ( SIPResponse sipResponse ) : SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
Результат SIPSorcery.SIP.SIPEndPoint

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

public GetAppServer ( ) : SIPEndPoint
Результат SIPSorcery.SIP.SIPEndPoint

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

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

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

public Log ( string message ) : void
message string
Результат void

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

public Resolve ( SIPRequest sipRequest ) : SIPDNSLookupResult
sipRequest SIPSorcery.SIP.SIPRequest
Результат SIPDNSLookupResult

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

public Resolve ( SIPURI sipURI ) : SIPDNSLookupResult
sipURI SIPSorcery.SIP.SIPURI
Результат SIPDNSLookupResult

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

public Resolve ( SIPResponse sipResponse ) : SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
Результат SIPSorcery.SIP.SIPEndPoint

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

Helper method for dynamic proxy runtime script.
public Respond ( SIPRequest sipRequest, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : void
sipRequest SIPSorcery.SIP.SIPRequest
responseCode SIPResponseStatusCodesEnum
reasonPhrase string
Результат void

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

public SIPProxyScriptFacade ( SIPMonitorLogDelegate proxyLogger, SIPTransport sipTransport, SIPProxyDispatcher dispatcher, GetAppServerDelegate getAppServer ) : NUnit.Framework
proxyLogger SIPMonitorLogDelegate
sipTransport SIPSorcery.SIP.SIPTransport
dispatcher SIPProxyDispatcher
getAppServer GetAppServerDelegate
Результат NUnit.Framework

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

Used to send a request from an internal server agent to an external SIP user agent. The difference between this method and the SendTransparent method is that this one will set Via headers in accordance with RFC3261.
public SendExternal ( SIPEndPoint receivedOnEP, SIPEndPoint dstSIPEndPoint, SIPRequest sipRequest, string proxyBranch, IPAddress publicIPAddress ) : void
receivedOnEP SIPSorcery.SIP.SIPEndPoint The proxy SIP end point the request was received on.
dstSIPEndPoint SIPSorcery.SIP.SIPEndPoint
sipRequest SIPSorcery.SIP.SIPRequest The SIP request to send.
proxyBranch string The branch parameter for the top Via header that has been pre-calculated by the proxy core.
publicIPAddress System.Net.IPAddress
Результат void

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

public SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint ) : void
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
Результат void

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

public SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, IPAddress publicIPAddress ) : void
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
publicIPAddress System.Net.IPAddress
Результат void

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

public SendInternal ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint ) : void
receivedFromEP SIPSorcery.SIP.SIPEndPoint
receivedOnEP SIPSorcery.SIP.SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
Результат void

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

Used to send a SIP request received from an external user agent to an internal SIP server agent.
public SendInternal ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, string dstSocket, SIPRequest sipRequest, string proxyBranch, string sendFromSocket ) : void
receivedFromEP SIPSorcery.SIP.SIPEndPoint The SIP end point the proxy received the request from.
receivedOnEP SIPSorcery.SIP.SIPEndPoint The SIP end point the proxy received the request on.
dstSocket string The internal socket to send the request to.
sipRequest SIPSorcery.SIP.SIPRequest The SIP request to send.
proxyBranch string The branch to set on the Via header when sending the request. The branch should be calculated /// by the proxy core so that looped requests can be detected.
sendFromSocket string The proxy socket to send the request from.
Результат void

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

This method is the equivalent to the same named method for sending SIP requests. The two methods are used to allow the Proxy to deliver requests to external SIP agents with only a SINGLE Via header due to a small number of providers rejecting requests with more than one Via header.
public SendTransparent ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, SIPEndPoint dstSIPEndPoint, string proxyBranch ) : void
receivedFromEP SIPSorcery.SIP.SIPEndPoint The socket the response was received from.
receivedOnEP SIPSorcery.SIP.SIPEndPoint The proxy socket the response was received on.
sipResponse SIPSorcery.SIP.SIPResponse The response being forwarded.
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint The proxy socket to forward the request from.
dstSIPEndPoint SIPSorcery.SIP.SIPEndPoint The internal destination socket to forward the response to.
proxyBranch string The branch parameter from the top Via header that needs to be reused when forwarding the response.
Результат void

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

public SendTransparent ( SIPEndPoint receivedFromEP, SIPEndPoint receivedOnEP, SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, string dstSIPEndPoint, string proxyBranch ) : void
receivedFromEP SIPSorcery.SIP.SIPEndPoint
receivedOnEP SIPSorcery.SIP.SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
dstSIPEndPoint string
proxyBranch string
Результат void

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

Forwards a SIP request through the Proxy. This method differs from the standard Send in that irrespective of whether the Proxy is receiving and sending on different sockets only a single Via header will ever be allowed on the request. It is then up to the response processing logic to determine from which Proxy socket to forward the request and to add back on the Via header for the end agent. This method is only ever used for requests destined for EXTERNAL SIP end points.
public SendTransparent ( SIPEndPoint dstSIPEndPoint, SIPRequest sipRequest, IPAddress publicIPAddress ) : void
dstSIPEndPoint SIPSorcery.SIP.SIPEndPoint The destination SIP socket to send the request to.
sipRequest SIPSorcery.SIP.SIPRequest The SIP request to send.
publicIPAddress System.Net.IPAddress
Результат void