[asterisk-users] CSeq reset on re-INVITE

David Cunningham dcunningham at voisonics.com
Sun Oct 30 14:59:21 CDT 2022


Hi Joshua,

Thanks very much. I presume this is the relevant part:
"strictly monotonically increasing and contiguous CSeq sequence numbers
(increasing-by-one) in each direction"

In that case I wonder what could be causing the 404 Not Found error. I've
attached the relevant SIP packets from the Asterisk log. Can anyone see an
issue that would cause the error?

Thanks in advance.


On Sat, 29 Oct 2022 at 12:03, Joshua C. Colp <jcolp at sangoma.com> wrote:

> On Fri, Oct 28, 2022 at 6:28 PM David Cunningham <
> dcunningham at voisonics.com> wrote:
>
>> Hello,
>>
>> We have a problem where Asterisk is resetting the CSeq on a re-INVITE,
>> and the phone receiving the re-INVITE is rejecting it, probably as a result
>> of that. Would anyone be able to offer any insight please?
>>
>> The scenario is:
>>
>> Phone A makes call 1 to Asterisk which dials call 2 to phone B, which
>> answers the call.
>>
>> Phone B puts call 1 on hold, makes call 3 to Asterisk which dials call 4
>> to phone C, which answers the call.
>>
>> Phone B does an attended REFER transfer of call 2 to call 3, taking
>> itself out of the call. Asterisk bridges the remaining calls, so phones A
>> and C are now talking to each other.
>>
>> Asterisk sends a re-INVITE to phone A with a P-Asserted-Identity, to tell
>> phone A the updated details of phone C that it's talking to. However phone
>> A rejects the re-INVITE with a "404 Not found" error.
>>
>> The only explanation I can see for the "404 Not found" error is that call
>> 1 was set up with "CSeq: 954698786 INVITE", whereas the re-INVITE Asterisk
>> sends with the P-Asserted-Identity has "CSeq: 102 INVITE". Why is Asterisk
>> resetting the CSeq on the re-INVITE, and doesn't this appear to be
>> incorrect?
>>
>
> It's not incorrect. Each direction has its own CSeq[1]. From Phone A to
> Asterisk can be 954698786 and from Asterisk to Phone A can be 102.
>
> [1] https://www.rfc-editor.org/rfc/rfc3261#section-12.2.1.1
>
> --
> Joshua C. Colp
> Asterisk Project Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



-- 
David Cunningham, Voisonics Limited
http://voisonics.com/
USA: +1 213 221 1092
New Zealand: +64 (0)28 2558 3782
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20221031/83a9daac/attachment.html>
-------------- next part --------------

ORIGINAL CALL PHONE A TO ASTERISK:

[Oct 27 16:17:43] VERBOSE[2051] chan_sip.c: 
<--- SIP read from UDP:111.111.52.208:5060 --->
INVITE sip:222222 at 111.111.52.201:5060;transport=udp SIP/2.0
Record-Route: <sip:111.111.52.208;lr=on>
Via: SIP/2.0/UDP 111.111.52.208;branch=z9hG4bK2d9a.a2b48027e41283fbb0d79a59edd6d1ef.0
Via: SIP/2.0/UDP 222.222.127.193:5060;rport=5060;branch=z9hG4bK4ee82f350717c20f6
Proxy-Authorization: Digest username="111111",realm="example.com",nonce="Y1oVo2NaFHcQ7EwgMuEk3/LGyhpkbC8t",uri="sip:222222 at example.com:5060;user=phone",response="636c2526a687a35d2683951d0be695d4"
Max-Forwards: 69
From: "111111" <sip:111111 at example.com:5060>;tag=8048438a0b
To: <sip:222222 at example.com:5060;user=phone>
Call-ID: 99eab43e2d6c6a20
CSeq: 954698786 INVITE


ASTERISK SENDS CALL TO PHONE B:

[Oct 27 16:17:43] VERBOSE[1205][C-002558c4] chan_sip.c: Reliably Transmitting (NAT) to 111.111.52.208:5060:
INVITE sip:222222 at 111.111.52.208:5060 SIP/2.0
Via: SIP/2.0/UDP 111.111.52.201:5060;branch=z9hG4bK39357a26;rport
Max-Forwards: 70
From: "111111" <sip:111111 at 111.111.52.201>;tag=as3569276f
To: <sip:222222 at 111.111.52.208:5060>
Contact: <sip:111111 at 111.111.52.201:5060>
Call-ID: 407ff6cd243025df68a25415741bb5a0 at 111.111.52.201:5060


PHONE B CREATES NEW CALL TO PHONE C:

[Oct 27 16:17:51] VERBOSE[2051] chan_sip.c: 
<--- SIP read from UDP:111.111.52.208:5060 --->
INVITE sip:333333 at 111.111.52.201:5060;transport=udp SIP/2.0
Record-Route: <sip:111.111.52.208;lr=on;enat=yes>
Via: SIP/2.0/UDP 111.111.52.208;branch=z9hG4bKa1b8.04fe0a3c5e61a15fa889b1d3c087e21d.0
Via: SIP/2.0/UDP 10.10.10.112;rport=60608;received=333.333.96.250;branch=z9hG4bK9bfc44c3c33f64f74
Proxy-Authorization: Digest username="222222",realm="example.com",nonce="Y1oVq2NaFH+v2ge8RzGSe6aI+Y1BIOQ/",uri="sip:333333 at example.com:5060;user=phone",response="571b389bf09d3bc6fb3d042720435923"
Max-Forwards: 69
From: "User User" <sip:222222 at example.com:5060>;tag=ec8ebeab1f
To: <sip:333333 at example.com:5060;user=phone>
Call-ID: 84fb5d56a369394a
CSeq: 1053485297 INVITE


PHONE B REFERS FIRST CALL TO SECOND:

[Oct 27 16:17:58] VERBOSE[2051] chan_sip.c: 
<--- SIP read from UDP:111.111.52.208:5060 --->
REFER sip:111111 at 111.111.52.201:5060 SIP/2.0
Via: SIP/2.0/UDP 111.111.52.208;branch=z9hG4bK6c56.0b2da5a10fa953dd3d343d71848a6f81.0
Via: SIP/2.0/UDP 10.10.10.112;rport=60608;received=333.333.96.250;branch=z9hG4bK5d81e9ca437b68a91
Max-Forwards: 69
From: <sip:222222 at 111.111.52.208:5060>;tag=1841802195
To: "111111" <sip:111111 at 111.111.52.201>;tag=as3569276f
Call-ID: 407ff6cd243025df68a25415741bb5a0 at 111.111.52.201:5060
CSeq: 827299867 REFER
Accept-Language: en
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO, PUBLISH
Allow-Events: aastra-xml, vdp-session, talk, hold, conference, LocalModeStatus
Contact: <sip:222222 at example.com;gr=urn:uuid:00000000-0000-1000-8000-08000FB1971C;alias=333.333.96.250~60608~1>
Refer-To: <sip:333333 at example.com:5060;user=phone?Replaces=84fb5d56a369394a%3bto-tag%3das18a53842%3bfrom-tag%3dec8ebeab1f>
Referred-By: <sip:222222 at example.com>

[Oct 27 16:17:58] VERBOSE[2051][C-002558c4] chan_sip.c: 
<--- Transmitting (NAT) to 111.111.52.208:5060 --->
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP 111.111.52.208;branch=z9hG4bK6c56.0b2da5a10fa953dd3d343d71848a6f81.0;received=111.111.52.208;rport=5060
Via: SIP/2.0/UDP 10.10.10.112;rport=60608;received=333.333.96.250;branch=z9hG4bK5d81e9ca437b68a91
From: <sip:222222 at 111.111.52.208:5060>;tag=1841802195
To: "111111" <sip:111111 at 111.111.52.201>;tag=as3569276f
Call-ID: 407ff6cd243025df68a25415741bb5a0 at 111.111.52.201:5060
CSeq: 827299867 REFER


CALL TO PHONE B HANGS UP AFTER IT HAS TRANSFERRED CALL AWAY:

[Oct 27 16:17:58] VERBOSE[2051] chan_sip.c: 
<--- SIP read from UDP:111.111.52.208:5060 --->
BYE sip:111111 at 111.111.52.201:5060 SIP/2.0
Via: SIP/2.0/UDP 111.111.52.208;branch=z9hG4bK4d56.b478685be88bb2085f2c0a828bda5245.0
Via: SIP/2.0/UDP 10.10.10.112;rport=60608;received=333.333.96.250;branch=z9hG4bK2f51e1580e918c15b
Max-Forwards: 69
From: <sip:222222 at 111.111.52.208:5060>;tag=1841802195
To: "111111" <sip:111111 at 111.111.52.201>;tag=as3569276f
Call-ID: 407ff6cd243025df68a25415741bb5a0 at 111.111.52.201:5060
CSeq: 827299868 BYE


ASTERISK SENDS RE-INVITE TO PHONE A WITH NEW REMOTE PARTY DETAILS IN P-Asserted-Identity:

[Oct 27 16:17:58] VERBOSE[1194][C-002558c4] chan_sip.c: Reliably Transmitting (NAT) to 111.111.52.208:5060:
INVITE sip:111111 at example.com;gr=urn:uuid:00000000-0000-1000-8000-08000FD54867 SIP/2.0
Via: SIP/2.0/UDP 111.111.52.201:5060;branch=z9hG4bK0cc6df1e;rport
Route: <sip:111.111.52.208;lr=on>
Max-Forwards: 70
From: <sip:222222 at example.com:5060;user=phone>;tag=as6b77dd09
To: "111111" <sip:111111 at example.com:5060>;tag=8048438a0b
Contact: <sip:222222 at 111.111.52.201:5060>
Call-ID: 99eab43e2d6c6a20
CSeq: 102 INVITE
User-Agent: ConnectTel
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
P-Asserted-Identity: "User User" <sip:222222 at example.com>
Content-Type: application/sdp
Content-Length: 254


PHONE A RETURNS AN ERROR:

[Oct 27 16:17:58] VERBOSE[2051] chan_sip.c: 
<--- SIP read from UDP:111.111.52.208:5060 --->
SIP/2.0 404 Not found
Via: SIP/2.0/UDP 111.111.52.201:5060;received=111.111.52.201;branch=z9hG4bK0cc6df1e;rport=5060
From: <sip:222222 at example.com:5060;user=phone>;tag=as6b77dd09
To: "111111" <sip:111111 at example.com:5060>;tag=8048438a0b
Call-ID: 99eab43e2d6c6a20
CSeq: 102 INVITE
Server: Mitel Border GW/4.10.0.169-01
Content-Length: 0





More information about the asterisk-users mailing list