zoukankan      html  css  js  c++  java
  • 一个Sip会话的例子

    本例子是一个基本的SIP四边传送,U1->P1->P2->U2,使用proxy来传送。摘自RFC3261。

     

    F1 INVITE Alice -> atlanta.com proxy

    INVITE sip:bob@biloxi.com SIP/2.0

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    Max-Forwards: 70

    To: Bob <sip:bob@biloxi.com>

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:alice@pc33.atlanta.com>

    Content-Type: application/sdp

    Content-Length: 142

    (Alice’s SDP not shown)

    F2 100 Trying atlanta.com proxy -> Alice

    SIP/2.0 100 Trying

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Content-Length: 0

    F3 INVITE atlanta.com proxy -> biloxi.com proxy

    INVITE sip:bob@biloxi.com SIP/2.0

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    Max-Forwards: 69

    To: Bob <sip:bob@biloxi.com>

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:alice@pc33.atlanta.com>

    Content-Type: application/sdp

    Content-Length: 142

    (Alice’s SDP not shown)

    F4 100 Trying biloxi.com proxy -> atlanta.com proxy

    SIP/2.0 100 Trying

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Content-Length: 0

    F5 INVITE biloxi.com proxy -> Bob

    INVITE sip:bob@192.0.2.4 SIP/2.0

    Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    Max-Forwards: 68

    To: Bob <sip:bob@biloxi.com>

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:alice@pc33.atlanta.com>

    Content-Type: application/sdp

    Content-Length: 142

    (Alice’s SDP not shown)

    F6 180 Ringing Bob -> biloxi.com proxy

    SIP/2.0 180 Ringing

    Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1

    ;received=192.0.2.3

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    Contact: <sip:bob@192.0.2.4>

    CSeq: 314159 INVITE

    Content-Length: 0

    F7 180 Ringing biloxi.com proxy -> atlanta.com proxy

    SIP/2.0 180 Ringing

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    Contact: <sip:bob@192.0.2.4>

    CSeq: 314159 INVITE

    Content-Length: 0

    F8 180 Ringing atlanta.com proxy -> Alice

    SIP/2.0 180 Ringing

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    Contact: <sip:bob@192.0.2.4>

    CSeq: 314159 INVITE

    Content-Length: 0

    F9 200 OK Bob -> biloxi.com proxy

    SIP/2.0 200 OK

    Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1

    ;received=192.0.2.3

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:bob@192.0.2.4>

    Content-Type: application/sdp

    Content-Length: 131

    (Bob’s SDP not shown)

    F10 200 OK biloxi.com proxy -> atlanta.com proxy

    SIP/2.0 200 OK

    Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1

    ;received=192.0.2.2

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:bob@192.0.2.4>

    Content-Type: application/sdp

    Content-Length: 131

    (Bob’s SDP not shown)

    F11 200 OK atlanta.com proxy -> Alice

    SIP/2.0 200 OK

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8

    ;received=192.0.2.1

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 INVITE

    Contact: <sip:bob@192.0.2.4>

    Content-Type: application/sdp

    Content-Length: 131

    (Bob’s SDP not shown)

    F12 ACK Alice -> Bob

    ACK sip:bob@192.0.2.4 SIP/2.0

    Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds9

    Max-Forwards: 70

    To: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    From: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 314159 ACK

    Content-Length: 0

    在Alice和Bob之间的媒体会话现在建立了。Bob首先挂机。注意Bob的SIP电话维持它自己的Cseq号码空间,在这里,是231开始的。由于Bob发起请求,那么To和From URI和tags交换了。

    F13 BYE Bob -> Alice

    BYE sip:alice@pc33.atlanta.com SIP/2.0

    Via: SIP/2.0/UDP 192.0.2.4;branch=z9hG4bKnashds10

    Max-Forwards: 70

    From: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    To: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 231 BYE

    Content-Length: 0

    F14 200 OK Alice -> Bob

    SIP/2.0 200 OK

    Via: SIP/2.0/UDP 192.0.2.4;branch=z9hG4bKnashds10

    From: Bob <sip:bob@biloxi.com>;tag=a6c85cf

    To: Alice <sip:alice@atlanta.com>;tag=1928301774

    Call-ID: a84b4c76e66710

    CSeq: 231 BYE

    Content-Length: 0

  • 相关阅读:
    愿你出走半生,归来多赚点钱
    喝下这碗毒鸡汤:作为一个『乖』学生,请一定要以学业为主!
    劝你理财,是我最大的温柔-lip师兄
    大半夜客户问我为什么这么拼,我给她算了笔账,她嚎啕大哭......
    女人为什么要经济独立
    定投6年以亏损收场,他到底做错了什么
    你的死工资,正在拖垮你&一辈子需要花多少钱
    字符串的长度
    泥塑课
    最大的数
  • 原文地址:https://www.cnblogs.com/wenjingu/p/2082303.html
Copyright © 2011-2022 走看看