[asterisk-dev] Regarding SIP performance

Brian Candler B.Candler at pobox.com
Mon Oct 16 02:29:52 MST 2006


On Fri, Oct 13, 2006 at 11:09:50AM -0500, Kevin P. Fleming wrote:
> ----- Steve Langstaff <steve.langstaff at citel.com> wrote:
> > This is just off the top of my head, so excuse me if I am talking
> > rubbish, but perhaps the canreinvite checking could be done *before*
> > the
> > channels to the endpoints have been established, so that a call that
> > will be 'reinvited' does not go though the RTP setup/cleardown
> > mechanism
> > on Asterisk.
> 
> As discussed many times on this list before, that is not possible. The incoming channel is already established before any outbound channels are created, and a single incoming channel can create multiple outgoing channels (with only only finally being connected, of course).

Well, I have just tcpdumped this on an Asterisk SVN trunk server, and the
second leg INVITE offers an end-to-end media stream. There is no initial
two-leg call setup, followed by a re-invite to reconnect, as was implied
above.

The tcpdump is attached below. In it:

* 10.69.255.246 is the first endpoint (Audiocodes Tulip ATA)
* 10.69.255.251 is the Asterisk server
* 10.69.255.242 is the second endpoint (another Tulip)

You can see that the INVITE sent from Asterisk to the second endpoint offers
the first endpoint's IP address in the SDP body.

Asterisk really does look and smell like a SIP proxy in this case.

I note Asterisk offers extra codecs in the second leg, because it could
transcode if necessary; presumably if the second handset chose a codec not
supported by the first, Asterisk would need to re-INVITE to set up a two leg
call. I've not tested this though.

Regards,

Brian.

10:11:15.232774 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 915) 10.69.255.246.5060 > 10.69.255.251.5060: SIP, length: 887
        INVITE sip:403 at 10.69.255.251:5060;transport=UDP SIP/2.0
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 1 INVITE
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-50639551-5dc88d80
        Max-Forwards: 70
        Supported: replaces
        Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL
        Contact: <sip:tulip1 at 10.69.255.246:5060;transport=UDP>
        Content-Type: application/sdp
        Content-Length: 323

        v=0
        o=rtp 1160990290 1160990290 IN IP4 10.69.255.246
        s=-
        c=IN IP4 10.69.255.246
        t=0 0
        m=audio 5004 RTP/AVP 0 8 18 4 98 2 101
        a=rtpmap:0 PCMU/8000
        a=rtpmap:8 PCMA/8000
        a=rtpmap:18 G729/8000
        a=rtpmap:4 g723/8000
        a=rtpmap:98 g726-16/8000
        a=rtpmap:2 g726-32/8000
        a=rtpmap:101 telephone-event/8000
        a=fmtp:101 0-15

10:11:15.233668 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 646) 10.69.255.251.5060 > 10.69.255.246.5060: SIP, length: 618
        SIP/2.0 407 Proxy Authentication Required
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-50639551-5dc88d80;received=10.69.255.246
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>;tag=as6362b2f6
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 1 INVITE
        User-Agent: Asterisk PBX
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
        Supported: replaces
        Proxy-Authenticate: Digest algorithm=MD5, realm="inspiredbroadcast.net", nonce="2f1d139b"
        Content-Length: 0


10:11:15.270927 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 499) 10.69.255.246.5060 > 10.69.255.251.5060: SIP, length: 471
        ACK sip:403 at 10.69.255.251:5060;transport=UDP SIP/2.0
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>;tag=as6362b2f6
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 1 ACK
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-50639551-5dc88d80
        Max-Forwards: 70
        Contact: <sip:tulip1 at 10.69.255.246:5060;transport=UDP>
        Content-Length: 0


10:11:15.300930 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 1113) 10.69.255.246.5060 > 10.69.255.251.5060: SIP, length: 1085
        INVITE sip:403 at 10.69.255.251:5060;transport=UDP SIP/2.0
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 2 INVITE
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-5063958c-235dc24
        Max-Forwards: 70
        Supported: replaces
        Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL
        Contact: <sip:tulip1 at 10.69.255.246:5060;transport=UDP>
        Proxy-Authorization: Digest username="tulip1",realm="inspiredbroadcast.net",nonce="2f1d139b",uri="sip:403 at 10.69.255.251:5060;transport=UDP",response="dcbec7fc26720c43efcb6f6f0d657872",algorithm=MD5
        Content-Type: application/sdp
        Content-Length: 323

        v=0
        o=rtp 1160990290 1160990290 IN IP4 10.69.255.246
        s=-
        c=IN IP4 10.69.255.246
        t=0 0
        m=audio 5004 RTP/AVP 0 8 18 4 98 2 101
        a=rtpmap:0 PCMU/8000
        a=rtpmap:8 PCMA/8000
        a=rtpmap:18 G729/8000
        a=rtpmap:4 g723/8000
        a=rtpmap:98 g726-16/8000
        a=rtpmap:2 g726-32/8000
        a=rtpmap:101 telephone-event/8000
        a=fmtp:101 0-15

10:11:15.301646 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 550) 10.69.255.251.5060 > 10.69.255.246.5060: SIP, length: 522
        SIP/2.0 100 Trying
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-5063958c-235dc24;received=10.69.255.246
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 2 INVITE
        User-Agent: Asterisk PBX
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
        Supported: replaces
        Contact: <sip:403 at 10.69.255.251>
        Content-Length: 0


10:11:15.302829 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 1081) 10.69.255.251.5060 > 10.69.255.242.5060: SIP, length: 1053
        INVITE sip:tulip3 at 10.69.255.242:5060 SIP/2.0
        Via: SIP/2.0/UDP 10.69.255.251:5060;branch=z9hG4bK3c9d7b68;rport
        From: "Tulip ATA port 1" <sip:401 at 10.69.255.251>;tag=as4b3d45a5
        To: <sip:tulip3 at 10.69.255.242:5060>
        Contact: <sip:401 at 10.69.255.251>
        Call-ID: 4cd1ea98328205b61814615917910bde at 10.69.255.251
        CSeq: 102 INVITE
        User-Agent: Asterisk PBX
        Max-Forwards: 70
        Date: Mon, 16 Oct 2006 09:11:15 GMT
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
        Supported: replaces
        Content-Type: application/sdp
        Content-Length: 506

        v=0
        o=root 6527 6527 IN IP4 10.69.255.246
        s=session
        c=IN IP4 10.69.255.246
        t=0 0
        m=audio 5004 RTP/AVP 0 8 3 2 97 7 110 5 101
        a=rtpmap:0 PCMU/8000
        a=ptime:20
        a=rtpmap:8 PCMA/8000
        a=ptime:20
        a=rtpmap:3 GSM/8000
        a=ptime:20
        a=rtpmap:2 G726-32/8000
        a=ptime:20
        a=rtpmap:97 iLBC/8000
        a=fmtp:97 mode=30
        a=rtpmap:7 LPC/8000
        a=ptime:20
        a=rtpmap:110 speex/8000
        a=ptime:20
        a=rtpmap:5 DVI4/8000
        a=ptime:20
        a=rtpmap:101 telephone-event/8000
        a=fmtp:101 0-16
        a=silenceSupp:off - - - -
        a=sendrecv

10:11:15.444037 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 482) 10.69.255.242.5060 > 10.69.255.251.5060: SIP, length: 454
        SIP/2.0 180 Ringing
        From: "Tulip ATA port 1"<sip:401 at 10.69.255.251>;tag=as4b3d45a5
        To: <sip:tulip3 at 10.69.255.242:5060>;tag=100c2cb0-f2ff450a-13c4-45334cb1-514b3146-45334cb1
        Call-ID: 4cd1ea98328205b61814615917910bde at 10.69.255.251
        CSeq: 102 INVITE
        Via: SIP/2.0/UDP 10.69.255.251:5060;rport=5060;branch=z9hG4bK3c9d7b68
        Supported: replaces
        Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL
        Contact: <sip:tulip3 at 10.69.255.242:5060>
        Content-Length: 0


10:11:15.444908 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 566) 10.69.255.251.5060 > 10.69.255.246.5060: SIP, length: 538
        SIP/2.0 180 Ringing
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-5063958c-235dc24;received=10.69.255.246
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>;tag=as245a347d
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 2 INVITE
        User-Agent: Asterisk PBX
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
        Supported: replaces
        Contact: <sip:403 at 10.69.255.251>
        Content-Length: 0

================ at this point the phone is ringing =================

================ then I pick up the second handset ==================

10:11:19.237723 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 703) 10.69.255.242.5060 > 10.69.255.251.5060: SIP, length: 675
        SIP/2.0 200 OK
        From: "Tulip ATA port 1"<sip:401 at 10.69.255.251>;tag=as4b3d45a5
        To: <sip:tulip3 at 10.69.255.242:5060>;tag=100c2cb0-f2ff450a-13c4-45334cb1-514b3146-45334cb1
        Call-ID: 4cd1ea98328205b61814615917910bde at 10.69.255.251
        CSeq: 102 INVITE
        Via: SIP/2.0/UDP 10.69.255.251:5060;rport=5060;branch=z9hG4bK3c9d7b68
        Supported: replaces
        Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL
        Contact: <sip:tulip3 at 10.69.255.242:5060>
        Content-Type: application/sdp
        Content-Length: 193

        v=0
        o=rtp 1160990330 1160990330 IN IP4 10.69.255.242
        s=-
        c=IN IP4 10.69.255.242
        t=0 0
        m=audio 5004 RTP/AVP 0 101
        a=rtpmap:0 PCMU/8000
        a=rtpmap:101 telephone-event/8000
        a=fmtp:101 0-15

10:11:19.238363 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 464) 10.69.255.251.5060 > 10.69.255.242.5060: SIP, length: 436
        ACK sip:tulip3 at 10.69.255.242:5060 SIP/2.0
        Via: SIP/2.0/UDP 10.69.255.251:5060;branch=z9hG4bK6486b12a;rport
        From: "Tulip ATA port 1" <sip:401 at 10.69.255.251>;tag=as4b3d45a5
        To: <sip:tulip3 at 10.69.255.242:5060>;tag=100c2cb0-f2ff450a-13c4-45334cb1-514b3146-45334cb1
        Contact: <sip:401 at 10.69.255.251>
        Call-ID: 4cd1ea98328205b61814615917910bde at 10.69.255.251
        CSeq: 102 ACK
        User-Agent: Asterisk PBX
        Max-Forwards: 70
        Content-Length: 0


10:11:19.239476 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 908) 10.69.255.251.5060 > 10.69.255.246.5060: SIP, length: 880
        SIP/2.0 200 OK
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb1-5063958c-235dc24;received=10.69.255.246
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>;tag=as245a347d
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 2 INVITE
        User-Agent: Asterisk PBX
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
        Supported: replaces
        Contact: <sip:403 at 10.69.255.251>
        Content-Type: application/sdp
        Content-Length: 314

        v=0
        o=root 6527 6527 IN IP4 10.69.255.242
        s=session
        c=IN IP4 10.69.255.242
        t=0 0
        m=audio 5004 RTP/AVP 0 8 2 101
        a=rtpmap:0 PCMU/8000
        a=ptime:20
        a=rtpmap:8 PCMA/8000
        a=ptime:20
        a=rtpmap:2 G726-32/8000
        a=ptime:20
        a=rtpmap:101 telephone-event/8000
        a=fmtp:101 0-16
        a=silenceSupp:off - - - -
        a=sendrecv

10:11:19.295487 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 679) 10.69.255.246.5060 > 10.69.255.251.5060: SIP, length: 651
        ACK sip:403 at 10.69.255.251 SIP/2.0
        From: "Line 1"<sip:tulip1 at 10.69.255.246>;tag=100c3368-f6ff450a-13c4-45334cb1-487a1226-45334cb1
        To: "403"<sip:403 at 10.69.255.251:5060>;tag=as245a347d
        Call-ID: 100c5908-f6ff450a-13c4-45334cb1-47204eba-45334cb1 at 10.69.255.246
        CSeq: 2 ACK
        Via: SIP/2.0/UDP 10.69.255.246:5060;rport;branch=z9hG4bK-45334cb5-5063a534-62bcf2a6
        Max-Forwards: 70
        Contact: <sip:tulip1 at 10.69.255.246:5060;transport=UDP>
        Proxy-Authorization: Digest username="tulip1",realm="inspiredbroadcast.net",nonce="2f1d139b",uri="sip:403 at 10.69.255.251:5060;transport=UDP",response="dcbec7fc26720c43efcb6f6f0d657872",algorithm=MD5
        Content-Length: 0



More information about the asterisk-dev mailing list