Package twisted :: Package protocols :: Module sip :: Class Proxy
[frames | no frames]

Class Proxy

AbstractDatagramProtocol --+        
                           |        
            DatagramProtocol --+    
                               |    
                            Base --+
                                   |
                                  Proxy

Known Subclasses:
RegisterProxy

SIP proxy.
Method Summary
  __init__(self, host, port)
Create new instance.
  _cantForwardRequest(self, error, message)
  deliverResponse(self, responseMessage)
Deliver response.
  getVia(self)
Return value of Via header for this proxy.
  gotResponse(self, message, addr)
Called with responses that are addressed at this server.
  handle_request(self, message, addr)
Override to define behavior for requests received
  handle_request_default(self, message, (srcHost, srcPort))
Default request handler.
  handle_response(self, message, addr)
Default response handler.
  responseFromRequest(self, code, request)
Create a response to a request message.
    Inherited from Base
  _fixupNAT(self, message, (srcHost, srcPort))
  addMessage(self, msg)
  datagramReceived(self, data, addr)
  sendMessage(self, destURL, message)
Send a message.
    Inherited from DatagramProtocol
  connectionRefused(self)
Called due to error from write in connected mode.
    Inherited from AbstractDatagramProtocol
  __getstate__(self)
  doStart(self)
Make sure startProtocol is called.
  doStop(self)
Make sure stopProtocol is called.
  makeConnection(self, transport)
Make a connection to a transport and a server.
  startProtocol(self)
Called when a transport is connected to this protocol.
  stopProtocol(self)
Called when the transport is disconnected.

Class Variable Summary
NoneType locator = None                                                                  
int PORT = 5060                                                                  
    Inherited from Base
int debug = 0                                                                     
    Inherited from AbstractDatagramProtocol
int noisy = 1                                                                     
int numPorts = 0                                                                     
NoneType transport = None                                                                  

Method Details

__init__(self, host=None, port=5060)
(Constructor)

Create new instance.
Parameters:
host - our hostname/IP as set in Via headers.
port - our port as set in Via headers.
Overrides:
twisted.protocols.sip.Base.__init__

deliverResponse(self, responseMessage)

Deliver response.

Destination is based on topmost Via header.
Overrides:
twisted.protocols.sip.Base.deliverResponse

getVia(self)

Return value of Via header for this proxy.

gotResponse(self, message, addr)

Called with responses that are addressed at this server.

handle_request(self, message, addr)

Override to define behavior for requests received
Parameters:
message
           (type=Message)
addr
           (type=tuple)
Overrides:
twisted.protocols.sip.Base.handle_request (inherited documentation)

handle_request_default(self, message, (srcHost, srcPort))

Default request handler.

Default behaviour for OPTIONS and unknown methods for proxies is to forward message on to the client.

Since at the moment we are stateless proxy, thats basically everything.

handle_response(self, message, addr)

Default response handler.
Overrides:
twisted.protocols.sip.Base.handle_response

responseFromRequest(self, code, request)

Create a response to a request message.
Overrides:
twisted.protocols.sip.Base.responseFromRequest

Class Variable Details

locator

Type:
NoneType
Value:
None                                                                  

PORT

Type:
int
Value:
5060                                                                  

Generated by Epydoc 2.0 on Sat May 15 20:08:35 2004 http://epydoc.sf.net