summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-09-03 16:04:21 -0500
committerMatt Jordan <mjordan@digium.com>2016-09-03 16:07:36 -0500
commit730cb3b0b741d294e7aecd22e64bb87094480063 (patch)
treebcb14e734f29fe1d3e3fdd01571ac61abc1df6b7 /apps/app_dial.c
parentd3c4b901d476a41b3f7df063aeba3852df4e26b7 (diff)
apps/app_dial: Fix crash on non-connect call paths for Privacy/Screening option
In any scenario in which the callee is not connected to the caller, the current code in app_dial will crash due to raising a Dial End Stasis Message after the callee channel has been hung up. This patch corrects the error by simply moving the explicit hangup of the callee (peer) channel until after the dial end message. ASTERISK-25691 #close Change-Id: I816a414014424d0d8c80e2a3cbef13ef8c63798d
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 48193b5a0..8ca69e6c4 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1946,8 +1946,6 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
}
return 0; /* the good exit path */
} else {
- /* hang up on the callee -- he didn't want to talk anyway! */
- ast_autoservice_chan_hangup_peer(chan, peer);
return -1;
}
}
@@ -2804,6 +2802,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
if ( (ast_test_flag64(&opts, OPT_PRIVACY) || ast_test_flag64(&opts, OPT_SCREENING)) && pa.privdb_val == AST_PRIVACY_UNKNOWN) {
if (do_privacy(chan, peer, &opts, opt_args, &pa)) {
ast_channel_publish_dial(chan, peer, NULL, pa.status);
+ /* hang up on the callee -- he didn't want to talk anyway! */
+ ast_autoservice_chan_hangup_peer(chan, peer);
res = 0;
goto out;
}