]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure to set the hangup cause on the calling channel in the case
authorMark Michelson <mmichelson@digium.com>
Thu, 20 Nov 2008 17:33:06 +0000 (17:33 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 20 Nov 2008 17:33:06 +0000 (17:33 +0000)
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/branches/1.4@158053 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
channels/chan_sip.c

index 1782e13f14d1cff49d62f484948565f5740fea8c..1cc08564a2e24711e6aecb515fffaeeee5e929a4 100644 (file)
@@ -1383,6 +1383,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                                ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
                        if (option_verbose > 2)
                                ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
+                       if (tmp->chan->hangupcause) {
+                               chan->hangupcause = tmp->chan->hangupcause;
+                       }
                        ast_hangup(tmp->chan);
                        tmp->chan = NULL;
                        free(tmp);
index b2c58ed094fbeb634640d0a8b8bd8e9a91e51a12..a9422d081b7ae27828ea988dea06900a625e2ce3 100644 (file)
@@ -3067,6 +3067,8 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout)
                        AST_SCHED_DEL(sched, p->initid);
                        p->initid = ast_sched_add(sched, p->maxtime ? (p->maxtime * 4) : SIP_TRANS_TIMEOUT, auto_congest, p);
                }
+       } else {
+               ast->hangupcause = AST_CAUSE_USER_BUSY;
        }
        return res;
 }