parser

package
v0.0.0-...-892cec7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TokenTypes_ACCEPT = TokenTypes_START + 20
View Source
const TokenTypes_ACCEPT_ENCODING = TokenTypes_START + 19
View Source
const TokenTypes_ACCEPT_LANGUAGE = TokenTypes_START + 47
View Source
const TokenTypes_ACK = TokenTypes_START + 6
View Source
const TokenTypes_ALERT_INFO = TokenTypes_START + 13
View Source
const TokenTypes_ALLOW = TokenTypes_START + 21
View Source
const TokenTypes_ALLOW_EVENTS = TokenTypes_START + 65
View Source
const TokenTypes_ALPHA = core.CORELEXER_ALPHA
View Source
const TokenTypes_AND = (int)('&')
View Source
const TokenTypes_AT = core.CORELEXER_AT
View Source
const TokenTypes_AUTHENTICATION_INFO = TokenTypes_START + 64
View Source
const TokenTypes_AUTHORIZATION = TokenTypes_START + 23
View Source
const TokenTypes_BACKSLASH = core.CORELEXER_BACKSLASH
View Source
const TokenTypes_BACK_QUOTE = core.CORELEXER_BACK_QUOTE
View Source
const TokenTypes_BAR = (int)('|')
View Source
const TokenTypes_BYE = TokenTypes_START + 7
View Source
const TokenTypes_CALL_ID = TokenTypes_START + 40
View Source
const TokenTypes_CALL_INFO = TokenTypes_START + 51
View Source
const TokenTypes_CANCEL = TokenTypes_START + 9
View Source
const TokenTypes_COLON = core.CORELEXER_COLON
View Source
const TokenTypes_CONTACT = TokenTypes_START + 39
View Source
const TokenTypes_CONTENT_DISPOSITION = TokenTypes_START + 52
View Source
const TokenTypes_CONTENT_ENCODING = TokenTypes_START + 35
View Source
const TokenTypes_CONTENT_LANGUAGE = TokenTypes_START + 27
View Source
const TokenTypes_CONTENT_LENGTH = TokenTypes_START + 36
View Source
const TokenTypes_CONTENT_TYPE = TokenTypes_START + 38
View Source
const TokenTypes_CSEQ = TokenTypes_START + 46
View Source
const TokenTypes_DATE = TokenTypes_START + 32
View Source
const TokenTypes_DIGIT = core.CORELEXER_DIGIT
View Source
const TokenTypes_DOLLAR = core.CORELEXER_DOLLAR
View Source
const TokenTypes_DOT = (int)('.')
View Source
const TokenTypes_DOUBLEQUOTE = core.CORELEXER_DOUBLEQUOTE
View Source
const TokenTypes_ENCRYPTION = TokenTypes_START + 43
View Source
const TokenTypes_END = core.CORELEXER_END

Everything under this is reserved

View Source
const TokenTypes_EQUALS = (int)('=')
View Source
const TokenTypes_ERROR_INFO = TokenTypes_START + 10
View Source
const TokenTypes_EVENT = TokenTypes_START + 63
View Source
const TokenTypes_EXCLAMATION = (int)('!')
View Source
const TokenTypes_EXPIRES = TokenTypes_START + 42
View Source
const TokenTypes_FROM = TokenTypes_START + 14
View Source
const TokenTypes_GREATER_THAN = (int)('>')
View Source
const TokenTypes_HAT = (int)('^')
View Source
const TokenTypes_HIDE = TokenTypes_START + 50
View Source
const TokenTypes_HT = core.CORELEXER_HT
View Source
const TokenTypes_ID = core.CORELEXER_ID
View Source
const TokenTypes_INVITE = TokenTypes_START + 5
View Source
const TokenTypes_IN_REPLY_TO = TokenTypes_START + 11
View Source
const TokenTypes_LESS_THAN = (int)('<')
View Source
const TokenTypes_LPAREN = (int)('(')
View Source
const TokenTypes_L_CURLY = (int)('{')
View Source
const TokenTypes_L_SQUARE_BRACKET = (int)('[')
View Source
const TokenTypes_MAX_FORWARDS = TokenTypes_START + 31
View Source
const TokenTypes_MIME_VERSION = TokenTypes_START + 12
View Source
const TokenTypes_MINUS = core.CORELEXER_MINUS
View Source
const TokenTypes_MIN_EXPIRES = TokenTypes_START + 62
View Source
const TokenTypes_NOTIFY = TokenTypes_START + 54
View Source
const TokenTypes_NULL = core.CORELEXER_NULL
View Source
const TokenTypes_OPTIONS = TokenTypes_START + 8
View Source
const TokenTypes_ORGANIZATION = TokenTypes_START + 45
View Source
const TokenTypes_PERCENT = (int)('%')
View Source
const TokenTypes_PLUS = core.CORELEXER_PLUS
View Source
const TokenTypes_POUND = core.CORELEXER_POUND
View Source
const TokenTypes_PRIORITY = TokenTypes_START + 33
View Source
const TokenTypes_PROXY_AUTHENTICATE = TokenTypes_START + 34
View Source
const TokenTypes_PROXY_AUTHORIZATION = TokenTypes_START + 24
View Source
const TokenTypes_PROXY_REQUIRE = TokenTypes_START + 26
View Source
const TokenTypes_QUESTION = (int)('?')
View Source
const TokenTypes_QUOTE = core.CORELEXER_QUOTE
View Source
const TokenTypes_RACK = TokenTypes_START + 61
View Source
const TokenTypes_REASON = TokenTypes_START + 59
View Source
const TokenTypes_RECORD_ROUTE = TokenTypes_START + 44
View Source
const TokenTypes_REFER_TO = TokenTypes_START + 66
View Source
const TokenTypes_REGISTER = TokenTypes_START + 4
View Source
const TokenTypes_REPLY_TO = TokenTypes_START + 58
View Source
const TokenTypes_REQUIRE = TokenTypes_START + 41
View Source
const TokenTypes_RESPONSE_KEY = TokenTypes_START + 49
View Source
const TokenTypes_RETRY_AFTER = TokenTypes_START + 25
View Source
const TokenTypes_ROUTE = TokenTypes_START + 22
View Source
const TokenTypes_RPAREN = (int)(')')
View Source
const TokenTypes_RSEQ = TokenTypes_START + 60
View Source
const TokenTypes_R_CURLY = (int)('}')
View Source
const TokenTypes_R_SQUARE_BRACKET = (int)(']')
View Source
const TokenTypes_SEMICOLON = (int)(';')
View Source
const TokenTypes_SERVER = TokenTypes_START + 18
View Source
const TokenTypes_SIP = TokenTypes_START + 3
View Source
const TokenTypes_SLASH = (int)('/')
View Source
const TokenTypes_SP = core.CORELEXER_SP
View Source
const TokenTypes_STAR = core.CORELEXER_STAR
View Source
const TokenTypes_START = core.CORELEXER_START
View Source
const TokenTypes_SUBJECT = TokenTypes_START + 37
View Source
const TokenTypes_SUBSCRIBE = TokenTypes_START + 53
View Source
const TokenTypes_SUBSCRIPTION_STATE = TokenTypes_START + 56
View Source
const TokenTypes_SUPPORTED = TokenTypes_START + 20
View Source
const TokenTypes_TEL = TokenTypes_START + 57
View Source
const TokenTypes_TILDE = core.CORELEXER_TILDE
View Source
const TokenTypes_TIMESTAMP = TokenTypes_START + 55
View Source
const TokenTypes_TO = TokenTypes_START + 15
View Source
const TokenTypes_UNDERSCORE = (int)('_')
View Source
const TokenTypes_UNSUPPORTED = TokenTypes_START + 28
View Source
const TokenTypes_USER_AGENT = TokenTypes_START + 17
View Source
const TokenTypes_VIA = TokenTypes_START + 16
View Source
const TokenTypes_WARNING = TokenTypes_START + 30
View Source
const TokenTypes_WHITESPACE = core.CORELEXER_WHITESPACE
View Source
const TokenTypes_WWW_AUTHENTICATE = TokenTypes_START + 48

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptEncodingParser

type AcceptEncodingParser struct {
	HeaderParser
}

* * Accept-Encoding SIP (HTTP) Header parser. * * <pre> * * The Accept-Encoding request-header field is similar to Accept, but * restricts the content-codings (section 3.5) that are acceptable in * the response. * * * Accept-Encoding = "Accept-Encoding" ":" * ( encoding *( "," encoding) ) * encoding = ( codings *[ ";" "q" "=" qvalue ] ) * codings = ( content-coding | "*" ) * * Examples of its use are: * * Accept-Encoding: compress, gzip * Accept-Encoding: * Accept-Encoding: * * Accept-Encoding: compress;q=0.5, gzip;q=1.0 * Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0 * </pre> *

func NewAcceptEncodingParser

func NewAcceptEncodingParser(acceptEncoding string) *AcceptEncodingParser

* Constructor

  • @param String AcceptEncoding message to parse

func NewAcceptEncodingParserFromLexer

func NewAcceptEncodingParserFromLexer(lexer core.Lexer) *AcceptEncodingParser

* Cosntructor

  • @param lexer to set

func (*AcceptEncodingParser) Parse

func (this *AcceptEncodingParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (AcceptEncoding object)
  • @throws ParseException if the message does not respect the spec.

type AcceptLanguageParser

type AcceptLanguageParser struct {
	HeaderParser
}

func NewAcceptLanguageParser

func NewAcceptLanguageParser(acceptLanguage string) *AcceptLanguageParser

* Constructor

  • @param String AcceptLanguage message to parse

func NewAcceptLanguageParserFromLexer

func NewAcceptLanguageParserFromLexer(lexer core.Lexer) *AcceptLanguageParser

* Cosntructor

  • @param lexer to set

func (*AcceptLanguageParser) Parse

func (this *AcceptLanguageParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (AcceptLanguage object)
  • @throws ParseException if the message does not respect the spec.

type AcceptParser

type AcceptParser struct {
	ParametersParser
}

* SIPParser for Accept header.

func NewAcceptParser

func NewAcceptParser(accept string) *AcceptParser

*

  • Creates a new instance of Accept SIPParser
  • @param accept the header to parse

func NewAcceptParserFromLexer

func NewAcceptParserFromLexer(lexer core.Lexer) *AcceptParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*AcceptParser) Parse

func (this *AcceptParser) Parse() (sh header.Header, ParseException error)

* parse the Accept String header

  • @return Header (AcceptList object)
  • @throws SIPParseException if the message does not respect the spec.

type AddressParametersParser

type AddressParametersParser struct {
	ParametersParser
}

* Address parameters parser.

func NewAddressParametersParser

func NewAddressParametersParser(buffer string) *AddressParametersParser

func NewAddressParametersParserFromLexer

func NewAddressParametersParserFromLexer(lexer core.Lexer) *AddressParametersParser

func (*AddressParametersParser) Parse

func (this *AddressParametersParser) Parse(addressParametersHeader header.AddressParametersHeader) (ParseException error)

type AddressParser

type AddressParser struct {
	SIPParser
}

* SIPParser for addresses.

func NewAddressParser

func NewAddressParser(addr string) *AddressParser

func NewAddressParserFromLexer

func NewAddressParserFromLexer(lexer core.Lexer) *AddressParser

func (*AddressParser) Address

func (this *AddressParser) Address() (retval *address.AddressImpl, ParseException error)

func (*AddressParser) NameAddr

func (this *AddressParser) NameAddr() (addr *address.AddressImpl, ParseException error)

type AlertInfoParser

type AlertInfoParser struct {
	ParametersParser
}

* SIPParser for AlertInfo header.

func NewAlertInfoParser

func NewAlertInfoParser(alertInfo string) *AlertInfoParser

*

  • Creates a new instance of AlertInfo SIPParser
  • @param alertInfo the header to parse

func NewAlertInfoParserFromLexer

func NewAlertInfoParserFromLexer(lexer core.Lexer) *AlertInfoParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*AlertInfoParser) Parse

func (this *AlertInfoParser) Parse() (sh header.Header, ParseException error)

* parse the AlertInfo String header

  • @return Header (AlertInfoList object)
  • @throws SIPParseException if the message does not respect the spec.

type AllowEventsParser

type AllowEventsParser struct {
	HeaderParser
}

* SIPParser for AllowEvents header.

func NewAllowEventsParser

func NewAllowEventsParser(allowEvents string) *AllowEventsParser

*

  • Creates a new instance of AllowEventsParser
  • @param allowEvents the header to parse

func NewAllowEventsParserFromLexer

func NewAllowEventsParserFromLexer(lexer core.Lexer) *AllowEventsParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*AllowEventsParser) Parse

func (this *AllowEventsParser) Parse() (sh header.Header, ParseException error)

* parse the AllowEvents String header

  • @return Header (AllowEventsList object)
  • @throws SIPParseException if the message does not respect the spec.

type AllowParser

type AllowParser struct {
	HeaderParser
}

* SIPParser for Allow header.

func NewAllowParser

func NewAllowParser(allow string) *AllowParser

*

  • Creates a new instance of AllowParser
  • @param allow the header to parse

func NewAllowParserFromLexer

func NewAllowParserFromLexer(lexer core.Lexer) *AllowParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*AllowParser) Parse

func (this *AllowParser) Parse() (sh header.Header, ParseException error)

* parse the Allow String header

  • @return Header (AllowList object)
  • @throws SIPParseException if the message does not respect the spec.

type AuthenticationInfoParser

type AuthenticationInfoParser struct {
	ParametersParser
}

* SIPParser for Authentication-Info header.

func NewAuthenticationInfoParser

func NewAuthenticationInfoParser(authenticationInfo string) *AuthenticationInfoParser

*

  • Creates a new instance of AuthenticationInfoParser
  • @param authenticationInfo the header to parse

func NewAuthenticationInfoParserFromLexer

func NewAuthenticationInfoParserFromLexer(lexer core.Lexer) *AuthenticationInfoParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*AuthenticationInfoParser) Parse

func (this *AuthenticationInfoParser) Parse() (sh header.Header, ParseException error)

* parse the AuthenticationInfo String header

  • @return Header (AuthenticationInfoList object)
  • @throws SIPParseException if the message does not respect the spec.

type AuthorizationParser

type AuthorizationParser struct {
	ChallengeParser
}

* SIPParser for authorization headers.

func NewAuthorizationParser

func NewAuthorizationParser(authorization string) *AuthorizationParser

* Constructor

  • @param String Authorization message to parse

func NewAuthorizationParserFromLexer

func NewAuthorizationParserFromLexer(lexer core.Lexer) *AuthorizationParser

* Cosntructor

  • @param lexer to set

func (*AuthorizationParser) Parse

func (this *AuthorizationParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (Authorization object)
  • @throws SIPParseException if the message does not respect the spec.

type CSeqParser

type CSeqParser struct {
	HeaderParser
}

* SIPParser for CSeq headers.

func NewCSeqParser

func NewCSeqParser(cseq string) *CSeqParser

func NewCSeqParserFromLexer

func NewCSeqParserFromLexer(lexer core.Lexer) *CSeqParser

func (*CSeqParser) Parse

func (this *CSeqParser) Parse() (sh header.Header, ParseException error)

type CallIDParser

type CallIDParser struct {
	HeaderParser
}

* SIPParser for CALL ID header.

func NewCallIDParser

func NewCallIDParser(callId string) *CallIDParser

* Creates new CallIDParser

  • @param String callID message to parse to set

func NewCallIDParserFromLexer

func NewCallIDParserFromLexer(lexer core.Lexer) *CallIDParser

* Constructor

  • @param lexer to set

func (*CallIDParser) Parse

func (this *CallIDParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (CallID object)
  • @throws ParseException if the message does not respect the spec.

type CallInfoParser

type CallInfoParser struct {
	ParametersParser
}

* SIPParser for CallInfo header.

func NewCallInfoParser

func NewCallInfoParser(callInfo string) *CallInfoParser

*

  • Creates a new instance of CallInfoParser
  • @param callInfo the header to parse

func NewCallInfoParserFromLexer

func NewCallInfoParserFromLexer(lexer core.Lexer) *CallInfoParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*CallInfoParser) Parse

func (this *CallInfoParser) Parse() (sh header.Header, ParseException error)

* parse the CallInfo String header

  • @return Header (CallInfoList object)
  • @throws SIPParseException if the message does not respect the spec.

type ChallengeParser

type ChallengeParser struct {
	HeaderParser
}

func NewChallengeParser

func NewChallengeParser(challenge string) *ChallengeParser

* Constructor

  • @param String challenge message to parse to set

func NewChallengeParserFromLexer

func NewChallengeParserFromLexer(lexer core.Lexer) *ChallengeParser

* Constructor

  • @param String challenge message to parse to set

func (*ChallengeParser) Parse

func (this *ChallengeParser) Parse(h header.AuthorizationHeader) (ParseException error)

* parser the String message

  • @return Challenge object
  • @throws ParseException if the message does not respect the spec.

func (*ChallengeParser) ParseParameter

func (this *ChallengeParser) ParseParameter(h header.AuthorizationHeader) (ParseException error)

* Get the parameter of the challenge string

  • @return NameValue containing the parameter

type ContactParser

type ContactParser struct {
	AddressParametersParser
}

func NewContactParser

func NewContactParser(contact string) *ContactParser

func NewContactParserFromLexer

func NewContactParserFromLexer(lexer core.Lexer) *ContactParser

func (*ContactParser) Parse

func (this *ContactParser) Parse() (sh header.Header, ParseException error)

type ContentDispositionParser

type ContentDispositionParser struct {
	ParametersParser
}

* SIPParser for ContentLanguage header.

func NewContentDispositionParser

func NewContentDispositionParser(contentDisposition string) *ContentDispositionParser

*

  • Creates a new instance of ContentDispositionParser
  • @param contentDisposition the header to parse

func NewContentDispositionParserFromLexer

func NewContentDispositionParserFromLexer(lexer core.Lexer) *ContentDispositionParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ContentDispositionParser) Parse

func (this *ContentDispositionParser) Parse() (sh header.Header, ParseException error)

* parse the ContentDispositionHeader String header

  • @return Header (ContentDispositionList object)
  • @throws SIPParseException if the message does not respect the spec.

type ContentEncodingParser

type ContentEncodingParser struct {
	HeaderParser
}

* SIPParser for ContentLanguage header.

func NewContentEncodingParser

func NewContentEncodingParser(contentEncoding string) *ContentEncodingParser

*

  • Creates a new instance of ContentEncodingParser
  • @param contentEncoding the header to parse

func NewContentEncodingParserFromLexer

func NewContentEncodingParserFromLexer(lexer core.Lexer) *ContentEncodingParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ContentEncodingParser) Parse

func (this *ContentEncodingParser) Parse() (sh header.Header, ParseException error)

* parse the ContentEncodingHeader String header

  • @return Header (ContentEncodingList object)
  • @throws SIPParseException if the message does not respect the spec.

type ContentLanguageParser

type ContentLanguageParser struct {
	HeaderParser
}

* SIPParser for ContentLanguage header.

func NewContentLanguageParser

func NewContentLanguageParser(contentLanguage string) *ContentLanguageParser

*

  • Creates a new instance of ContentLanguageParser
  • @param contentLanguage the header to parse

func NewContentLanguageParserFromLexer

func NewContentLanguageParserFromLexer(lexer core.Lexer) *ContentLanguageParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ContentLanguageParser) Parse

func (this *ContentLanguageParser) Parse() (sh header.Header, ParseException error)

* parse the ContentLanguageHeader String header

  • @return Header (ContentLanguageList object)
  • @throws SIPParseException if the message does not respect the spec.

type ContentLengthParser

type ContentLengthParser struct {
	HeaderParser
}

* SIPParser for Content-Length Header.

func NewContentLengthParser

func NewContentLengthParser(contentLength string) *ContentLengthParser

func NewContentLengthParserFromLexer

func NewContentLengthParserFromLexer(lexer core.Lexer) *ContentLengthParser

func (*ContentLengthParser) Parse

func (this *ContentLengthParser) Parse() (sh header.Header, ParseException error)

type ContentTypeParser

type ContentTypeParser struct {
	ParametersParser
}

* SIPParser for content type header.

func NewContentTypeParser

func NewContentTypeParser(contentType string) *ContentTypeParser

func NewContentTypeParserFromLexer

func NewContentTypeParserFromLexer(lexer core.Lexer) *ContentTypeParser

func (*ContentTypeParser) Parse

func (this *ContentTypeParser) Parse() (sh header.Header, ParseException error)

type DateParser

type DateParser struct {
	HeaderParser
}

* SIPParser for SIP Date field. Converts from SIP Date to the

  • internal storage (Calendar)

func NewDateParser

func NewDateParser(date string) *DateParser

* Constructor

  • @param String route message to parse to set

func NewDateParserFromLexer

func NewDateParserFromLexer(lexer core.Lexer) *DateParser

func (*DateParser) Parse

func (this *DateParser) Parse() (sh header.Header, ParseException error)

* Parse method.

  • @throws ParseException
  • @return the parsed Date header/

type ErrorInfoParser

type ErrorInfoParser struct {
	ParametersParser
}

* SIPParser for ErrorInfo header.

func NewErrorInfoParser

func NewErrorInfoParser(errorInfo string) *ErrorInfoParser

*

  • Creates a new instance of ErrorInfoParser
  • @param errorInfo the header to parse

func NewErrorInfoParserFromLexer

func NewErrorInfoParserFromLexer(lexer core.Lexer) *ErrorInfoParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ErrorInfoParser) Parse

func (this *ErrorInfoParser) Parse() (sh header.Header, ParseException error)

* parse the ErrorInfo String header

  • @return Header (ErrorInfoList object)
  • @throws SIPParseException if the message does not respect the spec.

type EventParser

type EventParser struct {
	ParametersParser
}

* SIPParser for Event header.

func NewEventParser

func NewEventParser(event string) *EventParser

*

  • Creates a new instance of EventParser
  • @param event the header to parse

func NewEventParserFromLexer

func NewEventParserFromLexer(lexer core.Lexer) *EventParser

* Cosntructor

  • @param lexer the lexer to use to parse the header

func (*EventParser) Parse

func (this *EventParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (Event object)
  • @throws SIPParseException if the message does not respect the spec.

type ExpiresParser

type ExpiresParser struct {
	HeaderParser
}

* SIPParser for SIP Expires SIPParser. Converts from SIP Date to the * internal storage (Calendar).

func NewExpiresParser

func NewExpiresParser(text string) *ExpiresParser
  • protected constructor. *@param text is the text of the header to parse

func NewExpiresParserFromLexer

func NewExpiresParserFromLexer(lexer core.Lexer) *ExpiresParser
  • constructor. *@param lexer is the lexer passed in from the enclosing parser.

func (*ExpiresParser) Parse

func (this *ExpiresParser) Parse() (sh header.Header, ParseException error)

* Parse the header.

type FromParser

type FromParser struct {
	AddressParametersParser
}

* From header parser.

func NewFromParser

func NewFromParser(from string) *FromParser

func NewFromParserFromLexer

func NewFromParserFromLexer(lexer core.Lexer) *FromParser

func (*FromParser) Parse

func (this *FromParser) Parse() (sh header.Header, ParseException error)

type HeaderParser

type HeaderParser struct {
	SIPParser
}

* Generic header parser class. The parsers for various headers extend this * class. To create a parser for a new header, extend this class and change * the createParser class.

func NewHeaderParser

func NewHeaderParser(header string) *HeaderParser

* Creates new HeaderParser

  • @param String to parse.

func NewHeaderParserFromLexer

func NewHeaderParserFromLexer(lexer core.Lexer) *HeaderParser

func (*HeaderParser) HeaderName

func (this *HeaderParser) HeaderName(tok int)

* Parse the header name until the colon and chew WS after that.

func (*HeaderParser) Parse

func (this *HeaderParser) Parse() (sh header.Header, ParseException error)

* Parse the SIP header from the buffer and return a parsed

  • structure. *@throws ParseException if there was an error parsing.

type InReplyToParser

type InReplyToParser struct {
	HeaderParser
}

* SIPParser for InReplyTo header.

func NewInReplyToParser

func NewInReplyToParser(inReplyTo string) *InReplyToParser

* Creates a new instance of InReplyToParser

  • @param inReplyTo the header to parse

func NewInReplyToParserFromLexer

func NewInReplyToParserFromLexer(lexer core.Lexer) *InReplyToParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*InReplyToParser) Parse

func (this *InReplyToParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (InReplyToList object)
  • @throws SIPParseException if the message does not respect the spec.

type MaxForwardsParser

type MaxForwardsParser struct {
	HeaderParser
}

* SIPParser for Max Forwards Header.

func NewMaxForwardsParser

func NewMaxForwardsParser(contentLength string) *MaxForwardsParser

func NewMaxForwardsParserFromLexer

func NewMaxForwardsParserFromLexer(lexer core.Lexer) *MaxForwardsParser

func (*MaxForwardsParser) Parse

func (this *MaxForwardsParser) Parse() (sh header.Header, ParseException error)

type MimeVersionParser

type MimeVersionParser struct {
	HeaderParser
}

* SIPParser for MimeVersion header.

func NewMimeVersionParser

func NewMimeVersionParser(mimeVersion string) *MimeVersionParser

* Creates a new instance of MimeVersionParser

  • @param mimeVersion the header to parse

func NewMimeVersionParserFromLexer

func NewMimeVersionParserFromLexer(lexer core.Lexer) *MimeVersionParser

* Cosntructor

  • @param lexer the lexer to use to parse the header

func (*MimeVersionParser) Parse

func (this *MimeVersionParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (MimeVersion object)
  • @throws SIPParseException if the message does not respect the spec.

type MinExpiresParser

type MinExpiresParser struct {
	HeaderParser
}

* SIPParser for MinExpires header.

func NewMinExpiresParser

func NewMinExpiresParser(minExpires string) *MinExpiresParser
  • protected constructor. *@param text is the text of the header to parse

func NewMinExpiresParserFromLexer

func NewMinExpiresParserFromLexer(lexer core.Lexer) *MinExpiresParser
  • constructor. *@param lexer is the lexer passed in from the enclosing parser.

func (*MinExpiresParser) Parse

func (this *MinExpiresParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return Header (MinExpiresParser)
  • @throws SIPParseException if the message does not respect the spec.

type OrganizationParser

type OrganizationParser struct {
	HeaderParser
}

* SIPParser for Organization header.

func NewOrganizationParser

func NewOrganizationParser(organization string) *OrganizationParser

* Creates a new instance of OrganizationParser

  • @param organization the header to parse

func NewOrganizationParserFromLexer

func NewOrganizationParserFromLexer(lexer core.Lexer) *OrganizationParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*OrganizationParser) Parse

func (this *OrganizationParser) Parse() (sh header.Header, ParseException error)

* parse the String header

  • @return Header (Organization object)
  • @throws SIPParseException if the message does not respect the spec.

type ParametersParser

type ParametersParser struct {
	HeaderParser
}

* parameters parser header.

func NewParametersParser

func NewParametersParser(buffer string) *ParametersParser

func NewParametersParserFromLexer

func NewParametersParserFromLexer(lexer core.Lexer) *ParametersParser

func (*ParametersParser) Parse

func (this *ParametersParser) Parse(parametersHeader header.ParametersHeader) (ParseException error)

type ParseExceptionListener

type ParseExceptionListener interface {
	/**
	* This gets called from the parser when a parse error is generated.
	* The handler is supposed to introspect on the error class and
	* header name to handle the error appropriately. The error can
	* be handled by :
	*<ul>
	* <li>1. Re-throwing an exception and aborting the parse.
	* <li>2. Ignoring the header (attach the unparseable header to
	* the SIPMessage being parsed).
	* <li>3. Re-Parsing the bad header and adding it to the sipMessage
	* </ul>
	*
	*@param  ex - parse exception being processed.
	*@param  sipMessage -- sip message being processed.
	*@param headerText --  header/RL/SL text being parsed.
	*@param messageText -- message where this header was detected.
	 */
	HandleException(err error,
		sipMessage message.Message,

		headerText string,
		messageText string) (ParseException error)
}

* * A listener interface that enables customization of parse error handling. * An class that implements this interface is registered with the * parser and is called back from the parser handle parse errors.

type Parser

type Parser interface {
	Parse() (sh header.Header, ParseException error)
}

func CreateParser

func CreateParser(line string) (parser Parser, ParseException error)

* create a parser for a header. This is the parser factory.

type PriorityParser

type PriorityParser struct {
	HeaderParser
}

* SIPParser for Priority header.

func NewPriorityParser

func NewPriorityParser(priority string) *PriorityParser

* Creates a new instance of PriorityParser

  • @param priority the header to parse

func NewPriorityParserFromLexer

func NewPriorityParserFromLexer(lexer core.Lexer) *PriorityParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*PriorityParser) Parse

func (this *PriorityParser) Parse() (sh header.Header, ParseException error)

* parse the String header

  • @return SIPHeader (Priority object)
  • @throws SIPParseException if the message does not respect the spec.

type ProxyAuthenticateParser

type ProxyAuthenticateParser struct {
	ChallengeParser
}

* SIPParser for ProxyAuthenticate headers.

func NewProxyAuthenticateParser

func NewProxyAuthenticateParser(proxyAuthenticate string) *ProxyAuthenticateParser

* Constructor

  • @param String paAuthenticate message to parse

func NewProxyAuthenticateParserFromLexer

func NewProxyAuthenticateParserFromLexer(lexer core.Lexer) *ProxyAuthenticateParser

* Cosntructor

  • @param lexer to set

func (*ProxyAuthenticateParser) Parse

func (this *ProxyAuthenticateParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (ProxyAuthenticate object)
  • @throws ParseException if the message does not respect the spec.

type ProxyAuthorizationParser

type ProxyAuthorizationParser struct {
	ChallengeParser
}

* SIPParser for ProxyAuthorization headers.

func NewProxyAuthorizationParser

func NewProxyAuthorizationParser(proxyAuthorization string) *ProxyAuthorizationParser

* Constructor

  • @param proxyAuthorization -- header to parse

func NewProxyAuthorizationParserFromLexer

func NewProxyAuthorizationParserFromLexer(lexer core.Lexer) *ProxyAuthorizationParser

* Cosntructor

  • @param lexer to set

func (*ProxyAuthorizationParser) Parse

func (this *ProxyAuthorizationParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (ProxyAuthenticate object)
  • @throws ParseException if the message does not respect the spec.

type ProxyRequireParser

type ProxyRequireParser struct {
	HeaderParser
}

* SIPParser for ProxyRequire header.

func NewProxyRequireParser

func NewProxyRequireParser(require string) *ProxyRequireParser
  • Creates a new instance of ProxyRequireParser *@param require the header to parse

func NewProxyRequireParserFromLexer

func NewProxyRequireParserFromLexer(lexer core.Lexer) *ProxyRequireParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ProxyRequireParser) Parse

func (this *ProxyRequireParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (ProxyRequireList object)
  • @throws SIPParseException if the message does not respect the spec.

type RAckParser

type RAckParser struct {
	HeaderParser
}

* SIPParser for RAck header.

func NewRAckParser

func NewRAckParser(rack string) *RAckParser
  • Creates a new instance of RAckParser *@param rack the header to parse

func NewRAckParserFromLexer

func NewRAckParserFromLexer(lexer core.Lexer) *RAckParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*RAckParser) Parse

func (this *RAckParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (RAck object)
  • @throws SIPParseException if the message does not respect the spec.

type RSeqParser

type RSeqParser struct {
	HeaderParser
}

* SIPParser for RSeq header.

func NewRSeqParser

func NewRSeqParser(rseq string) *RSeqParser
  • Creates a new instance of RSeqParser *@param rseq the header to parse

func NewRSeqParserFromLexer

func NewRSeqParserFromLexer(lexer core.Lexer) *RSeqParser

* Constructor

  • param lexer the lexer to use to parse the header

func (*RSeqParser) Parse

func (this *RSeqParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader ( RSeq object)
  • @throws SIPParseException if the message does not respect the spec.

type ReasonParser

type ReasonParser struct {
	ParametersParser
}

* SIPParser for Reason header.

func NewReasonParser

func NewReasonParser(reason string) *ReasonParser

* Creates a new instance of ReasonParser

  • @param reason the header to parse

func NewReasonParserFromLexer

func NewReasonParserFromLexer(lexer core.Lexer) *ReasonParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ReasonParser) Parse

func (this *ReasonParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (ReasonParserList object)
  • @throws SIPParseException if the message does not respect the spec.

type RecordRouteParser

type RecordRouteParser struct {
	AddressParametersParser
}

* SIPParser for a list of route headers.

func NewRecordRouteParser

func NewRecordRouteParser(recordRoute string) *RecordRouteParser

* Constructor

  • @param String recordRoute message to parse to set

func NewRecordRouteParserFromLexer

func NewRecordRouteParserFromLexer(lexer core.Lexer) *RecordRouteParser

func (*RecordRouteParser) Parse

func (this *RecordRouteParser) Parse() (sh header.Header, ParseException error)

* parse the String message and generate the RecordRoute List Object

  • @return SIPHeader the RecordRoute List object
  • @throws ParseException if errors occur during the parsing

type ReferToParser

type ReferToParser struct {
	AddressParametersParser
}

* ReferTo Header parser.

func NewReferToParser

func NewReferToParser(referTo string) *ReferToParser

* Creates new ReferToParser

  • @param String to set

func NewReferToParserFromLexer

func NewReferToParserFromLexer(lexer core.Lexer) *ReferToParser

func (*ReferToParser) Parse

func (this *ReferToParser) Parse() (sh header.Header, ParseException error)

type ReplyToParser

type ReplyToParser struct {
	AddressParametersParser
}

func NewReplyToParser

func NewReplyToParser(replyTo string) *ReplyToParser

* Creates a new instance of ReplyToParser

  • @param replyTo the header to parse

func NewReplyToParserFromLexer

func NewReplyToParserFromLexer(lexer core.Lexer) *ReplyToParser

* Cosntructor

  • param lexer the lexer to use to parse the header

func (*ReplyToParser) Parse

func (this *ReplyToParser) Parse() (sh header.Header, ParseException error)

* parse the String message and generate the ReplyTo List Object

  • @return SIPHeader the ReplyTo List object
  • @throws SIPParseException if errors occur during the parsing

type RequestLineParser

type RequestLineParser struct {
	SIPParser
}

* SIPParser for the SIP request line.

func NewRequestLineParser

func NewRequestLineParser(requestLine string) *RequestLineParser

func NewRequestLineParserFromLexer

func NewRequestLineParserFromLexer(lexer core.Lexer) *RequestLineParser

func (*RequestLineParser) Parse

func (this *RequestLineParser) Parse() (rl *header.RequestLine, ParseException error)

type RequireParser

type RequireParser struct {
	HeaderParser
}

* SIPParser for Require header.

func NewRequireParser

func NewRequireParser(require string) *RequireParser

* Creates a new instance of RequireParser

  • @param require the header to parse

func NewRequireParserFromLexer

func NewRequireParserFromLexer(lexer core.Lexer) *RequireParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*RequireParser) Parse

func (this *RequireParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (RequireList object)
  • @throws SIPParseException if the message does not respect the spec.

type RetryAfterParser

type RetryAfterParser struct {
	HeaderParser
}

* SIPParser for RetryAfter header.

func NewRetryAfterParser

func NewRetryAfterParser(retryAfter string) *RetryAfterParser

* Creates a new instance of RetryAfterParser

  • @param retryAfter the header to parse

func NewRetryAfterParserFromLexer

func NewRetryAfterParserFromLexer(lexer core.Lexer) *RetryAfterParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*RetryAfterParser) Parse

func (this *RetryAfterParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (RetryAfter object)
  • @throws SIPParseException if the message does not respect the spec.

type RouteParser

type RouteParser struct {
	AddressParametersParser
}

func NewRouteParser

func NewRouteParser(route string) *RouteParser

* Constructor

  • @param String route message to parse to set

func NewRouteParserFromLexer

func NewRouteParserFromLexer(lexer core.Lexer) *RouteParser

func (*RouteParser) Parse

func (this *RouteParser) Parse() (sh header.Header, ParseException error)

* parse the String message and generate the Route List Object

  • @return SIPHeader the Route List object
  • @throws SIPParseException if errors occur during the parsing

type SIPLexer

type SIPLexer struct {
	core.CoreLexer
}

* SIPLexer class for the parser.

func NewSIPLexer

func NewSIPLexer(lexerName, buffer string) *SIPLexer

func (*SIPLexer) GetHeaderName

func (this *SIPLexer) GetHeaderName(line string) string

* get the header name of the line

  • @return String

func (*SIPLexer) GetHeaderValue

func (this *SIPLexer) GetHeaderValue(line string) string

* get the header value of the line

  • @return String

func (*SIPLexer) SelectLexer

func (this *SIPLexer) SelectLexer(lexerName string)

type SIPParser

type SIPParser struct {
	core.CoreParser
}

* Base parser class.

func NewSIPParser

func NewSIPParser(buffer string) *SIPParser

func (*SIPParser) CreateParseException

func (this *SIPParser) CreateParseException(exceptionString string) (ParseException error)

func (*SIPParser) Method

func (this *SIPParser) Method() (s string, ParseException error)

* parses a method. Consumes if a valid method has been found.

func (*SIPParser) SipVersion

func (this *SIPParser) SipVersion() (s string, ParseException error)

type ServerParser

type ServerParser struct {
	HeaderParser
}

* SIPParser for Server header.

func NewServerParser

func NewServerParser(server string) *ServerParser

* Creates a new instance of ServerParser

  • @param server the header to parse

func NewServerParserFromLexer

func NewServerParserFromLexer(lexer core.Lexer) *ServerParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*ServerParser) Parse

func (this *ServerParser) Parse() (sh header.Header, ParseException error)

* parse the String server

  • @return SIPHeader (Server object)
  • @throws SIPParseException if the message does not respect the spec.

type StatusLineParser

type StatusLineParser struct {
	SIPParser
}

* SIPParser for the SIP status line.

func NewStatusLineParser

func NewStatusLineParser(statusLine string) *StatusLineParser

func NewStatusLineParserFromLexer

func NewStatusLineParserFromLexer(lexer core.Lexer) *StatusLineParser

func (*StatusLineParser) Parse

func (this *StatusLineParser) Parse() (sl *header.StatusLine, ParseException error)

func (*StatusLineParser) ReasonPhrase

func (this *StatusLineParser) ReasonPhrase() string

func (*StatusLineParser) StatusCode

func (this *StatusLineParser) StatusCode() (scode int, ParseException error)

type StringMsgParser

type StringMsgParser struct {
	// contains filtered or unexported fields
}

func NewStringMsgParser

func NewStringMsgParser() *StringMsgParser

*

*Constructor

func (*StringMsgParser) GetBodyAsBytes

func (this *StringMsgParser) GetBodyAsBytes() []byte

* Get the message body as a byte array.

func (*StringMsgParser) GetCurrentHeader

func (this *StringMsgParser) GetCurrentHeader() string

*

  • Get the current header.

func (*StringMsgParser) GetCurrentLineNumber

func (this *StringMsgParser) GetCurrentLineNumber() int

*

  • Get the current line number.

func (*StringMsgParser) GetMessageBody

func (this *StringMsgParser) GetMessageBody() string

* Get the message body.

func (*StringMsgParser) IsBodyString

func (this *StringMsgParser) IsBodyString() bool

* Return true if the body is encoded as a string.

  • If the parseSIPMessage(String) method is invoked then the body
  • is assumed to be a string.

func (*StringMsgParser) ParSetelephoneNumber

func (this *StringMsgParser) ParSetelephoneNumber(telephone_number string) (*address.TelephoneNumber, error)

*

  • Parse a telephone number return a parsed structure.
  • @param telphone_number is a String containing
  • the telephone # to be parsed
  • @return a parsed address structure.
  • @exception throws a ParseException when the address is badly formatted.

func (*StringMsgParser) ParseAddress

func (this *StringMsgParser) ParseAddress(address string) (*address.AddressImpl, error)

func (*StringMsgParser) ParseHost

func (this *StringMsgParser) ParseHost(host string) (*core.Host, error)

*

  • Parse a host name and return a parsed structure.
  • @param host is a String containing the host name to be parsed
  • @return a parsed address structure.
  • @exception throws a ParseException when the hostname is badly formatted.

func (*StringMsgParser) ParseHostPort

func (this *StringMsgParser) ParseHostPort(hostport string) (*core.HostPort, error)

*

  • Parse a host:port and return a parsed structure.
  • @param hostport is a String containing the host:port to be parsed
  • @return a parsed address structure.
  • @exception throws a ParseException when the address is badly formatted.

func (*StringMsgParser) ParseMessage

func (this *StringMsgParser) ParseMessage(currentMessage string) (message.Message, error)

* This is called repeatedly by parseSIPMessage to parse

  • the contents of a message buffer. This assumes the message
  • already has continuations etc. taken care of.
  • prior to its being called.

func (*StringMsgParser) ParseSIPHeader

func (this *StringMsgParser) ParseSIPHeader(h string) (*header.SIPHeader, error)

*

  • Parse an individual SIP message header from a string.
  • @param header String containing the SIP header.
  • @return a SIPHeader structure.
  • @exception ParseException if there was an error parsing the message.

func (*StringMsgParser) ParseSIPMessage

func (this *StringMsgParser) ParseSIPMessage(sipMessage string) (message.Message, error)

func (*StringMsgParser) ParseSIPMessageFromByte

func (this *StringMsgParser) ParseSIPMessageFromByte(msgBuffer []byte) (message.Message, error)

* Parse a buffer containing a single SIP Message where the body

  • is an array of un-interpreted bytes. This is intended for parsing
  • the message from a memory buffer when the buffer.
  • Incorporates a bug fix for a bug that was noted by Will Sullin of
  • Callcast
  • @param msgBuffer a byte buffer containing the messages to be parsed.
  • This can consist of multiple SIP Messages concatenated toGether.
  • @return a SIPMessage[] structure (request or response)
  • containing the parsed SIP message.
  • @exception SIPIllegalMessageException is thrown when an
  • illegal message has been encountered (and
  • the rest of the buffer is discarded).
  • @see ParseExceptionListener

func (*StringMsgParser) ParseSIPRequestLine

func (this *StringMsgParser) ParseSIPRequestLine(requestLine string) (*header.RequestLine, error)

*

  • Parse the SIP Request Line
  • @param requestLine a String containing the request line to be parsed.
  • @return a RequestLine structure that has the parsed RequestLine
  • @exception ParseException if there was an error parsing the requestLine.

func (*StringMsgParser) ParseSIPStatusLine

func (this *StringMsgParser) ParseSIPStatusLine(statusLine string) (*header.StatusLine, error)

*

  • Parse the SIP Response message status line
  • @param statusLine a String containing the Status line to be parsed.
  • @return StatusLine class corresponding to message
  • @exception ParseException if there was an error parsing
  • @see StatusLine

func (*StringMsgParser) ParseSIPUrl

func (this *StringMsgParser) ParseSIPUrl(url string) (*address.SipURIImpl, error)

*

  • Parse a SIP url from a string and return a URI structure for it.
  • @param url a String containing the URI structure to be parsed.
  • @return A parsed URI structure
  • @exception ParseException if there was an error parsing the message.

func (*StringMsgParser) ParseUrl

func (this *StringMsgParser) ParseUrl(url string) (*address.URIImpl, error)

*

  • Parse a uri from a string and return a URI structure for it.
  • @param url a String containing the URI structure to be parsed.
  • @return A parsed URI structure
  • @exception ParseException if there was an error parsing the message.

func (*StringMsgParser) ReadBytesToEnd

func (this *StringMsgParser) ReadBytesToEnd() []byte

* Return tbe bytes to the end of the message.

  • This is invoked when the parser is invoked with an array of bytes
  • rather than with a string.

func (*StringMsgParser) ReadToEnd

func (this *StringMsgParser) ReadToEnd() string

* Return the contents till the end of the buffer (this is useful when

  • you encounter an error.

func (*StringMsgParser) SetParseExceptionListener

func (this *StringMsgParser) SetParseExceptionListener(pexhandler ParseExceptionListener)

*

  • add a handler for header parsing errors.
  • @param pexhadler is a class
  • that implements the ParseExceptionListener interface.

type SubjectParser

type SubjectParser struct {
	HeaderParser
}

* SIPParser for Subject header.

func NewSubjectParser

func NewSubjectParser(subject string) *SubjectParser

* Creates a new instance of SubjectParser

  • @param subject the header to parse

func NewSubjectParserFromLexer

func NewSubjectParserFromLexer(lexer core.Lexer) *SubjectParser

* Cosntructor

  • @param lexer the lexer to use to parse the header

func (*SubjectParser) Parse

func (this *SubjectParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (Subject object)
  • @throws SIPParseException if the message does not respect the spec.

type SubscriptionStateParser

type SubscriptionStateParser struct {
	HeaderParser
}

* SIPParser for SubscriptionState header.

func NewSubscriptionStateParser

func NewSubscriptionStateParser(subscriptionState string) *SubscriptionStateParser

* Creates a new instance of SubscriptionStateParser

  • @param subscriptionState the header to parse

func NewSubscriptionStateParserFromLexer

func NewSubscriptionStateParserFromLexer(lexer core.Lexer) *SubscriptionStateParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*SubscriptionStateParser) Parse

func (this *SubscriptionStateParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (SubscriptionState object)
  • @throws SIPParseException if the message does not respect the spec.

type SupportedParser

type SupportedParser struct {
	HeaderParser
}

* SIPParser for Supported header.

func NewSupportedParser

func NewSupportedParser(supported string) *SupportedParser

* Creates a new instance of SupportedParser

  • @param supported the header to parse

func NewSupportedParserFromLexer

func NewSupportedParserFromLexer(lexer core.Lexer) *SupportedParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*SupportedParser) Parse

func (this *SupportedParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (Supported object)
  • @throws SIPParseException if the message does not respect the spec.

type TimeStampParser

type TimeStampParser struct {
	HeaderParser
}

* SIPParser for TimeStamp header.

func NewTimeStampParser

func NewTimeStampParser(timeStamp string) *TimeStampParser

* Creates a new instance of TimeStampParser

  • @param timeStamp the header to parse

func NewTimeStampParserFromLexer

func NewTimeStampParserFromLexer(lexer core.Lexer) *TimeStampParser

* Constructor

  • @param lexer the lexer to use to parse the header

func (*TimeStampParser) Parse

func (this *TimeStampParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (TimeStamp object)
  • @throws SIPParseException if the message does not respect the spec.

type ToParser

type ToParser struct {
	AddressParametersParser
}

To Header parser.

func NewToParser

func NewToParser(to string) *ToParser

* Creates new ToParser

  • @param String to set

func NewToParserFromLexer

func NewToParserFromLexer(lexer core.Lexer) *ToParser

func (*ToParser) Parse

func (this *ToParser) Parse() (sh header.Header, ParseException error)

type URLParser

type URLParser struct {
	SIPParser
}

* SIPParser For SIP and Tel URLs. Other kinds of URL's are handled by the

func NewURLParser

func NewURLParser(url string) *URLParser

func NewURLParserFromLexer

func NewURLParserFromLexer(lexer core.Lexer) *URLParser

func (*URLParser) Base_phone_number

func (this *URLParser) Base_phone_number() (s string, ParseException error)

* SIPParser for the base phone number.

func (*URLParser) Escaped

func (this *URLParser) Escaped() (s string, ParseException error)

func (*URLParser) Global_phone_number

func (this *URLParser) Global_phone_number() (tn *address.TelephoneNumber, ParseException error)

func (*URLParser) Hvalue

func (this *URLParser) Hvalue() (s string, ParseException error)

func (*URLParser) IsEscaped

func (this *URLParser) IsEscaped() bool

func (*URLParser) IsMark

func (this *URLParser) IsMark(next byte) bool

func (*URLParser) IsReserved

func (this *URLParser) IsReserved(next byte) bool

func (*URLParser) IsReservedNoSlash

func (this *URLParser) IsReservedNoSlash(next byte) bool

func (*URLParser) IsUnreserved

func (this *URLParser) IsUnreserved(next byte) bool

func (*URLParser) IsUserUnreserved

func (this *URLParser) IsUserUnreserved(la byte) bool

func (*URLParser) Local_number

func (this *URLParser) Local_number() (s string, ParseException error)

* SIPParser for the local phone #.

func (*URLParser) Local_phone_number

func (this *URLParser) Local_phone_number() (tn *address.TelephoneNumber, ParseException error)

func (*URLParser) Mark

func (this *URLParser) Mark() (s string, ParseException error)

func (*URLParser) ParamNameOrValue

func (this *URLParser) ParamNameOrValue() (s string, ParseException error)

* Name or value of a parameter.

func (*URLParser) Parse

func (this *URLParser) Parse() (url address.URI, ParseException error)

* Default parse method. This method just calls uriReference.

func (*URLParser) ParseTelephoneNumber

func (this *URLParser) ParseTelephoneNumber() (tn *address.TelephoneNumber, ParseException error)
  • SIPParser for telephone subscriber. * *@return the parsed telephone number.

func (*URLParser) Password

func (this *URLParser) Password() (s string, ParseException error)

func (*URLParser) PeekScheme

func (this *URLParser) PeekScheme() (s string, ParseException error)

func (*URLParser) Qheader

func (this *URLParser) Qheader() (nv *core.NameValue, ParseException error)

* Get a name value for a given query header (ie one that comes

  • after the ?).

func (*URLParser) Reserved

func (this *URLParser) Reserved() (s string, ParseException error)

func (*URLParser) SipURL

func (this *URLParser) SipURL() (sipurl *address.SipURIImpl, ParseException error)

func (*URLParser) TelURL

func (this *URLParser) TelURL() (telUrl *address.TelURLImpl, ParseException error)
  • Parse and return a structure for a Tel URL. *@return a parsed tel url structure.

func (*URLParser) Tel_parameters

func (this *URLParser) Tel_parameters() (nvl *core.NameValueList, ParseException error)

func (*URLParser) Unreserved

func (this *URLParser) Unreserved() (s string, ParseException error)

func (*URLParser) UriParam

func (this *URLParser) UriParam() (nv *core.NameValue, ParseException error)

func (*URLParser) UriReference

func (this *URLParser) UriReference() (url address.URI, ParseException error)

* Parse and return a structure for a generic URL.

  • Note that non SIP URLs are just stored as a string (not parsed). *@return URI is a URL structure for a SIP url. *@throws ParsException if there was a problem parsing.

func (*URLParser) Uric

func (this *URLParser) Uric() string

func (*URLParser) UricNoSlash

func (this *URLParser) UricNoSlash() string

func (*URLParser) UricString

func (this *URLParser) UricString() string

func (*URLParser) UrlString

func (this *URLParser) UrlString() (s string, ParseException error)

* Scan forward until you hit a terminating character for a URL.

  • We do not handle non sip urls in this implementation. *@return the string that takes us to the end of this URL (i.e. to
  • the next delimiter).

func (*URLParser) User

func (this *URLParser) User() (s string, ParseException error)

type UnsupportedParser

type UnsupportedParser struct {
	HeaderParser
}

* SIPParser for Unsupported header.

func NewUnsupportedParser

func NewUnsupportedParser(unsupported string) *UnsupportedParser

* Creates a new instance of UnsupportedParser

  • @param unsupported - Unsupported header to parse

func NewUnsupportedParserFromLexer

func NewUnsupportedParserFromLexer(lexer core.Lexer) *UnsupportedParser

* Constructor

  • @param lexer - the lexer to use to parse the header

func (*UnsupportedParser) Parse

func (this *UnsupportedParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (Unsupported object)
  • @throws SIPParseException if the message does not respect the spec.

type UserAgentParser

type UserAgentParser struct {
	HeaderParser
}

* SIPParser for UserAgent header.

func NewUserAgentParser

func NewUserAgentParser(userAgent string) *UserAgentParser

* Constructor

  • @param userAgent - UserAgent header to parse *

func NewUserAgentParserFromLexer

func NewUserAgentParserFromLexer(lexer core.Lexer) *UserAgentParser

* Constructor

  • @param lexer - the lexer to use.

func (*UserAgentParser) Parse

func (this *UserAgentParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (UserAgent object)
  • @throws SIPParseException if the message does not respect the spec.

type ViaParser

type ViaParser struct {
	HeaderParser
}

* SIPParser for via headers.

func NewViaParser

func NewViaParser(via string) *ViaParser

func NewViaParserFromLexer

func NewViaParserFromLexer(lexer core.Lexer) *ViaParser

func (*ViaParser) NameValue

func (this *ViaParser) NameValue() (nv *core.NameValue, ParseException error)

* Overrides the superclass nameValue parser because * we have to tolerate IPV6 addresses in the received parameter.

func (*ViaParser) Parse

func (this *ViaParser) Parse() (sh header.Header, ParseException error)

func (*ViaParser) ParseVia

func (this *ViaParser) ParseVia(v *header.Via) (ParseException error)

* a parser for the essential part of the via header.

type WWWAuthenticateParser

type WWWAuthenticateParser struct {
	ChallengeParser
}

* SIPParser for WWW authenitcate header.

func NewWWWAuthenticateParser

func NewWWWAuthenticateParser(wwwAuthenticate string) *WWWAuthenticateParser

* Constructor

  • @param wwwAuthenticate - message to parse

func NewWWWAuthenticateParserFromLexer

func NewWWWAuthenticateParserFromLexer(lexer core.Lexer) *WWWAuthenticateParser

* Cosntructor

  • @param lexer - lexer to use.

func (*WWWAuthenticateParser) Parse

func (this *WWWAuthenticateParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (WWWAuthenticate object)
  • @throws SIPParseException if the message does not respect the spec.

type WarningParser

type WarningParser struct {
	HeaderParser
}

* SIPParser for Warning header.

func NewWarningParser

func NewWarningParser(warning string) *WarningParser

* Constructor

  • @param warning - Warning header to parse

func NewWarningParserFromLexer

func NewWarningParserFromLexer(lexer core.Lexer) *WarningParser

* Cosntructor

  • @param lexer - the lexer to use.

func (*WarningParser) Parse

func (this *WarningParser) Parse() (sh header.Header, ParseException error)

* parse the String message

  • @return SIPHeader (WarningList object)
  • @throws SIPParseException if the message does not respect the spec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL