Summary:ASTERISK-17258: missing Contact header in 200 OK to INVITE
Reporter:Stanislav Kutil (mammal)Labels:
Date Opened:2011-01-17 07:26:01.000-0600Date Closed:2012-10-17 08:59:43
Versions:Frequency of
is a clone ofASTERISK-24913 CLONE - missing Contact header in 200 OK to INVITE
is related toASTERISK-24915 [patch]Missing Contact: header in 200 OK
Environment:Attachments:( 0) full
( 1) missing_contact.pcap
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:

> 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:

we then report error as our SIP stack is unable to continue.


we are unsure of the exact version... I can confirm it in version 1.6.12
here's a report from a customer:

I upgraded this server from to this morning to do some further testing and now most calls are going through.  Instead of every other call origination, it is now about 9 of 10 originations are successful.
Comments:By: Leif Madsen (lmadsen) 2011-01-17 09:07:22.000-0600

It would be best to provide the traces and SIP history of these calls when this happens. Per the bug guidelines for submitting SIP related issues, you need to provide the trace information from the Asterisk console along with the dialplan and scenario information to make it easy to reproduce.

By: Stanislav Kutil (mammal) 2011-01-17 16:37:16.000-0600

I installed asterisk on our testing box. The bug is reproducible 100% if we delay our ACK to 401 Unauthorized a bit.

I attach the wireshark trace. There's nothing fancy on the asterisk console... only error message that we do not respond to asterisk critical packet (OK) which is just a consequence... we give up once we receive OK with no Contact:

dialplan is really simple...

exten => 666,1,Ringing()
exten => 666,n,Wait(1)
exten => 666,n,Answer()
exten => 666,n,Playback(welcome)
exten => 666,n(intro),WaitExten(15,m)
exten => 666,n,Goto(intro)

By: Stanislav Kutil (mammal) 2011-01-23 16:42:26.000-0600

I added a full asterisk trace as well. Please note that listening port has changed and also we now accept Contact-less 200 OK, so the 'missing_contact.pcap' and 'full' are not from the same client/server.

By: Matt Jordan (mjordan) 2012-09-05 08:52:49.063-0500

A number of changes have gone into chan_sip since the issue was reported.  Can you confirm if this problem still occurs in Asterisk 1.8?

By: Rusty Newton (rnewton) 2012-09-24 11:20:18.730-0500

Stanislav, have you been able to test this scenario on the 1.8 branch?

By: Matt Jordan (mjordan) 2012-10-17 08:59:34.966-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions.  After testing with Asterisk 1.8, if you find this problem has not been resolved, please open a new issue against Asterisk 1.8.