Sip协议(五)-通话拨打流程
本次主要记录下sip协议中的通话拨打流程.
一: 主要流程
- agent主动拨打
- 对方接听
- 对方挂断
二: sip协议过程
-
发送请求INVITE
INVITE sip:777xxxx***********@1.1.1.101 SIP/2.0 Via: SIP/2.0/TCP 127.0.0.1:40838;rport;branch=z9hG4bK54926 Max-Forwards: 70 To: <sip:777xxxx***********@1.1.1.101> From: <sip:1001@1.1.1.100>;tag=z9hG4bK98652650 Call-ID: 008308008483@127.0.0.1 CSeq: 1 INVITE Contact: <sip:1001@127.0.0.1:40838;transport=tcp> Expires: 3600 User-Agent: TestAgent/1.0.0/V2318A Content-Length: 285 Content-Type: application/sdp v=0 o=1001@1.1.1.100 0 0 IN IP4 127.0.0.1 s=Session SIP/SDP c=IN IP4 127.0.0.1 t=0 0 m=audio 21000 RTP/AVP 8 0 101 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 m=video 21070 RTP/AVP 103 a=rtpmap:103 h263-1998/90000
-
主叫接收到407
407 Proxy Authentication Required Via: SIP/2.0/TCP 192.168.12.36:40838;rport=44274;branch=z9hG4bK54926 From: <sip:1001@10.10.10.109>;tag=z9hG4bK98652650 To: <sip:777100118337104423@101.200.234.52>;tag=cBc0Q2jNBDggp Call-ID: 008308008483@192.168.12.36 CSeq: 1 INVITE User-Agent: FreeSWITCH-mod_sofia/1.10.10-release~64bit Accept: application/sdp Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: path, replaces Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Proxy-Authenticate: Digest realm="10.10.10.109", nonce="25e5cb3c-4e82-4d64-a225-8551aa052dd2", algorithm=MD5, qop="auth" Content-Length: 0
-
发送ACK
ACK sip:777100118337104423@101.200.234.52 SIP/2.0 Via: SIP/2.0/TCP 192.168.12.36:40838;rport;branch=z9hG4bK54926 Max-Forwards: 70 To: <sip:777100118337104423@101.200.234.52>;tag=cBc0Q2jNBDggp From: <sip:1001@10.10.10.109>;tag=z9hG4bK98652650 Call-ID: 008308008483@192.168.12.36 CSeq: 1 ACK User-Agent: MVCAgent/1.0.0/V2318A Content-Length: 0
-
重新发送INVITE
INVITE sip:777100118337104423@101.200.234.52 SIP/2.0 Via: SIP/2.0/TCP 192.168.12.36:40838;rport;branch=z9hG4bK65875 Max-Forwards: 70 To: <sip:777100118337104423@101.200.234.52> From: <sip:1001@10.10.10.109>;tag=z9hG4bK98652650 Call-ID: 008308008483@192.168.12.36 CSeq: 2 INVITE Contact: <sip:1001@192.168.12.36:40838;transport=tcp> Expires: 3600 User-Agent: MVCAgent/1.0.0/V2318A Proxy-Authorization: Digest username="1001", realm="10.10.10.109", nonce="25e5cb3c-4e82-4d64-a225-8551aa052dd2", uri="sip:777100118337104423@101.200.234.52", algorithm=MD5, qop=auth, nc=00000001, cnonce="fc99574c8f31dfcc", response="fea67a410d5852640394870d7f24fb14" Content-Length: 285 Content-Type: application/sdp v=0 o=1001@10.10.10.109 0 0 IN IP4 192.168.12.36 s=Session SIP/SDP c=IN IP4 192.168.12.36 t=0 0 m=audio 21000 RTP/AVP 8 0 101 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 m=video 21070 RTP/AVP 103 a=rtpmap:103 h263-1998/90000
-
接收到sip协议
100 Trying Via: SIP/2.0/TCP 127.0.0.1:40838;rport=44274;branch=z9hG4bK65875 From: <sip:1001@1.1.1.100>;tag=z9hG4bK98652650 To: <sip:777100118337104423@1.1.1.101> Call-ID: 008308008483@127.0.0.1 CSeq: 2 INVITE User-Agent: FreeSWITCH-mod_sofia/1.10.10-release~64bit Content-Length: 0
-
主叫接收到183
183 Session Progress Via: SIP/2.0/TCP 192.168.12.36:40838;rport=44274;branch=z9hG4bK65875 From: <sip:1001@10.10.10.109>;tag=z9hG4bK98652650 To: <sip:777100118337104423@101.200.234.52>;tag=F6QaXK5Z27j8r Call-ID: 008308008483@192.168.12.36 CSeq: 2 INVITE Contact: <sip:777100118337104423@10.10.10.109:8060;transport=tcp> User-Agent: FreeSWITCH-mod_sofia/1.10.10-release~64bit Accept: application/sdp Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: path, replaces Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Content-Type: application/sdp Content-Disposition: session Content-Length: 265 Remote-Party-ID: "1001" <sip:1001@101.200.234.52>;party=calling;privacy=off;screen=no v=0 o=FreeSWITCH 1719796008 1719796009 IN IP4 10.10.10.109 s=FreeSWITCH c=IN IP4 10.10.10.109 t=0 0 m=audio 17264 RTP/AVP 8 101 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 m=video 0 RTP/AVP 99 a=rtpmap:99 VP8/90000
-
主叫接收到200
SIP/2.0 200 OK Via: SIP/2.0/TCP 192.168.12.36:40838;rport=44274;branch=z9hG4bK65875 From: <sip:1001@10.10.10.109>;tag=z9hG4bK98652650 To: <sip:777100118337104423@101.200.234.52>;tag=F6QaXK5Z27j8r Call-ID: 008308008483@192.168.12.36 CSeq: 2 INVITE Contact: <sip:777100118337104423@10.10.10.109:8060;transport=tcp> User-Agent: FreeSWITCH-mod_sofia/1.10.10-release~64bit Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: path, replaces Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Content-Type: application/sdp Content-Disposition: session Content-Length: 265 Remote-Party-ID: "Outbound Call" <sip:1001@101.200.234.52>;party=calling;privacy=off;screen=no v=0 o=FreeSWITCH 1719796008 1719796009 IN IP4 10.10.10.109 s=FreeSWITCH c=IN IP4 10.10.10.109 t=0 0 m=audio 17264 RTP/AVP 8 101 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 m=video 0 RTP/AVP 99 a=rtpmap:99 VP8/90000
-
主叫发送ACK
ACK sip:777100118337104423@1.1.1.100:8060;transport=tcp SIP/2.0 Via: SIP/2.0/TCP 192.168.12.36:40838;rport;branch=z9hG4bK02029 Max-Forwards: 70 To: <sip:777100118337104423@1.1.1.101>;tag=F6QaXK5Z27j8r From: <sip:1001@1.1.1.100>;tag=z9hG4bK98652650 Call-ID: 008308008483@192.168.12.36 CSeq: 2 ACK Contact: <sip:1001@192.168.12.36:40838;transport=tcp> Expires: 3600 User-Agent: MVCAgent/1.0.0/V2318A Content-Length: 0
-
主叫接收到BYE
BYE sip:1001@192.168.12.36:40838;transport=tcp SIP/2.0 Via: SIP/2.0/TCP 1.1.1.100:8060;branch=z9hG4bKpmS8S2vtreKra Max-Forwards: 70 From: <sip:777100118337104423@1.1.1.101>;tag=F6QaXK5Z27j8r To: <sip:1001@1.1.1.100>;tag=z9hG4bK98652650 Call-ID: 008308008483@192.168.12.36 CSeq: 85352847 BYE User-Agent: FreeSWITCH-mod_sofia/1.10.10-release~64bit Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: path, replaces Reason: Q.850;cause=16;text="NORMAL_CLEARING" Content-Length: 0
-
主角回执200
SIP/2.0 200 OK Via: SIP/2.0/TCP 1.1.1.100:8060;branch=z9hG4bKpmS8S2vtreKra To: <sip:1001@1.1.1.100>;tag=z9hG4bK98652650 From: <sip:777100118337104423@1.1.1.101>;tag=F6QaXK5Z27j8r Call-ID: 008308008483@192.168.12.36 CSeq: 85352847 BYE Server: TestAgent/1.0.0/V2318A Content-Length: 0