[Home]

Summary:ASTERISK-24913: CLONE - missing Contact header in 200 OK to INVITE
Reporter:Etienne Allovon (etienne_pf)Labels:
Date Opened:2015-03-26 07:54:24Date Closed:2015-03-26 08:00:21
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:11.16.0 Frequency of
Occurrence
Related
Issues:
is the original version of this clone:ASTERISK-17258 missing Contact header in 200 OK to INVITE
Environment:Attachments:( 0) full
( 1) missing_contact.pcap
Description:*Original description*
Several users of our softphone report a bug, that Asterisk 1.6.x does not always send Contact: header in response to our INVITE.

The Contact arrives in 100 Trying, but not in 183 Session Progress nor 200 OK.

We suspect is has something to do with 401 Unauthorized response to the initial INVITE.

If there's no lag and the session goes like INVITE, 401 Unauthorized, ACK, INVITE, 100 Trying, 183 Session Progress, 200 OK, everything is fine.

However we sometimes introduce a delay during the early stage and the session starts like this:
{code}
> INVITE (CSeq 1)
< 401 Unauthorized (CSeq 1)
> ACK (CSeq 1)
> INVITE (CSeq 2)
< 401 Unauthorized (CSeq 1)
> ACK (CSeq 1)
< 100 Trying (CSeq 2)   ..... contains Contact:
< 183 Session Progress  .. no Contact:
< 200 OK .. no Contact:
{code}
we then report error as our SIP stack is unable to continue.


*Additionnal information*

In production it mainly occurs when you have asymetric latency between two SIP endpoints (for example two asterisk).

It occurs with version 1.8.x and 11.x of asterisk.

*How to reproduce*
Below is a SIP exchange forged with SIPp which reproduce the problem :

asterisk :
{{< INVITE            (CSeq 1)}}
{{> 401 Unauthorized  (CSeq 1)}}
{{< ACK               (CSeq 1)}}
{{< INVITE            (CSeq 2)}}
{{> 100 Trying        (CSeq 2) ..... contains Contact: header}}
{{> 180 Ringing       (CSeq 2) ..... contains Contact: header}}
{{< ACK               (Cseq *1*)}}
{{> 200 OK            (Cseq 2) ..... does not contain Contact: header}}

The bug appears at step #7.
Asterisk seems to handle the spurious ACK correctly since you find the following DEBUG message :
{code}
DEBUG[26739] chan_sip.c: **** Received ACK (6) - Command in SIP ACK
DEBUG[26739] chan_sip.c: Ignoring too old SIP packet packet 1 (expecting >= 2)
DEBUG[26739] chan_sip.c: SIP message could not be handled, bad request: 261113e445fb3f8777068f5513a8d61f@10.14.12.1:5060
{code}

Here's the SIPp command to launch the scenario :
{code}
/usr/src/sipp-3.3/sipp 192.168.18.55 -sf REGISTER_INVITE_client.xml -inf REGISTER_INVITE_client.csv -i 192.168.18.11 -m 1 -l 1 -r 1
{code}

You need to :

* replace 192.168.18.65 with you asterisk server IP,
* replace 192.168.18.11 with the SIPp client IP
* get the REGISTER_INVITE_client.xml file,
* get the REGISTER_INVITE_client.csv file and change the authentication information


*References*
SIPp scenarios based on examples found here : http://tomeko.net/other/sipp/sipp_cheatsheet.php?lang
Comments:By: Joshua C. Colp (jcolp) 2015-03-26 08:00:21.452-0500

Please don't clone issues like this. If you are encountering the same issue on a supported version of Asterisk create a new issue with details.

By: Etienne Allovon (etienne_pf) 2015-03-26 08:24:14.277-0500

ok i opened #ASTERISK-24915