Sip协议(五)-通话拨打流程

Sip协议(五)-通话拨打流程

本次主要记录下sip协议中的通话拨打流程.

一: 主要流程

  1. agent主动拨打
  2. 对方接听
  3. 对方挂断

二: sip协议过程

  1. 发送请求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
    
  2. 主叫接收到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
    
  3. 发送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
    
  4. 重新发送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
    
  5. 接收到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
    
  6. 主叫接收到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
    
  7. 主叫接收到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
    
  8. 主叫发送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
    
  9. 主叫接收到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
    
  10. 主角回执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
    
  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值