[Home]

Summary:ASTERISK-25031: DTMF INFO before answer leads to 200 OK without Contact: header
Reporter:Etienne Allovon (etienne_pf)Labels:
Date Opened:2015-04-29 07:32:35Date Closed:
Priority:MajorRegression?No
Status:Open/NewComponents:Channels/chan_sip/General
Versions:11.17.1 13.18.4 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-24915 [patch]Missing Contact: header in 200 OK
Environment:Attachments:( 0) ASTERISK-25031-asterisk-extensions.conf
( 1) ASTERISK-25031-asterisk-full.log
( 2) ASTERISK-25031-asterisk-sip.conf
( 3) REGISTER_INVITE_client-dtmf.csv
( 4) REGISTER_INVITE_client-dtmf.xml
Description:*Summary*

When asterisk receives a INFO message (DTMF) before the call was asnwered it answers the INFO with a SIP 200 OK without the {{Contact:}} header.
It results, for the receiving peer, to terminate the call (SIP BYE) because he can't answer.
For example, if the receiving peer is an asterisk, you get the following WARNING in the CLI :
{code}
WARNING[32089] chan_sip.c: Invalid contact uri  (missing sip: or sips:), attempting to use anyway
{code}


*When does it happen in real life ?*

In real life I saw it with two asterisk interconnected with a SIP trunk and a T1/E1 connection :
{code}
Phone ---SIP--- (asterisk) --- SIP --- (asterisk-gw) --- E1/T1 ---
{code}

Let's say you call a premium-rate number. Before answering the call the service will play a message saying something like : _This is a premimum-rate number, you'll be charged ... next time press # to skip this message_
If you press #, call is hangup.
Here's what happen _asterisk-gw_ point of view :
{code}
< INVITE            (CSeq 1)
> 401 Unauthorized  (CSeq 1)
< ACK               (CSeq 1)
< INVITE            (CSeq 2)
> (isdn) SETUP
< (isdn) CALL PROCEEDING
> 100 Trying        (CSeq 2)  
< (isdn) CALL PROGRESS
> 183 Progress      (CSeq 2)
< INFO (#)          (CSeq 3)
> 200 OK            (CSeq 3) .... /!\ which does not contain the Contact: header
> BYE 500 Server error
{code}

The 200 OK to the INFO message does not contain the {{Contact:}} header.

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

{code}
< INVITE            (CSeq 1)
> 401 Unauthorized  (CSeq 1)
< ACK               (CSeq 1)
< INVITE            (CSeq 2)
> 100 Trying        (CSeq 2)  
> 183 Progress      (CSeq 2)
< INFO (#)          (CSeq 3)
> 200 OK            (CSeq 3) .... /!\ which does not contain the Contact: header
{code}

The bug appears at step #7.

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 asterisk IP,
* replace 192.168.18.11 with SIPp client IP
* get the REGISTER_INVITE_client-dtmf.xml file,
* get the REGISTER_INVITE_client-dtmf.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: Etienne Allovon (etienne_pf) 2015-04-29 07:36:29.708-0500

Asterisk extensions.conf and sip.conf + sipp scenario to reproduce the problem.

By: Etienne Allovon (etienne_pf) 2015-04-29 07:45:36.167-0500

Asterisk's full log. Note, line 810 the _200 OK_ without the {{Contact:}} header.

By: Rusty Newton (rnewton) 2015-04-30 19:11:39.522-0500

Thanks for the report. If you end up coming up with a patch for this one, please follow on with the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. That will move things on much faster. Thanks!