sip学习--邀请流程

1000(192.168.1.119)              1001(192.168.1.112)
|                                                     |
|    INVITE                                     |
|    ------------------------------>           |
|    100 Trying                                |
|    <------------------------------           |
|    180 Ringing                              |
|     <------------------------------           |
|    200 OK                                     |
|    <-------------------------------          |
|    ACK                                          |
|    ------------------------------->          |
|                                                     |
|    <---RTP--------------------->         |
|    <---RTP--------------------->         |
|    <---RTP--------------------->         |
|    ...                                              |
|                                                     |
|    BYE                                          |
|    <-------------------------------          |
|    200 OK                                     |
|    -------------------------------->         |
|                                                     |


/////////1000-->INVITE-->Server

U 192.168.1.119:34308 -> 192.168.1.88:5060
INVITE sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport;branch=z9hG4bK1735896405.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 20 INVITE.
Contact: <sip:[email protected]:34308>.
Content-Type: application/sdp.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.
Max-Forwards: 70.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Subject: Phone call.
Content-Length:   503.
.
v=0.
o=1000 2317 3462 IN IP4 114.255.88.22.
s=Talk.
c=IN IP4 114.255.88.22.
b=AS:380.
t=0 0.
m=audio 44473 RTP/AVP 120 111 110 0 8 104 100 3 101.
a=rtpmap:120 SILK/16000.
a=rtpmap:111 speex/16000.
a=fmtp:111 vbr=on.
a=rtpmap:110 speex/8000.
a=fmtp:110 vbr=on.
a=rtpmap:104 AMR/8000.
a=fmtp:104 octet-align=1.
a=rtpmap:100 iLBC/8000.
a=fmtp:100 mode=30.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
a=rtcp:7079 IN IP4 192.168.1.119.
m=video 16420 RTP/AVP 103.
a=rtpmap:103 VP8/90000.
a=rtcp:9079.

/////////Server-->407 Proxy Authentication Required-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
SIP/2.0 407 Proxy Authentication Required.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1735896405.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=b27e1a1d33761e85846fc98f5f3a7e58.2eec.
Call-ID: 768170422.
CSeq: 20 INVITE.
Proxy-Authenticate: Digest realm="192.168.1.88", nonce="Uc1zLFHNcgDco99Y6IeY77vT8cUEd3V3".
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.

/////////1000-->ACK-->Server
#
U 192.168.1.119:34308 -> 192.168.1.88:5060
ACK sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport;branch=z9hG4bK1735896405.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=b27e1a1d33761e85846fc98f5f3a7e58.2eec.
Call-ID: 768170422.
CSeq: 20 ACK.
Content-Length: 0.
.

/////////1000-->INVITE-->Server
#
U 192.168.1.119:34308 -> 192.168.1.88:5060
INVITE sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:34308>.
Proxy-Authorization: Digest username="1000", realm="192.168.1.88", nonce="Uc1zLFHNcgDco99Y6IeY77vT8cUEd3V3", uri="sip:[email protected]", response="5f3854ac9b61ab7ec8c01c1bb4dd4082", algorithm=MD5.
Content-Type: application/sdp.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.
Max-Forwards: 70.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Subject: Phone call.
Content-Length:   503.
.
v=0.
o=1000 2317 3462 IN IP4 114.255.88.22.
s=Talk.
c=IN IP4 114.255.88.22.
b=AS:380.
t=0 0.
m=audio 44473 RTP/AVP 120 111 110 0 8 104 100 3 101.
a=rtpmap:120 SILK/16000.
a=rtpmap:111 speex/16000.
a=fmtp:111 vbr=on.
a=rtpmap:110 speex/8000.
a=fmtp:110 vbr=on.
a=rtpmap:104 AMR/8000.
a=fmtp:104 octet-align=1.
a=rtpmap:100 iLBC/8000.
a=fmtp:100 mode=30.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
a=rtcp:7079 IN IP4 192.168.1.119.
m=video 16420 RTP/AVP 103.
a=rtpmap:103 VP8/90000.
a=rtcp:9079.

/////////Server-->100 Trying-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 21 INVITE.
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.

/////////Server-->INVITE-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
INVITE sip:[email protected];line=a99bbc8e3e5e611 SIP/2.0.
Record-Route: <sip:192.168.1.88;lr=on>.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:34308>.
Content-Type: application/sdp.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.
Max-Forwards: 16.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Subject: Phone call.
Content-Length:   503.
.
v=0.
o=1000 2317 3462 IN IP4 114.255.88.22.
s=Talk.
c=IN IP4 114.255.88.22.
b=AS:380.
t=0 0.
m=audio 44473 RTP/AVP 120 111 110 0 8 104 100 3 101.
a=rtpmap:120 SILK/16000.
a=rtpmap:111 speex/16000.
a=fmtp:111 vbr=on.
a=rtpmap:110 speex/8000.
a=fmtp:110 vbr=on.
a=rtpmap:104 AMR/8000.
a=fmtp:104 octet-align=1.
a=rtpmap:100 iLBC/8000.
a=fmtp:100 mode=30.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
a=rtcp:7079 IN IP4 192.168.1.119.
m=video 16420 RTP/AVP 103.
a=rtpmap:103 VP8/90000.
a=rtcp:9079.

/////////Server-->INVITE-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
INVITE sip:[email protected];line=6aea0c5f6333c41 SIP/2.0.
Record-Route: <sip:192.168.1.88;lr=on>.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.1.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:34308>.
Content-Type: application/sdp.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.
Max-Forwards: 16.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Subject: Phone call.
Content-Length:   503.
.
v=0.
o=1000 2317 3462 IN IP4 114.255.88.22.
s=Talk.
c=IN IP4 114.255.88.22.
b=AS:380.
t=0 0.
m=audio 44473 RTP/AVP 120 111 110 0 8 104 100 3 101.
a=rtpmap:120 SILK/16000.
a=rtpmap:111 speex/16000.
a=fmtp:111 vbr=on.
a=rtpmap:110 speex/8000.
a=fmtp:110 vbr=on.
a=rtpmap:104 AMR/8000.
a=fmtp:104 octet-align=1.
a=rtpmap:100 iLBC/8000.
a=fmtp:100 mode=30.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
a=rtcp:7079 IN IP4 192.168.1.119.
m=video 16420 RTP/AVP 103.
a=rtpmap:103 VP8/90000.
a=rtcp:9079.

/////////1001-->100 Trying-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>.
Call-ID: 768170422.
CSeq: 21 INVITE.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////1001-->101 Dialog Establishement-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
SIP/2.0 101 Dialog Establishement.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:5060>.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////1001-->404 Not Found-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
SIP/2.0 404 Not Found.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.1.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=18467.
Call-ID: 768170422.
CSeq: 21 INVITE.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->ACK-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
ACK sip:[email protected];line=6aea0c5f6333c41 SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.1.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=18467.
Call-ID: 768170422.
CSeq: 21 ACK.
Max-Forwards: 16.
Content-Length: 0.
.

/////////Server-->101 Dialog Establishement-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
SIP/2.0 101 Dialog Establishement.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:5060>.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////1001-->OPTIONS-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
OPTIONS sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport;branch=z9hG4bK14574.
From: <sip:[email protected]>;tag=6308.
To: <sip:[email protected]>.
Call-ID: 9633.
CSeq: 20 OPTIONS.
Accept: application/sdp.
Max-Forwards: 70.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->407 Proxy Authentication Required-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
SIP/2.0 407 Proxy Authentication Required.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport=5060;branch=z9hG4bK14574.
From: <sip:[email protected]>;tag=6308.
To: <sip:[email protected]>;tag=b27e1a1d33761e85846fc98f5f3a7e58.7679.
Call-ID: 9633.
CSeq: 20 OPTIONS.
Proxy-Authenticate: Digest realm="192.168.1.88", nonce="Uc1zLVHNcgHi878xjXYDM8ev5Fm+HVH4".
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.

/////////1001-->407 180 Ringing-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:5060>.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->407 180 Ringing-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]:5060>.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////1001-->200 OK-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK489f.b6c1ec97.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]>.
Content-Type: application/sdp.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length:   207.
.
v=0.
o=1001 1188 861 IN IP4 192.168.1.112.
s=Talk.
c=IN IP4 192.168.1.112.
t=0 0.
m=audio 0 RTP/AVP 101.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
m=video 9078 RTP/AVP 103.
a=rtpmap:103 VP8/90000.


/////////Server-->200 OK-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1699620867.
Record-Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 INVITE.
Contact: <sip:[email protected]>.
Content-Type: application/sdp.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length:   207.
.
v=0.
o=1001 1188 861 IN IP4 192.168.1.112.
s=Talk.
c=IN IP4 192.168.1.112.
t=0 0.
m=audio 0 RTP/AVP 101.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11.
m=video 9078 RTP/AVP 103.
a=rtpmap:103 VP8/90000.

/////////1000-->ACK-->Server
#
U 192.168.1.119:34308 -> 192.168.1.88:5060
ACK sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport;branch=z9hG4bK1059414352.
Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 ACK.
Contact: <sip:[email protected]:34308>.
Proxy-Authorization: Digest username="1000", realm="192.168.1.88", nonce="Uc1zLFHNcgDco99Y6IeY77vT8cUEd3V3", uri="sip:[email protected]", response="5f3854ac9b61ab7ec8c01c1bb4dd4082", algorithm=MD5.
Max-Forwards: 70.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->ACK-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
ACK sip:[email protected] SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bKcydzigwkX.
Via: SIP/2.0/UDP 192.168.1.119:34308;rport=34308;branch=z9hG4bK1059414352.
From: <sip:[email protected]>;tag=963256715.
To: <sip:[email protected]>;tag=41.
Call-ID: 768170422.
CSeq: 21 ACK.
Contact: <sip:[email protected]:34308>.
Proxy-Authorization: Digest username="1000", realm="192.168.1.88", nonce="Uc1zLFHNcgDco99Y6IeY77vT8cUEd3V3", uri="sip:[email protected]", response="5f3854ac9b61ab7ec8c01c1bb4dd4082", algorithm=MD5.
Max-Forwards: 16.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Content-Length: 0.
.

////////////////////////////////////////////////挂断
/////////1001-->BYE-->Server
#
U 192.168.1.112:5060 -> 192.168.1.88:5060
BYE sip:[email protected]:34308 SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport;branch=z9hG4bK24657.
Route: <sip:192.168.1.88;lr=on>.
From: <sip:[email protected]>;tag=41.
To: <sip:[email protected]>;tag=963256715.
Call-ID: 768170422.
CSeq: 2 BYE.
Contact: <sip:[email protected]:5060>.
Max-Forwards: 70.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->BYE-->1000
#
U 192.168.1.88:5060 -> 192.168.1.119:34308
BYE sip:[email protected]:34308 SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK935c.67a7a982.0.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport=5060;branch=z9hG4bK24657.
From: <sip:[email protected]>;tag=41.
To: <sip:[email protected]>;tag=963256715.
Call-ID: 768170422.
CSeq: 2 BYE.
Contact: <sip:[email protected]:5060>.
Max-Forwards: 16.
User-Agent: Linphone/3.6.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////1000-->200 OK-->Server
#
U 192.168.1.119:34308 -> 192.168.1.88:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.1.88;branch=z9hG4bK935c.67a7a982.0.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport=5060;branch=z9hG4bK24657.
From: <sip:[email protected]>;tag=41.
To: <sip:[email protected]>;tag=963256715.
Call-ID: 768170422.
CSeq: 2 BYE.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Content-Length: 0.
.

/////////Server-->BYE-->1001
#
U 192.168.1.88:5060 -> 192.168.1.112:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.1.112:5060;rport=5060;branch=z9hG4bK24657.
From: <sip:[email protected]>;tag=41.
To: <sip:[email protected]>;tag=963256715.
Call-ID: 768170422.
CSeq: 2 BYE.
User-Agent: LinphoneAndroid/2.2.1 (eXosip2/3.6.0).
Content-Length: 0.
.

猜你喜欢

转载自linyu19872008.iteye.com/blog/1897270
sip