diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-02-09 11:01:22 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-02-10 18:04:41 -0500 |
commit | 0910773077f065a45e975c1a5914be084d9a4bdc (patch) | |
tree | 335307320333b40d3b548a2435e67cd4a506fa69 /main/manager.c | |
parent | 648d181d2fb62284eb7a2284221b48240a0e876e (diff) |
manager: Restore Originate failure behavior from Asterisk 11
In Asterisk 11, if the 'Originate' AMI command failed to connect the provided
Channel while in extension mode, a 'failed' extension would be looked up and
run. This was, I believe, unintentionally removed in 51b6c49. This patch
restores that behavior.
This also adds an enum for the various 'synchronous' modes in an attempt to
make them meaningful.
ASTERISK-26115 #close
Reported by: Nasir Iqbal
Change-Id: I8afbd06725e99610e02adb529137d4800c05345d
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/main/manager.c b/main/manager.c index dfe056438..a25497fd3 100644 --- a/main/manager.c +++ b/main/manager.c @@ -5130,13 +5130,15 @@ static void *fast_originate(void *data) if (!ast_strlen_zero(in->app)) { res = ast_pbx_outgoing_app(in->tech, in->cap, in->data, - in->timeout, in->app, in->appdata, &reason, 1, + in->timeout, in->app, in->appdata, &reason, + AST_OUTGOING_WAIT, S_OR(in->cid_num, NULL), S_OR(in->cid_name, NULL), in->vars, in->account, &chan, &assignedids); } else { res = ast_pbx_outgoing_exten(in->tech, in->cap, in->data, - in->timeout, in->context, in->exten, in->priority, &reason, 1, + in->timeout, in->context, in->exten, in->priority, &reason, + AST_OUTGOING_WAIT, S_OR(in->cid_num, NULL), S_OR(in->cid_name, NULL), in->vars, in->account, &chan, in->early_media, &assignedids); @@ -5607,11 +5609,16 @@ static int action_originate(struct mansession *s, const struct message *m) } } } else if (!ast_strlen_zero(app)) { - res = ast_pbx_outgoing_app(tech, cap, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL, assignedids.uniqueid ? &assignedids : NULL); + res = ast_pbx_outgoing_app(tech, cap, data, to, app, appdata, &reason, + AST_OUTGOING_WAIT, l, n, vars, account, NULL, + assignedids.uniqueid ? &assignedids : NULL); ast_variables_destroy(vars); } else { if (exten && context && pi) { - res = ast_pbx_outgoing_exten(tech, cap, data, to, context, exten, pi, &reason, 1, l, n, vars, account, NULL, bridge_early, assignedids.uniqueid ? &assignedids : NULL); + res = ast_pbx_outgoing_exten(tech, cap, data, to, + context, exten, pi, &reason, AST_OUTGOING_WAIT, + l, n, vars, account, NULL, bridge_early, + assignedids.uniqueid ? &assignedids : NULL); ast_variables_destroy(vars); } else { astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'"); |