Documentation
¶
Overview ¶
Originaly forked from github.com/StefanKopieczek/gossip by @StefanKopieczek
Index ¶
- Variables
- func ParseAddressValue(addressText string, uri *sip.Uri, headerParams sip.HeaderParams) (displayName string, err error)
- func ParseLine(startLine string) (msg sip.Message, err error)
- func ParseMessage(msgData []byte) (sip.Message, error)
- func ParseParams(s string, seperator rune, ending rune) (p sip.HeaderParams, n int, err error)
- func ParseRequestLine(requestLine string, recipient *sip.Uri) (method sip.RequestMethod, sipVersion string, err error)
- func ParseStatusLine(statusLine string) (sipVersion string, statusCode sip.StatusCode, reasonPhrase string, err error)
- func ParseUri(uriStr string, uri *sip.Uri) (err error)
- func SplitByWhitespace(text string) []string
- func UnmarshalParams(s string, seperator rune, ending rune, p sip.HeaderParams) (n int, err error)
- type HeaderParser
- type Parser
- type SIPParser
- type SIPParserStreamed
Constants ¶
This section is empty.
Variables ¶
var (
ErrLineNoCRLF = errors.New("line has no CRLF")
)
Functions ¶
func ParseAddressValue ¶
func ParseAddressValue(addressText string, uri *sip.Uri, headerParams sip.HeaderParams) (displayName string, err error)
ParseAddressValue parses an address - such as from a From, To, or Contact header. It returns: See RFC 3261 section 20.10 for details on parsing an address. Note that this method will not accept a comma-separated list of addresses; addresses in that form should be handled by ParseAddressValues.
func ParseMessage ¶
Parse a SIP message by creating a parser on the fly.
func ParseParams ¶
ParseKeyValParams method for parsing 'key=value' parameters.
func ParseRequestLine ¶
func ParseRequestLine(requestLine string, recipient *sip.Uri) ( method sip.RequestMethod, sipVersion string, err error)
Parse the first line of a SIP request, e.g:
INVITE bob@example.com SIP/2.0 REGISTER jane@telco.com SIP/1.0
func ParseStatusLine ¶
func ParseStatusLine(statusLine string) ( sipVersion string, statusCode sip.StatusCode, reasonPhrase string, err error)
Parse the first line of a SIP response, e.g:
SIP/2.0 200 OK SIP/1.0 403 Forbidden
func ParseUri ¶
ParseUri converts a string representation of a URI into a Uri object. Following https://datatracker.ietf.org/doc/html/rfc3261#section-19.1.1 sip:user:password@host:port;uri-parameters?headers
func SplitByWhitespace ¶
Splits the given string into sections, separated by one or more characters from c_ABNF_WS.
func UnmarshalParams ¶
Types ¶
type HeaderParser ¶
A HeaderParser is any function that turns raw header data into one or more Header objects.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}