[Home]

Summary:ASTERISK-16875: chan_sip returns 503 Service Unavailable response, when additional information would allow it to return 480 response
Reporter:Szabolcs (colonel72)Labels:
Date Opened:2010-10-26 14:18:30Date Closed:2012-09-24 16:02:33
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) actualdebug
( 1) chan_sip_20101105.c.patch
( 2) chan_sip.c.patch
( 3) channel.c.patch
Description:When a phone not responding (HangupCauseCode:20) the caller from the sip trunk receive SIP response 503. The correct SIP response "Temporarily unavailable" 480!  (Also occur Asterisk 1.6.2.12)



****** ADDITIONAL INFORMATION ******

SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 10.16.91.2:5060;branch=z9hG4bK-d8754z-2f6c0a4862167d1a-1---d8754z-;received=10.16.91.2;rport=5060
From: <sip:anonymous@anonymous.invalid>;tag=92057525eb23103341d0d007ef3f9464
To: <sip:+36xxxxx@10.16.91.3>;tag=as16035486
Call-ID: 0000115d4cc724c77af1ea49f0f0f0f0@10.35.1.1/1
CSeq: 101 INVITE
Server: Asterisk PBX 1.8.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-Asterisk-HangupCause: Unknown
X-Asterisk-HangupCauseCode: 20
Content-Length: 0
Comments:By: Paul Belanger (pabelanger) 2010-10-27 12:33:31

Please attach a complete SIP debug (see below)
--
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:

http://svn.digium.com/svn/asterisk/trunk/doc/HOWTO_collect_debug_information.txt

By: Szabolcs (colonel72) 2010-11-03 07:38:34

To resolve: /usr/src/asterisk-1.8.0/channels/chan_sip.c change the lines: 6361-

Inline patch removed - pabelanger



By: Paul Belanger (pabelanger) 2010-11-03 08:01:27

Properly submit patches by attaching them to the tracker as code submissions, not within your comments.

By: Szabolcs (colonel72) 2010-11-03 08:01:30

To correct asterisk sip message header (X-Asterisk-HangupCause): /usr/src/asterisk-1.8.0/main/channel.c expand causes[]
{ AST_CAUSE_UNREGISTERED, "UNREGISTERED", "Temporarily unavailable" },

By: Matt Jordan (mjordan) 2012-09-24 16:02:26.905-0500

Asterisk is a B2BUA.  As such, correct configuration in the dialplan would allow the administrator to specify the desired hangup cause.  The fact that Congestion was specified from the dialplan indicates that something other than the desired endpoint not being available occurred - either because someone indicated Congestion to the dialing UA, or because Congestion actually did occur on the other channel technology.  Either way, this could be intercepted and handled without relying on hard coded logic that is - in many circumstances - potentially incorrect.

Also, your patch falls through the various case statements, so this patch will definitely result in incorrect behavior.

Because the correct way of handling this in Asterisk would be to set the desired hangup cause in the Hangup application, this issue will be closed out as "Not a Bug".