Summary:ASTERISK-16463: Wrong DIALSTATUS/HANGUPCAUSE set on receiving 416 reply to INVITE
Reporter:edo (edo)Labels:
Date Opened:2010-07-29 11:56:23Date Closed:2012-03-23 13:02:01
Versions:Frequency of
Description:Misconfigured provider's server send 416 reply to INVITE:
<--- SIP read from TCP: --->
SIP/2.0 416 Unsupported URI Scheme
Via: SIP/2.0/TCP 91.144.xxx.xxx:5060;received=91.144.xxx.xxx;branch=z9hG4bK13c51815;rport=35656
From: "7927xxxxxxx" <sip:7927xxxxxxx@multifon.ru>;tag=as3ae65d97
To: <sip:7927yyyyyyy@sbc.multifon.ru:5060>;tag=96FF324631353641E9DD3100
Call-ID: 2d653d043cdcf4b8153def7942de9d22@multifon.ru
CSeq: 103 INVITE

After call hangup Asterisk set DIALSTATUS to NOANSWER, HANGUPCAUSE to 16, that is incorrect.
Comments:By: Leif Madsen (lmadsen) 2010-07-29 13:44:11

What are the correct values?

By: edo (edo) 2010-07-29 14:05:43

Accoring to rfc4497 HANGUPCAUSE must be set to AST_CAUSE_INTERWORKING.

btw. hangup_sip2cause function must follow this rfc:

about DIALSTATUS - I think CONGESTION is reasonable value.

By: Paul Belanger (pabelanger) 2010-09-04 14:17:37

We require a complete debug log to help triage the issue.

This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue:


By: Matt Jordan (mjordan) 2012-02-02 09:04:36.087-0600

We just need to add response code 416 to hangup_sip2cause.  Per RFC 4497, it should be returning AST_CAUSE_INTERWORKING, but because its not handled the default value is returned.

By: Rob Gagnon (rgagnon) 2012-03-07 16:55:26.752-0600

From what I see in hangup_sip2cause() as of Asterisk 10.1.2, this would be the result... maybe this issue can be closed?

The default option shows:
if (cause < 500 && cause >= 400) {
  /* 4xx class error that is unknown - someting wrong with our request */
} else if (cause < 600 && cause >= 500) {
  /* 5xx class error - problem in the remote end */
} else if (cause < 700 && cause >= 600) {
  /* 6xx - global errors in the 4xx class */

From that, you should get AST_CAUSE_INTERWORKING when cause 416 comes by

By: Matt Jordan (mjordan) 2012-03-23 13:01:51.951-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.