INVITE SIP UAC/UAS

On peut éprouver les capacités de SIP dans un contexte UAC vers UAS sans serveur proxy. Le plus simple est d'installer un softphone comme Linephone ou CSIPsimple ou encore PJSUA sur deux ordinateurs du réseau local.

Ici la destination est encodée directement dans le logiciel : sip:192.168.1.8. Aucun paramètre n'est configuré sur le logiciel.

Source : https://www.cloudshark.org/captures/f22c8443205b

1. Requête INVITE SDP

Le premier message est une requête INVITE décrite comme suit

Session Initiation Protocol (INVITE)
    Request-Line: INVITE sip:192.168.1.8 SIP/2.0
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;branch=z9hG4bK.zQpMKMKmd;rport
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: sip:192.168.1.8
        CSeq: 20 INVITE
        Call-ID: dJpMERl3hb
        Max-Forwards: 70
        Supported: outbound
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
        Content-Type: application/sdp
        Content-Length: 585
        Contact: <sip:linphone@192.168.1.7>;+sip.instance="<urn:uuid:aa9274b7-03d6-4a98-b5f3-474e7603a6d0>"
        User-Agent: Linphone/3.9.1 (belle-sip/1.4.2)
    Message Body

2. Réponse provisionnelle 100 Trying

  Status-Line: SIP/2.0 100 Trying
  Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;rport=5060;received=192.168.1.7;branch=z9hG4bK.zQpMKMKmd
        Call-ID: dJpMERl3hb
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>
        CSeq: 20 INVITE
        Content-Length:  0

3. Réponse provisionnelle 180 Ringing

    Status-Line: SIP/2.0 180 Ringing
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;rport=5060;received=192.168.1.7;branch=z9hG4bK.zQpMKMKmd
        Call-ID: dJpMERl3hb
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>;tag=2ALrvgnIqfZqo1h4Cs5PAG9HS3b4GQNz
        CSeq: 20 INVITE
        Contact: <sip:192.168.1.8:5060>
        Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
        Content-Length:  0

4. Réponse 200 OK SDP

    Status-Line: SIP/2.0 200 OK
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;rport=5060;received=192.168.1.7;branch=z9hG4bK.zQpMKMKmd
        Call-ID: dJpMERl3hb
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>;tag=2ALrvgnIqfZqo1h4Cs5PAG9HS3b4GQNz
        CSeq: 20 INVITE
        Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
        Contact: <sip:192.168.1.8:5060>
        Supported: replaces, 100rel, timer, norefersub
        Content-Type: application/sdp
        Content-Length:   300
    Message Body
        Session Description Protocol

5. ACK

    Request-Line: ACK sip:192.168.1.8:5060 SIP/2.0
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;rport;branch=z9hG4bK.fPDRQHIBm
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>;tag=2ALrvgnIqfZqo1h4Cs5PAG9HS3b4GQNz
        CSeq: 20 ACK
        Call-ID: dJpMERl3hb
        Max-Forwards: 70

6. Transfert des medias

Le transfert de la voix est assuré par RTP codé en G.711 PCMU. Le format a été négocié par SDP dans la requête INVITE et la réponse 200 OK.

    Request-Line: INVITE sip:192.168.1.8 SIP/2.0
    Message Header
    Message Body
        Session Description Protocol
            Session Description Protocol Version (v): 0
            Owner/Creator, Session Id (o): linphone 1108 2378 IN IP4 192.168.1.7
            Session Name (s): Talk
            Connection Information (c): IN IP4 192.168.1.7
            Time Description, active time (t): 0 0
            Session Attribute (a): rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
            Media Description, name and address (m): audio 7078 RTP/AVP 96 97 98 99 0 8 101 100 102
                Media Type: audio
                Media Port: 7078
                Media Protocol: RTP/AVP
                Media Format: DynamicRTP-Type-96
                Media Format: DynamicRTP-Type-97
                Media Format: DynamicRTP-Type-98
                Media Format: DynamicRTP-Type-99
                Media Format: ITU-T G.711 PCMU
                Media Format: ITU-T G.711 PCMA
                Media Format: DynamicRTP-Type-101
                Media Format: DynamicRTP-Type-100
                Media Format: DynamicRTP-Type-102
            Media Attribute (a): rtpmap:96 opus/48000/2
            Media Attribute (a): fmtp:96 useinbandfec=1
            Media Attribute (a): rtpmap:97 SILK/16000
            Media Attribute (a): rtpmap:98 speex/16000
            Media Attribute (a): fmtp:98 vbr=on
            Media Attribute (a): rtpmap:99 speex/8000
            Media Attribute (a): fmtp:99 vbr=on
            Media Attribute (a): rtpmap:101 telephone-event/48000
            Media Attribute (a): rtpmap:100 telephone-event/16000
            Media Attribute (a): rtpmap:102 telephone-event/8000
            Media Description, name and address (m): video 9078 RTP/AVP 96 97
            Media Attribute (a): rtpmap:96 VP8/90000
            Media Attribute (a): rtpmap:97 H264/90000
            Media Attribute (a): fmtp:97 profile-level-id=42801F
    Status-Line: SIP/2.0 200 OK
    Message Header
    Message Body
        Session Description Protocol
            Session Description Protocol Version (v): 0
            Owner/Creator, Session Id (o): - 3671180764 3671180766 IN IP4 192.168.1.8
            Session Name (s): pjmedia
            Connection Information (c): IN IP4 192.168.1.8
            Time Description, active time (t): 0 0
            Media Description, name and address (m): audio 4006 RTP/AVP 0 102
            Connection Information (c): IN IP4 192.168.1.8
            Media Attribute (a): rtcp:4007 IN IP4 192.168.1.8
            Media Attribute (a): sendrecv
            Media Attribute (a): rtpmap:0 PCMU/8000
            Media Attribute (a): rtpmap:102 telephone-event/8000
            Media Attribute (a): fmtp:102 0-16
            Media Description, name and address (m): video 0 RTP/AVP
            Connection Information (c): IN IP4 192.168.1.8

7. Requête BYE

    Request-Line: BYE sip:192.168.1.8:5060 SIP/2.0
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;branch=z9hG4bK.UKDJAE8~q;rport
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>;tag=2ALrvgnIqfZqo1h4Cs5PAG9HS3b4GQNz
        CSeq: 21 BYE
        Call-ID: dJpMERl3hb
        Max-Forwards: 70
        User-Agent: Linphone/3.9.1 (belle-sip/1.4.2)

8. Réponse OK

    Status-Line: SIP/2.0 200 OK
    Message Header
        Via: SIP/2.0/UDP 192.168.1.7:5060;rport=5060;received=192.168.1.7;branch=z9hG4bK.UKDJAE8~q
        Call-ID: dJpMERl3hb
        From: <sip:linphone@192.168.1.7>;tag=zDTUMmqVS
        To: <sip:192.168.1.8>;tag=2ALrvgnIqfZqo1h4Cs5PAG9HS3b4GQNz
        CSeq: 21 BYE
        Content-Length:  0

Commentaires