Documentation
¶
Index ¶
Constants ¶
const MAX_CSEQ = 2147483647
The maximum permissible CSeq number in a SIP message (2**31 - 1). C.f. RFC 3261 S. 8.1.1.5.
Variables ¶
This section is empty.
Functions ¶
func ParseMessage ¶
func ParseMessage(msgData []byte) (base.SipMessage, error)
Parse a SIP message by creating a parser on the fly. This is more costly than reusing a parser, but is necessary when we do not have a guarantee that all messages coming over a connection are from the same endpoint (e.g. UDP).
func ParseSipUri ¶
ParseSipUri converts a string representation of a SIP or SIPS URI into a SipUri object.
Types ¶
type HeaderParser ¶
A HeaderParser is any function that turns raw header data into one or more SipHeader objects. The HeaderParser will receive arguments of the form ("max-forwards", "70"). It should return a slice of headers, which should have length > 1 unless it also returns an error.
type Parser ¶
type Parser interface { // Implements io.Writer. Queues the given bytes to be parsed. // If the parser has terminated due to a previous fatal error, it will return n=0 and an appropriate error. // Otherwise, it will return n=len(p) and err=nil. // Note that err=nil does not indicate that the data provided is valid - simply that the data was successfully queued for parsing. Write(p []byte) (n int, err error) // Register a custom header parser for a particular header type. // This will overwrite any existing registered parser for that header type. // If a parser is not available for a header type in a message, the parser will produce a base.GenericHeader struct. SetHeaderParser(headerName string, headerParser HeaderParser) Stop() }
A Parser converts the raw bytes of SIP messages into base.SipMessage objects. It allows