summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-11-26 19:57:11 +0000
committerMark Michelson <mmichelson@digium.com>2008-11-26 19:57:11 +0000
commit5cf09591b06192e6f6a2988a53e9c4bde336e8d0 (patch)
treeeed75308af979f490c040b6f0f560db5c62d820d
parent63b031c4717fbec5a6b1b77f59c6ecb3b73a532c (diff)
Add some necessary hangup commands in the case that forwarding
a call fails 1) Hang up the original destination if the local channel cannot be requested. 2) Hang up the local channel (in addition to the original destination) if ast_call fails when calling the newly created local channel. This prevents channels from sticking around forever in the case of a botched call forward (e.g. to an extension which does not exist). (closes issue #13764) Reported by: davidw Patches: 13764_v2.patch uploaded by putnopvut (license 60) Tested by: putnopvut, davidw git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_dial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 4f53eeba8..462b30eb1 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -735,6 +735,7 @@ static void do_forward(struct chanlist *o,
if (!c) {
ast_clear_flag64(o, DIAL_STILLGOING);
handle_cause(cause, num);
+ ast_hangup(original);
} else {
char *new_cid_num, *new_cid_name;
struct ast_channel *src;
@@ -762,6 +763,7 @@ static void do_forward(struct chanlist *o,
ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
ast_clear_flag64(o, DIAL_STILLGOING);
ast_hangup(original);
+ ast_hangup(c);
c = o->chan = NULL;
num->nochan++;
} else {