C# Class SIPSorcery.Servers.SIPProxyScriptFacade

Afficher le fichier Open project: sipsorcery/sipsorcery Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
AdjustContactHeader ( SIPHeader sipHeader, SIPEndPoint localSIPEndPoint, IPAddress publicIPAddress ) : void
IsDestinationValid ( SIPRequest sipRequest, SIPEndPoint dstSIPEndPoint ) : bool
IsDestinationValid ( SIPRequest sipRequest, string dstSIPEndPoint ) : bool

Method Details

DispatcherLookup() public méthode

public DispatcherLookup ( SIPRequest sipRequest ) : SIPEndPoint
sipRequest SIPSorcery.SIP.SIPRequest
Résultat SIPSorcery.SIP.SIPEndPoint

DispatcherLookup() public méthode

public DispatcherLookup ( SIPResponse sipResponse ) : SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
Résultat SIPSorcery.SIP.SIPEndPoint

GetAppServer() public méthode

public GetAppServer ( ) : SIPEndPoint
Résultat SIPSorcery.SIP.SIPEndPoint

GetDefaultSIPEndPoint() public méthode

public GetDefaultSIPEndPoint ( SIPProtocolsEnum protocol ) : SIPEndPoint
protocol SIPProtocolsEnum
Résultat SIPSorcery.SIP.SIPEndPoint

Log() public méthode

public Log ( string message ) : void
message string
Résultat void

Resolve() public méthode

public Resolve ( SIPRequest sipRequest ) : SIPDNSLookupResult
sipRequest SIPSorcery.SIP.SIPRequest
Résultat SIPDNSLookupResult

Resolve() public méthode

public Resolve ( SIPURI sipURI ) : SIPDNSLookupResult
sipURI SIPSorcery.SIP.SIPURI
Résultat SIPDNSLookupResult

Resolve() public méthode

public Resolve ( SIPResponse sipResponse ) : SIPEndPoint
sipResponse SIPSorcery.SIP.SIPResponse
Résultat SIPSorcery.SIP.SIPEndPoint

Respond() public méthode

Helper method for dynamic proxy runtime script.
public Respond ( SIPRequest sipRequest, SIPResponseStatusCodesEnum responseCode, string reasonPhrase ) : void
sipRequest SIPSorcery.SIP.SIPRequest
responseCode SIPResponseStatusCodesEnum
reasonPhrase string
Résultat void

SIPProxyScriptFacade() public méthode

public SIPProxyScriptFacade ( SIPMonitorLogDelegate proxyLogger, SIPTransport sipTransport, SIPProxyDispatcher dispatcher, GetAppServerDelegate getAppServer ) : NUnit.Framework
proxyLogger SIPMonitorLogDelegate
sipTransport SIPSorcery.SIP.SIPTransport
dispatcher SIPProxyDispatcher
getAppServer GetAppServerDelegate
Résultat NUnit.Framework

SendExternal() public méthode

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
Résultat void

SendExternal() public méthode

public SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint ) : void
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
Résultat void

SendExternal() public méthode

public SendExternal ( SIPResponse sipResponse, SIPEndPoint localSIPEndPoint, IPAddress publicIPAddress ) : void
sipResponse SIPSorcery.SIP.SIPResponse
localSIPEndPoint SIPSorcery.SIP.SIPEndPoint
publicIPAddress System.Net.IPAddress
Résultat void

SendInternal() public méthode

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
Résultat void

SendInternal() public méthode

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.
Résultat void

SendTransparent() public méthode

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.
Résultat void

SendTransparent() public méthode

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
Résultat void

SendTransparent() public méthode

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
Résultat void