From 7a554a7386478fe93db31dd2ba5a421063f6cdbb Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Thu, 20 Nov 2008 17:39:06 +0000 Subject: [PATCH] Merged revisions 158053 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158053 | mmichelson | 2008-11-20 11:33:06 -0600 (Thu, 20 Nov 2008) | 12 lines Make sure to set the hangup cause on the calling channel in the case that ast_call() fails. For incoming SIP channels, this was causing us to send a 603 instead of a 486 when the call-limit was reached on the destination channel. (closes issue #13867) Reported by: still_nsk Patches: 13867.diff uploaded by putnopvut (license 60) Tested by: blitzrage ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158066 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_dial.c | 3 +++ channels/chan_sip.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/app_dial.c b/apps/app_dial.c index 38d2bbd281..4f53eeba8b 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1818,6 +1818,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags /* Again, keep going even if there's an error */ ast_debug(1, "ast call on peer returned %d\n", res); ast_verb(3, "Couldn't call %s\n", numsubst); + if (tc->hangupcause) { + chan->hangupcause = tc->hangupcause; + } ast_hangup(tc); tc = NULL; ast_free(tmp); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e656fb795c..d59339b2ff 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4870,8 +4870,11 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout) res = update_call_counter(p, INC_CALL_RINGING); - if (res == -1) + if (res == -1) { return res; + } else { + ast->hangupcause = AST_CAUSE_USER_BUSY; + } p->callingpres = ast->cid.cid_pres; p->jointcapability = ast_translate_available_formats(p->capability, p->prefcodec);