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

Class MessagesParser

BaseProtocol --+        
               |        
        Protocol --+    
                   |    
        LineReceiver --+
                       |
                      MessagesParser


A SIP messages parser.

Expects dataReceived, dataDone repeatedly, in that order. Shouldn't be connected to actual transport.
Method Summary
  __init__(self, messageReceivedCallback)
  dataDone(self)
  dataReceived(self, data)
Protocol.dataReceived.
  handleFirstLine(self, line)
Expected to create self.message.
  invalidMessage(self)
  lineLengthExceeded(self, line)
Called when the maximum line length has been reached.
  lineReceived(self, line)
Override this for when each line is received.
  messageDone(self, remainingData)
  rawDataReceived(self, data)
Override this for when raw data is received.
  reset(self, remainingData)
    Inherited from LineReceiver
  clearLineBuffer(self)
Clear buffered data.
  sendLine(self, line)
Sends a line to the other end of the connection.
  setLineMode(self, extra)
Sets the line-mode of this receiver.
  setRawMode(self)
Sets the raw mode of this receiver.
    Inherited from Protocol
  connectionFailed(self)
(Deprecated)
  connectionLost(self, reason)
Called when the connection is shut down.
    Inherited from BaseProtocol
  connectionMade(self)
Called when a connection is made.
  makeConnection(self, transport)
Make a connection to a transport and a server.

Class Variable Summary
int acceptRequests = 1                                                                     
int acceptResponses = 1                                                                     
int debug = 0                                                                     
str state = 'firstline'
str version = 'SIP/2.0'
    Inherited from LineReceiver
str _LineReceiver__buffer = ''
str delimiter: The line-ending delimiter to use.
int line_mode = 1                                                                     
int MAX_LENGTH: The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped).
    Inherited from Protocol
tuple __implements__ = (<class twisted.internet.interfaces.IPr...
    Inherited from BaseProtocol
int connected = 0                                                                     
NoneType transport = None                                                                  

Method Details

dataReceived(self, data)

Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.)
Overrides:
twisted.protocols.basic.LineReceiver.dataReceived (inherited documentation)

handleFirstLine(self, line)

Expected to create self.message.

lineLengthExceeded(self, line)

Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Overrides:
twisted.protocols.basic.LineReceiver.lineLengthExceeded (inherited documentation)

lineReceived(self, line)

Override this for when each line is received.
Overrides:
twisted.protocols.basic.LineReceiver.lineReceived (inherited documentation)

rawDataReceived(self, data)

Override this for when raw data is received.
Overrides:
twisted.protocols.basic.LineReceiver.rawDataReceived (inherited documentation)

Class Variable Details

acceptRequests

Type:
int
Value:
1                                                                     

acceptResponses

Type:
int
Value:
1                                                                     

debug

Type:
int
Value:
0                                                                     

state

Type:
str
Value:
'firstline'                                                            

version

Type:
str
Value:
'SIP/2.0'                                                              

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