Delay in processing of SDP

Hi,

we have a problem about the time processing of SDP information.
We post the image of the flow where you can see highlighted the “ACK SDP” sent from the remote PBX (10.120.4.10) to our PBX (asterisk, 10.129.18.11). Three lines below you can see the “INVITE SDP” sent from our PBX (asterisk, 10.129.18.11) to the endphone (10.129.18.12).
In this case there is more than 1 second of delay, but we experienced up to 5 seconds of delay.
The version of Asterisk that we use is: asterisk-1.8.7.1

Why this happens?
Is there some configuration that we can use to reduce this delay?

screenshot of the flow:

Thanks in advance, bye.
Giuseppe

There is not enough information to even start guessing. Also, JPG is a very poor format for screen grabs like this. You seem to have used a particularly low quality JPG, as there are particularly bad artifacts, making it difficult to read the text.

Please enable the full log, and 1ms timestamps, and capture sip set debug on output for the call and include it inline. You may also need debug and verbose level 5 settings.

Also please identify the type of remote system and please include the sip.conf settings.

We enabled full log, with milliseconds timestamp, sip debug and verbose and debug to level 5.

The call starts from a softphone (linphone) on 10.245.8.16, through asterisk (10.245.8.12) reaches the cisco call manager (10.120.4.10) that answers and pauses the call.

When the phone registered on the cisco call manager (10.120.2.31) takes the call, the cisco call manager resumes the call and asterisk receives a SIP ACK with an SDP including the new media address (c=IN IP4 10.120.2.31, timestamp 15:13:11.282).

Only 1 second and half later, the SDP with the new media address is sent to the linphone (c=IN IP4 10.120.2.31, timestamp 15:13:12.883).

It happens that sometimes this delay is up to 5 seconds.

Here’s the relevant part of the log:

[code][2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282]
<— SIP read from UDP:10.120.4.10:5060 —>
ACK sip:11130154031031@10.245.8.12:5060 SIP/2.0
Via: SIP/2.0/UDP 10.120.4.10:5060;branch=z9hG4bK10191bd0bb
From: sip:110010301@10.120.4.10;tag=8764~8fa62566-e1be-407f-a988-17cf779f66b8-29553229
To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=as174fdd0b
Date: Mon, 04 Mar 2013 14:13:09 GMT
Call-ID: 44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060
Max-Forwards: 70
CSeq: 103 ACK
Allow-Events: presence
Content-Type: application/sdp
Content-Length: 154

v=0
o=CiscoSystemsCCM-SIP 8764 5 IN IP4 10.120.4.10
s=SIP Call
c=IN IP4 10.120.2.31
t=0 0
m=audio 21382 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
<------------->
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 0 [ 47]: ACK sip:11130154031031@10.245.8.12:5060 SIP/2.0
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 1 [ 58]: Via: SIP/2.0/UDP 10.120.4.10:5060;branch=z9hG4bK10191bd0bb
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 2 [ 88]: From: sip:110010301@10.120.4.10;tag=8764~8fa62566-e1be-407f-a988-17cf779f66b8-29553229
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 3 [ 67]: To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=as174fdd0b
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 4 [ 35]: Date: Mon, 04 Mar 2013 14:13:09 GMT
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 5 [ 58]: Call-ID: 44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 6 [ 16]: Max-Forwards: 70
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 7 [ 13]: CSeq: 103 ACK
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 8 [ 22]: Allow-Events: presence
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 9 [ 29]: Content-Type: application/sdp
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 10 [ 19]: Content-Length: 154
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Header 11 [ 0]:
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 0 [ 3]: v=0
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 1 [ 47]: o=CiscoSystemsCCM-SIP 8764 5 IN IP4 10.120.4.10
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 2 [ 10]: s=SIP Call
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 3 [ 20]: c=IN IP4 10.120.2.31
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 4 [ 5]: t=0 0
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 5 [ 23]: m=audio 21382 RTP/AVP 0
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 6 [ 20]: a=rtpmap:0 PCMU/8000
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Body 7 [ 10]: a=ptime:20
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] — (11 headers 8 lines) —
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: = Looking for Call ID: 44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060 (Checking From) --From tag 8764~8fa62566-e1be-407f-a988-17cf779f66b8-29553229 --To-tag as174fdd0b
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: **** Received ACK (6) - Command in SIP ACK
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: ** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #161
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Stopping retransmission on ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ of Response 103: Match Found
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing session-level SDP v=0… UNSUPPORTED.
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing session-level SDP o=CiscoSystemsCCM-SIP 8764 5 IN IP4 10.120.4.10… UNSUPPORTED.
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing session-level SDP s=SIP Call… UNSUPPORTED.
[2013-03-04 15:13:11.282] DEBUG[19988] netsock2.c: Splitting ‘10.120.2.31’ into…
[2013-03-04 15:13:11.282] DEBUG[19988] netsock2.c: …host ‘10.120.2.31’ and port ‘’.
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing session-level SDP c=IN IP4 10.120.2.31… OK.
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing session-level SDP t=0 0… UNSUPPORTED.
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] Found RTP audio format 0
[2013-03-04 15:13:11.282] DEBUG[19988] rtp_engine.c: Setting payload 0 based on m type on 0x7f259e541db0
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] Found audio description format PCMU for ID 0
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing media-level (audio) SDP a=rtpmap:0 PCMU/8000… OK.
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Processing media-level (audio) SDP a=ptime:20… OK.
[2013-03-04 15:13:11.282] DEBUG[19988] rtp_engine.c: Incorporating payload 0 on 0x7f259e541db0
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] Capabilities: us - 0x4 (ulaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
[2013-03-04 15:13:11.282] DEBUG[19988] res_rtp_asterisk.c: Setting RTCP address on RTP instance ‘0x7f2568003688’
[2013-03-04 15:13:11.282] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.282] Peer audio RTP is at port 10.120.2.31:21382
[2013-03-04 15:13:11.282] DEBUG[19988] rtp_engine.c: Copying payload 0 from 0x7f259e541db0 to 0x7f2568003850
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: We’re settling with these formats: 0x4 (ulaw)
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: We have an owner, now see if we need to change this call
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘378622661’ Method: ACK
[2013-03-04 15:13:11.282] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ Method: ACK
[2013-03-04 15:13:11.668] DEBUG[19988] chan_sip.c: SIP TIMER: Not rescheduling id #156:OPTIONS (Method 3) (No timer T1)
[2013-03-04 15:13:11.668] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.668] Retransmitting #4 (no NAT) to 10.245.8.49:5060:
OPTIONS sip:7701@10.245.8.49:5060 SIP/2.0
Via: SIP/2.0/UDP 10.245.8.12:5060;branch=z9hG4bK40dc677a
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.245.8.12;tag=as609de6cf
To: sip:7701@10.245.8.49:5060
Contact: sip:asterisk@10.245.8.12:5060
Call-ID: 41c8f99655b923d934dac057418c17a5@10.245.8.12:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.7.1
Date: Mon, 04 Mar 2013 14:13:07 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


[2013-03-04 15:13:11.668] DEBUG[19988] chan_sip.c: Trying to put ‘OPTIONS sip’ onto UDP socket destined for 10.245.8.49:5060
[2013-03-04 15:13:11.668] DEBUG[19988] chan_sip.c: Destroying SIP dialog 41c8f99655b923d934dac057418c17a5@10.245.8.12:5060
[2013-03-04 15:13:11.668] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:11.668] Really destroying SIP dialog ‘41c8f99655b923d934dac057418c17a5@10.245.8.12:5060’ Method: OPTIONS
[2013-03-04 15:13:11.668] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘378622661’ Method: ACK
[2013-03-04 15:13:11.668] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ Method: ACK
[2013-03-04 15:13:12.669] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘378622661’ Method: ACK
[2013-03-04 15:13:12.669] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ Method: ACK
[2013-03-04 15:13:12.882] DEBUG[30772] res_rtp_asterisk.c: Got RTCP report of 112 bytes
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ changed end address to 10.120.2.31:21382 (format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ changed end vaddress to (null) (format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ changed end taddress to (null) (format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ was (null)/(format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ was (null)/(format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] rtp_engine.c: Oooh, ‘SIP/CiscoCallManager-00000001’ was (null)/(format ulaw)
[2013-03-04 15:13:12.882] DEBUG[30772] chan_sip.c: Sending reinvite on SIP ‘378622661’ - It’s audio soon redirected to IP 10.120.2.31:21382
[2013-03-04 15:13:12.882] DEBUG[30772] chan_sip.c: Strict routing enforced for session 378622661
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] set_destination: Parsing sip:toto@10.245.8.16 for address/port to send to
[2013-03-04 15:13:12.883] DEBUG[30772] netsock2.c: Splitting ‘10.245.8.16’ into…
[2013-03-04 15:13:12.883] DEBUG[30772] netsock2.c: …host ‘10.245.8.16’ and port ‘’.
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] set_destination: set destination to 10.245.8.16:5060
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: ** Our capability: 0xc (ulaw|alaw) Video flag: True Text flag: True
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: ** Our prefcodec: 0x0 (nothing)
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: ** Our native-bridge filtered capablity: 0x4 (ulaw)
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] Audio is at 5060
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] Adding codec 0x4 (ulaw) to SDP
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] Adding non-codec 0x1 (telephone-event) to SDP
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: – Done with adding codecs to SDP
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Done building SDP. Settling with this capability: 0x4 (ulaw)
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Initializing already initialized SIP dialog 378622661 (presumably reinvite)
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 0 [ 35]: INVITE sip:toto@10.245.8.16 SIP/2.0
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 1 [ 62]: Via: SIP/2.0/UDP 10.245.8.12:5060;branch=z9hG4bK0e61eb2f;rport
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 2 [ 16]: Max-Forwards: 70
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 3 [ 54]: From: “POU” sip:110010301@10.245.8.12;tag=as27a0f010
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 4 [ 66]: To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=423554740
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 5 [ 41]: Contact: sip:110010301@10.245.8.12:5060
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 6 [ 18]: Call-ID: 378622661
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 7 [ 16]: CSeq: 103 INVITE
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 8 [ 32]: User-Agent: Asterisk PBX 1.8.7.1
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 9 [ 81]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 10 [ 26]: Supported: replaces, timer
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 11 [ 52]: X-asterisk-Info: SIP re-invite (External RTP bridge)
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Header 12 [ 29]: Content-Type: application/sdp
[2013-03-04 15:13:12.883] VERBOSE[30772] chan_sip.c: [2013-03-04 15:13:12.883] Reliably Transmitting (no NAT) to 10.245.8.16:5060:
INVITE sip:toto@10.245.8.16 SIP/2.0
Via: SIP/2.0/UDP 10.245.8.12:5060;branch=z9hG4bK0e61eb2f;rport
Max-Forwards: 70
From: “POU” sip:110010301@10.245.8.12;tag=as27a0f010
To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=423554740
Contact: sip:110010301@10.245.8.12:5060
Call-ID: 378622661
CSeq: 103 INVITE
User-Agent: Asterisk PBX 1.8.7.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 261

v=0
o=root 1332572859 1332572861 IN IP4 10.120.2.31
s=Asterisk PBX 1.8.7.1
c=IN IP4 10.120.2.31
t=0 0
m=audio 21382 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: *** SIP TIMER: Initializing retransmit timer on packet: Id #163
[2013-03-04 15:13:12.883] DEBUG[30772] chan_sip.c: Trying to put ‘INVITE sip:’ onto UDP socket destined for 10.245.8.16:5060
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘378622661’ Method: ACK
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ Method: ACK
[2013-03-04 15:13:12.883] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:12.883]
<— SIP read from UDP:10.245.8.16:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.245.8.12:5060;branch=z9hG4bK0e61eb2f;rport=5060
From: “POU” sip:110010301@10.245.8.12;tag=as27a0f010
To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=423554740
Call-ID: 378622661
CSeq: 103 INVITE
User-Agent: Linphone/3.5.2 (eXosip2/3.6.0)
Content-Length: 0

<------------->
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 0 [ 18]: SIP/2.0 100 Trying
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 1 [ 67]: Via: SIP/2.0/UDP 10.245.8.12:5060;branch=z9hG4bK0e61eb2f;rport=5060
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 2 [ 54]: From: “POU” sip:110010301@10.245.8.12;tag=as27a0f010
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 3 [ 66]: To: “Emerg.Interf.” sip:11130154031031@10.245.8.12;tag=423554740
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 4 [ 18]: Call-ID: 378622661
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 5 [ 16]: CSeq: 103 INVITE
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 6 [ 42]: User-Agent: Linphone/3.5.2 (eXosip2/3.6.0)
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Header 7 [ 17]: Content-Length: 0
[2013-03-04 15:13:12.883] VERBOSE[19988] chan_sip.c: [2013-03-04 15:13:12.883] — (8 headers 0 lines) —
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: = Looking for Call ID: 378622661 (Checking To) --From tag as27a0f010 --To-tag 423554740
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: *** SIP TIMER: Cancelling retransmission #163 - INVITE (got response)
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on ‘378622661’ Request 103: Found
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: SIP response 100 to RE-invite on outgoing call 378622661
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘378622661’ Method: ACK
[2013-03-04 15:13:12.883] DEBUG[19988] chan_sip.c: Bridge still active. Delaying destroy of SIP dialog ‘44f9c052047f3ec9357eea83392b0987@10.245.8.12:5060’ Method: ACK[/code]

I’ll post the sip.conf later since it exceeds the maximum number of characters.

Here’s the sip.conf, I removed some commented lines to enter the maximum characters limit:


[general]
context=default                 ; Default context for incoming calls

allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)

udpbindaddr=10.245.8.12             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
                                ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)

tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
                                ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)

srvlookup=no                    ; Enable DNS SRV lookups on outbound calls
                                ; Note: Asterisk only uses the first host
                                ; in SRV records
                                ; Disabling DNS SRV lookups disables the
                                ; ability to place SIP calls based on domain
                                ; names to some other SIP users on the Internet
                                ; Specifying a port in a SIP peer definition or
                                ; when dialing outbound calls will supress SRV
                                ; lookups for that peer or call.






buggymwi=yes                    ; Cisco SIP firmware doesn't support the MWI RFC
                                ; fully. Enable this option to not get error messages
                                ; when sending MWI to phones with this bug.


use_q850_reason = yes ; Default "no"
                      ; Set to yes add Reason header and use Reason header if it is available.

;--------------------------- SIP DEBUGGING ---------------------------------------------------
sipdebug = yes                 ; Turn on SIP debugging by default, from
                                ; the moment the channel loads this configuration

[authentication]


[basic-options](!)                ; a template
        dtmfmode=rfc2833
        context=from-office
        type=friend

[natted-phone](!,basic-options)   ; another template inheriting basic-options
        nat=yes
        directmedia=no
        host=dynamic

[public-phone](!,basic-options)   ; another template inheriting basic-options
        nat=no
        directmedia=yes

[my-codecs](!)                    ; a template for my preferred codecs
        disallow=all
        allow=ilbc
        allow=g729
        allow=gsm
        allow=g723
        allow=ulaw

[ulaw-phone](!)                   ; and another one for ulaw-only
        disallow=all
        allow=ulaw

; and finally instantiate a few phones
;
; [2133](natted-phone,my-codecs)
;        secret = peekaboo
; [2134](natted-phone,ulaw-phone)
;        secret = not_very_secret
; [2136](public-phone,ulaw-phone)
;        secret = not_very_secret_either
; ...
;

; Standard configurations not using templates look like this:
;
;[grandstream1]
;type=friend
;context=from-sip                ; Where to start in the dialplan when this phone calls
;callerid=John Doe <1234>        ; Full caller ID, to override the phones config
                                 ; on incoming calls to Asterisk
;host=192.168.0.23               ; we have a static but private IP address
                                 ; No registration allowed
;nat=no                          ; there is not NAT between phone and Asterisk
;directmedia=yes                 ; allow RTP voice traffic to bypass Asterisk
;dtmfmode=info                   ; either RFC2833 or INFO for the BudgeTone
;call-limit=1                    ; permit only 1 outgoing call and 1 incoming call at a time
                                 ; from the phone to asterisk (deprecated)
                                 ; 1 for the explicit peer, 1 for the explicit user,
                                 ; remember that a friend equals 1 peer and 1 user in
                                 ; memory
                                 ; There is no combined call counter for a "friend"
                                 ; so there's currently no way in sip.conf to limit
                                 ; to one inbound or outbound call per phone. Use
                                 ; the group counters in the dial plan for that.
                                 ;
;mailbox=1234@default            ; mailbox 1234 in voicemail context "default"
;disallow=all                    ; need to disallow=all before we can use allow=
;allow=ulaw                      ; Note: In user sections the order of codecs
                                 ; listed with allow= does NOT matter!
;allow=alaw
;allow=g723.1                    ; Asterisk only supports g723.1 pass-thru!
;allow=g729                      ; Pass-thru only unless g729 license obtained
;callingpres=allowed_passed_screen ; Set caller ID presentation
                                 ; See README.callingpres for more information

;[xlite1]
; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
;type=friend
;regexten=1234                   ; When they register, create extension 1234
;callerid="Jane Smith" <5678>
;host=dynamic                    ; This device needs to register
;nat=yes                         ; X-Lite is behind a NAT router
;directmedia=no                  ; Typically set to NO if behind NAT
;disallow=all
;allow=gsm                       ; GSM consumes far less bandwidth than ulaw
;allow=ulaw
;allow=alaw
;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes
;registertrying=yes              ; Send a 100 Trying when the device registers.

;[snom]
;type=friend                     ; Friends place calls and receive calls
;context=from-sip                ; Context for incoming calls from this user
;secret=blah
;subscribecontext=localextensions ; Only allow SUBSCRIBE for local extensions
;language=de                     ; Use German prompts for this user
;host=dynamic                    ; This peer register with us
;dtmfmode=inband                 ; Choices are inband, rfc2833, or info
;defaultip=192.168.0.59          ; IP used until peer registers
;mailbox=1234@context,2345       ; Mailbox(-es) for message waiting indicator
;subscribemwi=yes                ; Only send notifications if this phone
                                 ; subscribes for mailbox notification
;vmexten=voicemail               ; dialplan extension to reach mailbox
                                 ; sets the Message-Account in the MWI notify message
                                 ; defaults to global vmexten which defaults to "asterisk"
;disallow=all
;allow=ulaw                      ; dtmfmode=inband only works with ulaw or alaw!


;[polycom]
;type=friend                     ; Friends place calls and receive calls
;context=from-sip                ; Context for incoming calls from this user
;secret=blahpoly
;host=dynamic                    ; This peer register with us
;dtmfmode=rfc2833                ; Choices are inband, rfc2833, or info
;defaultuser=polly               ; Username to use in INVITE until peer registers
;defaultip=192.168.40.123
                                 ; Normally you do NOT need to set this parameter
;disallow=all
;allow=ulaw                      ; dtmfmode=inband only works with ulaw or alaw!
;progressinband=no               ; Polycom phones don't work properly with "never"


;[pingtel]
;type=friend
;secret=blah
;host=dynamic
;insecure=port                   ; Allow matching of peer by IP address without
                                 ; matching port number
;insecure=invite                 ; Do not require authentication of incoming INVITEs
;insecure=port,invite            ; (both)
;qualify=1000                    ; Consider it down if it's 1 second to reply
                                 ; Helps with NAT session
                                 ; qualify=yes uses default value
;qualifyfreq=60                  ; Qualification: How often to check for the
                                 ; host to be up in seconds
                                 ; Set to low value if you use low timeout for
                                 ; NAT of UDP sessions
;
; Call group and Pickup group should be in the range from 0 to 63
;
;callgroup=1,3-4                 ; We are in caller groups 1,3,4
;pickupgroup=1,3-5               ; We can do call pick-p for call group 1,3,4,5
;defaultip=192.168.0.60          ; IP address to use if peer has not registered
;deny=0.0.0.0/0.0.0.0            ; ACL: Control access to this account based on IP address
;permit=192.168.0.60/255.255.255.0
;permit=192.168.0.60/24          ; we can also use CIDR notation for subnet masks
;permit=2001:db8::/32            ; IPv6 ACLs can be specified if desired. IPv6 ACLs
                                 ; apply only to IPv6 addresses, and IPv4 ACLs apply
                                 ; only to IPv4 addresses.

;[cisco1]
;type=friend
;secret=blah
;qualify=200                     ; Qualify peer is no more than 200ms away
;nat=yes                         ; This phone may be natted
                                 ; Send SIP and RTP to the IP address that packet is
                                 ; received from instead of trusting SIP headers
;host=dynamic                    ; This device registers with us
;directmedia=no                  ; Asterisk by default tries to redirect the
                                 ; RTP media stream (audio) to go directly from
                                 ; the caller to the callee.  Some devices do not
                                 ; support this (especially if one of them is
                                 ; behind a NAT).
;defaultip=192.168.0.4           ; IP address to use until registration
;defaultuser=goran               ; Username to use when calling this device before registration
                                 ; Normally you do NOT need to set this parameter
;setvar=CUSTID=5678              ; Channel variable to be set for all calls from or to this device
;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep   ; This channel variable will
                                                ; cause the given audio file to
                                                ; be played upon completion of
                                                ; an attended transfer.

;[pre14-asterisk]
;type=friend
;secret=digium
;host=dynamic
;rfc2833compensate=yes          ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
                                ; You must have this turned on or DTMF reception will work improperly.
;t38pt_usertpsource=yes         ; Use the source IP address of RTP as the destination IP address for UDPTL packets
                                ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
                                ; external IP address of the remote device. If port forwarding is done at the client side
                                ; then UDPTL will flow to the remote device.

; Trunk verso la Sala Operativa

[CiscoCallManager]
type=friend
defaultuser=CiscoCallManager
qualify=yes
host=10.120.4.10
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[CiscoCallManagerBis]
type=friend
defaultuser=CiscoCallManagerBis
qualify=yes
host=10.120.4.20
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

; Posto Operatori di Backup

[7701]
type=friend
defaultuser=7701
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7702]
type=friend
defaultuser=7702
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7703]
type=friend
defaultuser=7703
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7704]
type=friend
defaultuser=7704
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7705]
type=friend
defaultuser=7705
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7706]
type=friend
defaultuser=7706
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7707]
type=friend
defaultuser=7707
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7708]
type=friend
defaultuser=7708
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

[7709]
type=friend
defaultuser=7709
qualify=yes
host=dynamic
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw

; Server di Linea

[ServerLinea1]
type=friend
defaultuser=ServerLinea1
qualify=no
host=10.245.8.15
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea1A]
type=friend
defaultuser=ServerLinea1
qualify=no
host=10.245.8.16
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea1B]
type=friend
defaultuser=ServerLinea1
qualify=no
host=10.245.8.17
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea2]
type=friend
defaultuser=ServerLinea2
qualify=no
host=10.245.8.18
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea2A]
type=friend
defaultuser=ServerLinea2
qualify=no
host=10.245.8.19
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea2B]
type=friend
defaultuser=ServerLinea2
qualify=no
host=10.245.8.20
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea3]
type=friend
defaultuser=ServerLinea3
qualify=no
host=10.245.8.21
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea3A]
type=friend
defaultuser=ServerLinea3
qualify=no
host=10.245.8.22
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

[ServerLinea3B]
type=friend
defaultuser=ServerLinea3
qualify=no
host=10.245.8.23
context=crtt
nat=no
directmedia=yes
disallow=all
allow=ulaw
allow=alaw

Many thanks for the help. Bye,
Giuseppe.

This may or may not help you, but it looks like no media has gone through for that call, after the incoming late offer, so what I guess i the bridge thread does not get scheduled until the next RTCP packet arrives, and doesn’t send the re-invite until then.

As I seem to remember that RTCP follows the same path as RTP, that suggests you are getting no RTP.

If it is the bridge thread, it ought be woken by media from the B party, so I wonder if that is also silent. In any case Asterisk should be relaying any media from B, to the updated address from A.

OK. The graph makes more sense now.

It looks like these are both re-invites.

It also looks like your leftmost entity has switched its RTP destination to match that of the incoming RTP stream, from the Cisco, without being told to do so. This may be some sort of NAT defensive strategy. As a result, Asterisk is not getting any media from it when, according to what it negotiated with the device, it should be. That means it never gets the event that wakes up the bridge thread to formally tell it that it should be sending media to where it is already sending it.

I’m not sure why you manage to receive an RTCP packet, to un-jam things.

Thank you.
Our need is to receive the media address change immediately to the end phone (linphone).
It seems that, since the linphone receives the RTP from the new address before receiving the new SDP from asterisk, we have to catch the media address change directly from the linphone.
Bye,
Giuseppe.