summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-02-27 22:17:42 +0000
committerJoshua Colp <jcolp@digium.com>2007-02-27 22:17:42 +0000
commit726928cb6091abe5a90403993b2b584e347c0927 (patch)
treec1608bd40a1c243f2d41ebd972d09762d2e8a05b /apps
parent4869ae965557af405105f20afab230555781c129 (diff)
Properly hangup the original dialed channel, not the new channel that appeared from the forwarding. (issue #9161 reported by PhilSmith)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 2b2039622..e83f80a0e 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -428,6 +428,7 @@ static void do_forward(struct chanlist *o,
struct cause_args *num, struct ast_flags *peerflags, int single)
{
char tmpchan[256];
+ struct ast_channel *original = o->chan;
struct ast_channel *c = o->chan; /* the winner */
struct ast_channel *in = num->chan; /* the input channel */
char *stuff;
@@ -498,7 +499,7 @@ static void do_forward(struct chanlist *o,
if (ast_call(c, tmpchan, 0)) {
ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
ast_clear_flag(o, DIAL_STILLGOING);
- ast_hangup(c);
+ ast_hangup(original);
c = o->chan = NULL;
num->nochan++;
} else {
@@ -509,7 +510,7 @@ static void do_forward(struct chanlist *o,
ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
}
/* Hangup the original channel now, in case we needed it */
- ast_hangup(c);
+ ast_hangup(original);
}
}
}