SIP 学习笔记之一 流程
SIP Process
/*************************************************************************/
/* Caller initiates a CALL */
/*************************************************************************/
(1)caller sends INVITE to proxy
INVITE sip:123@hujintao.dlinkddns.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-d225e854f32d305d-1--d87543-;rport
Max-Forwards: 70
Contact: <sip:121@116.227.0.44:6054>
To: <sip:123@hujintao.dlinkddns.com>
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Supported: eventlist
User-Agent: eyeBeam release 3015c stamp 27107
Content-Length: 174
v=0
o=- 158622668 158622784 IN IP4 192.168.0.7
s=eyeBeam
c=IN IP4 192.168.0.7
t=0 0
m=audio 6056 RTP/AVP 18
a=alt:1 1 : 6E90EB78 DE47B706 192.168.0.7 6056
a=sendrecv
(2)Proxy sends Trying to caller
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-d225e854f32d305d-1--d87543-;rport=6054;received=116.227.0.44
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
To: <sip:123@hujintao.dlinkddns.com>
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 1 INVITE
Server: Brekeke SIP Server rev.239
Content-Length: 0
(3)Proxy sends 407 to caller
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-d225e854f32d305d-1--d87543-;rport=6054;received=116.227.0.44
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
To: <sip:123@hujintao.dlinkddns.com>;tag=bf5a41354s
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 1 INVITE
Server: Brekeke SIP Server rev.239
Proxy-Authenticate: Digest realm="sharepoint",nonce="8e33a2d7020a3fd855c91b66dd1794200cff2fcb",algorithm=MD5
Content-Length: 0
(4)Caller sends ACK to proxy
ACK sip:123@hujintao.dlinkddns.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-d225e854f32d305d-1--d87543-;rport
To: <sip:123@hujintao.dlinkddns.com>;tag=bf5a41354s
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 1 ACK
Content-Length: 0
(5)Caller sends INVITE with authorization to Proxy
INVITE sip:123@hujintao.dlinkddns.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport
Max-Forwards: 70
Contact: <sip:121@116.227.0.44:6054>
To: <sip:123@hujintao.dlinkddns.com>
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Proxy-Authorization: Digest username="121",realm="sharepoint",nonce="8e33a2d7020a3fd855c91b66dd1794200cff2fcb",uri="sip:123@hujintao.dlinkddns.com",response="181e124b006b03d1ac51d2d54bf9edd0",algorithm=MD5
Supported: eventlist
User-Agent: eyeBeam release 3015c stamp 27107
Content-Length: 174
v=0
o=- 158622668 158622784 IN IP4 192.168.0.7
s=eyeBeam
c=IN IP4 192.168.0.7
t=0 0
m=audio 6056 RTP/AVP 18
a=alt:1 1 : 6E90EB78 DE47B706 192.168.0.7 6056
a=sendrecv
(6)Proxy sends INVITE to callee
INVITE sip:123@192.168.0.58:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.0.121:5060;rport;branch=z9hG4bK0d40ceebef1-c38f89c2-2b40ce84
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
Max-Forwards: 69
Contact: <sip:121@192.168.0.121:5060>
To: <sip:123@hujintao.dlinkddns.com>
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Proxy-Authorization: Digest username="121",realm="sharepoint",nonce="8e33a2d7020a3fd855c91b66dd1794200cff2fcb",uri="sip:123@hujintao.dlinkddns.com",response="181e124b006b03d1ac51d2d54bf9edd0",algorithm=MD5
Supported: eventlist
User-Agent: eyeBeam release 3015c stamp 27107
P-Behind-NAT: Yes
Record-Route: <sip:192.168.0.121:5060;lr>
Content-Type: application/sdp
Content-Length: 131
v=0
o=- 158622668 158622784 IN IP4 192.168.0.121
s=eyeBeam
c=IN IP4 192.168.0.121
t=0 0
m=audio 10156 RTP/AVP 18
a=sendrecv
(7)Callee sends Trying to proxy
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.121:5060;rport=5060;branch=z9hG4bK0d40ceebef1-c38f89c2-2b40ce84
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
To: <sip:123@hujintao.dlinkddns.com>
From: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Content-Length: 0
(8)Callee sends Ringing to proxy
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.121:5060;rport=5060;branch=z9hG4bK0d40ceebef1-c38f89c2-2b40ce84
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
Contact: <sip:123@192.168.0.58:5060;user=phone>
Record-Route: <sip:192.168.0.121:5060;lr>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Content-Length: 0
(9)Proxy sends Trying to caller
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
To: <sip:123@hujintao.dlinkddns.com>
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Server: Brekeke SIP Server rev.239
Content-Length: 0
(10)Proxy sends Ringing to caller
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
Contact: <sip:123@116.228.5.146:5060;user=phone>
Record-Route: <sip:116.228.5.146:5060;lr>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Content-Length: 0
/*************************************************************************/
/* Ringing,waiting callee "off hook" */
/*************************************************************************/
(11)Callee sends OK to proxy
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.121:5060;rport=5060;branch=z9hG4bK0d40ceebef1-c38f89c2-2b40ce84
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
Contact: <sip:123@192.168.0.58:5060;user=phone>
Record-Route: <sip:192.168.0.121:5060;lr>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Content-Type: application/sdp
Content-Length: 170
v=0
o=- 1707914491 1707914491 IN IP4 192.168.0.58
s=-
c=IN IP4 192.168.0.58
t=0 0
m=audio 40000 RTP/AVP 18
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
(12)Proxy sends OK to caller
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-1360d1470e65407a-1--d87543-;rport=6054;received=116.227.0.44
Contact: <sip:123@116.228.5.146:5060;user=phone>
Record-Route: <sip:116.228.5.146:5060;lr>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 INVITE
Content-Type: application/sdp
Content-Length: 171
v=0
o=- 1707914491 1707914491 IN IP4 116.228.5.146
s=-
c=IN IP4 116.228.5.146
t=0 0
m=audio 10158 RTP/AVP 18
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
(13)Caller sends ACK to proxy
ACK sip:123@116.228.5.146:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-5e41766c37714d75-1--d87543-;rport
Max-Forwards: 70
Route: <sip:116.228.5.146:5060;lr>
Contact: <sip:121@116.227.0.44:6054>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 ACK
Proxy-Authorization: Digest username="121",realm="sharepoint",nonce="8e33a2d7020a3fd855c91b66dd1794200cff2fcb",uri="sip:123@hujintao.dlinkddns.com",response="181e124b006b03d1ac51d2d54bf9edd0",algorithm=MD5
User-Agent: eyeBeam release 3015c stamp 27107
Content-Length: 0
(14)Proxy sends ACK to callee
ACK sip:123@192.168.0.58:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.0.121:5060;rport;branch=z9hG4bKfc7a71cbef1-c38f89c2-2b40ce84
Via: SIP/2.0/UDP 192.168.0.7:6054;branch=z9hG4bK-d87543-5e41766c37714d75-1--d87543-;rport=6054;received=116.227.0.44
Max-Forwards: 69
Contact: <sip:121@192.168.0.121:5060>
To: <sip:123@hujintao.dlinkddns.com>;tag=995280513
From: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 2 ACK
Proxy-Authorization: Digest username="121",realm="sharepoint",nonce="8e33a2d7020a3fd855c91b66dd1794200cff2fcb",uri="sip:123@hujintao.dlinkddns.com",response="181e124b006b03d1ac51d2d54bf9edd0",algorithm=MD5
User-Agent: eyeBeam release 3015c stamp 27107
P-Behind-NAT: Yes
Record-Route: <sip:192.168.0.121:5060;lr>
Content-Length: 0
/*************************************************************************/
/* Callee "on hook" */
/*************************************************************************/
(15)Callee sends BYE to proxy
BYE sip:121@192.168.0.121:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.58:5060;branch=z9hG4bK-1042040550
Route: <sip:192.168.0.121:5060;lr>
To: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
From: <sip:123@hujintao.dlinkddns.com>;tag=995280513
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 3 BYE
Max-Forwards: 70
User-Agent: Dlink-1.00.370
Content-Length: 0
(16)Proxy sends BYE to caller
BYE sip:121@116.227.0.44:6054 SIP/2.0
Via: SIP/2.0/UDP 116.228.5.146:5060;rport;branch=z9hG4bK4ac58eebef3-84116836-de76c3f7
Via: SIP/2.0/UDP 192.168.0.58:5060;branch=z9hG4bK-1042040550
To: "121" <sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
From: <sip:123@hujintao.dlinkddns.com>;tag=995280513
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 3 BYE
Max-Forwards: 69
User-Agent: Dlink-1.00.370
Record-Route: <sip:116.228.5.146:5060;lr>
Content-Length: 0
(17)Caller sends OK to proxy
SIP/2.0 200 OK
Via: SIP/2.0/UDP 116.228.5.146:5060;rport=5060;branch=z9hG4bK4ac58eebef3-84116836-de76c3f7
Via: SIP/2.0/UDP 192.168.0.58:5060;branch=z9hG4bK-1042040550
Record-Route: <sip:116.228.5.146:5060;lr>
Contact: <sip:121@116.227.0.44:6054>
To: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
From: <sip:123@hujintao.dlinkddns.com>;tag=995280513
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 3 BYE
User-Agent: eyeBeam release 3015c stamp 27107
Content-Length: 0
(18)Prxoy sends OK to callee
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.58:5060;branch=z9hG4bK-1042040550
Record-Route: <sip:192.168.0.121:5060;lr>
Contact: <sip:121@192.168.0.121:5060>
To: "121"<sip:121@hujintao.dlinkddns.com>;tag=eb7eb665
From: <sip:123@hujintao.dlinkddns.com>;tag=995280513
Call-ID: 1b693f6e6b37ef70@dG9tYXRvLTNlMTY2Zjgw
CSeq: 3 BYE
User-Agent: eyeBeam release 3015c stamp 27107
Content-Length: 0