forked from rainliu/sip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProxyAuthenticateParser.go
41 lines (36 loc) · 1.1 KB
/
ProxyAuthenticateParser.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package parser
import (
"github.com/tutuvss/sip/core"
"github.com/tutuvss/sip/header"
)
/** SIPParser for ProxyAuthenticate headers.
*/
type ProxyAuthenticateParser struct {
ChallengeParser
}
/** Constructor
* @param String paAuthenticate message to parse
*/
func NewProxyAuthenticateParser(proxyAuthenticate string) *ProxyAuthenticateParser {
this := &ProxyAuthenticateParser{}
this.ChallengeParser.super(proxyAuthenticate)
return this
}
/** Cosntructor
* @param lexer to set
*/
func NewProxyAuthenticateParserFromLexer(lexer core.Lexer) *ProxyAuthenticateParser {
this := &ProxyAuthenticateParser{}
this.ChallengeParser.superFromLexer(lexer)
return this
}
/** parse the String message
* @return SIPHeader (ProxyAuthenticate object)
* @throws ParseException if the message does not respect the spec.
*/
func (this *ProxyAuthenticateParser) Parse() (sh header.Header, ParseException error) {
this.HeaderName(TokenTypes_PROXY_AUTHENTICATE)
proxyAuthenticate := header.NewProxyAuthenticate()
ParseException = this.ChallengeParser.Parse(proxyAuthenticate)
return proxyAuthenticate, ParseException
}