下面看一个完整的SIP用户和用户代理之间的鉴权认证过程。
Session Initiation Protocol (REGISTER)
Request-Line: REGISTER sip:192.169.1.150 SIP/2.0
Method: REGISTER
Request-URI: sip:192.169.1.150
[Resent Packet: False]
Message Header
Via: SIP/2.0/UDP 192.169.1.147:39814;rport;branch=z9hG4bK80051
Max-Forwards: 70
To:
SIP to address: sip:[email protected]
From:
SIP from address: sip:[email protected]
SIP from tag: z9hG4bK17086172
Call-ID: [email protected]
CSeq: 1 REGISTER
Sequence Number: 1
Method: REGISTER
Contact:
Contact URI: sip:[email protected]:39814;transport=udp
Expires: 3600
User-Agent: Sipdroid/3.6 beta
Content-Length: 0
Session Initiation Protocol (407)
Status-Line: SIP/2.0 407 Proxy Authentication Required
Status-Code: 407
[Resent Packet: False]
[Request Frame: 1322]
[Response Time (ms): 0]
Message Header
Via: SIP/2.0/UDP 192.169.1.147:39814;branch=z9hG4bK80051;received=192.169.1.147;rport=39814
From:
SIP from address: sip:[email protected]
SIP from tag: z9hG4bK17086172
To:
SIP to address: sip:[email protected]
SIP to tag: 13d0075e
CSeq: 1 REGISTER
Sequence Number: 1
Method: REGISTER
Call-ID: [email protected]
Allow: ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE
User-Agent: miniSIPServer V16.0.7 (100 clients) build 20150324
Proxy-Authenticate: Digest realm="myvoipapp.com",algorithm=MD5,nonce="328E3DAF06BC5374001D626160CB1C21",stale=FALSE
Authentication Scheme: Digest
Realm: "myvoipapp.com"
Algorithm: MD5
Nonce Value: "328E3DAF06BC5374001D626160CB1C21"
Stale Flag: FALSE
Content-Length: 0
Session Initiation Protocol (REGISTER)
Request-Line: REGISTER sip:192.169.1.150 SIP/2.0
Method: REGISTER
Request-URI: sip:192.169.1.150
[Resent Packet: False]
Message Header
Via: SIP/2.0/UDP 192.169.1.147:39814;rport;branch=z9hG4bK99109
Max-Forwards: 70
To:
SIP to address: sip:[email protected]
From:
SIP from address: sip:[email protected]
SIP from tag: z9hG4bK17086172
Call-ID: [email protected]
CSeq: 2 REGISTER
Sequence Number: 2
Method: REGISTER
Contact:
Contact URI: sip:[email protected]:39814;transport=udp
Expires: 3600
User-Agent: Sipdroid/3.6 beta
Proxy-Authorization: Digest username="102", realm="myvoipapp.com", nonce="328E3DAF06BC5374001D626160CB1C21", uri="sip:192.169.1.150", algorithm=MD5, response="bdf9504e7f2e0d6c685e57f9eef22f43"
Authentication Scheme: Digest
Username: "102"
Realm: "myvoipapp.com"
Nonce Value: "328E3DAF06BC5374001D626160CB1C21"
Authentication URI: "sip:192.169.1.150"
Algorithm: MD5
Digest Authentication Response: "bdf9504e7f2e0d6c685e57f9eef22f43"
Content-Length: 0
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Status-Code: 200
[Resent Packet: False]
[Request Frame: 1324]
[Response Time (ms): 0]
Message Header
Via: SIP/2.0/UDP 192.169.1.147:39814;branch=z9hG4bK99109;received=192.169.1.147;rport=39814
From:
SIP from address: sip:[email protected]
SIP from tag: z9hG4bK17086172
To:
SIP to address: sip:[email protected]
SIP to tag: 55d70430
CSeq: 2 REGISTER
Sequence Number: 2
Method: REGISTER
Call-ID: [email protected]
Allow: ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE
User-Agent: miniSIPServer V16.0.7 (100 clients) build 20150324
Contact:
Contact URI: sip:[email protected]:39814;transport=udp
Expires: 180
Content-Length: 0