Summary:ASTERISK-05248: Enhancement to Dial to return hangup cause when unable to complete call
Reporter:Dinesh Nair (alphaque)Labels:
Date Opened:2005-10-05 14:45:19Date Closed:2008-01-15 15:50:22.000-0600
Versions:Frequency of
Environment:Attachments:( 0) app_dial.c.diff
Description:In dial_exec_full(), when the call is unable to be made due to ast_request failing, the ast_channel member hangup cause is not set in the macro HANDLE_CAUSE. this patch adds the setting of the proper cause code (taken from include/asterisk/cause.h) to the hangupcause member, thus providing proper hangup causes to the calling peer.

within chan_sip.c, this translates to a proper 486 Busy here message instead of a 403 Forbidden as was the behaviour without the patch.
Comments:By: Dinesh Nair (alphaque) 2005-10-05 15:10:51

duh to me, the CVS Date should be 10/4/05, i.e. 04 October 2005 and not as entered. do excuse the minor error.

By: Kevin P. Fleming (kpfleming) 2005-10-05 17:24:13

I've fixed this in CVS HEAD, but I didn't use your patch, because there are a couple of problems with it:

1) You can't blindly set the chan->hangupcause in that macro, because there are uses of that macro that already set the hangupcause using different data.

2) When ast_request() fails, you only want to set the hangupcause if there are no more targets to dial; otherwise the hangupcause will be set to non-zero even if the call is completed to a different target.

By: Digium Subversion (svnbot) 2008-01-15 15:50:22.000-0600

Repository: asterisk
Revision: 6735

U   trunk/apps/app_dial.c

r6735 | kpfleming | 2008-01-15 15:50:21 -0600 (Tue, 15 Jan 2008) | 2 lines

properly report hangupcause when ast_request() fails for the last (or only) target of a dial operation (issue ASTERISK-5248, different fix)