summaryrefslogtreecommitdiff
path: root/pbx
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-02-09 11:01:22 -0500
committerSean Bright <sean.bright@gmail.com>2017-02-10 18:01:54 -0500
commit8936568515d26eba6087a0064fe4d5d6e7f02ddd (patch)
tree9a56c64b9f8040c9384a45ffdb2a429fe21e2800 /pbx
parentc7fcc4468ffd54066129a982ff5b0a3cdfa7c5e0 (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 'pbx')
-rw-r--r--pbx/pbx_spool.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 4228be9b0..444f74d8b 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -399,15 +399,17 @@ static void *attempt_thread(void *data)
int res, reason;
if (!ast_strlen_zero(o->app)) {
ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
- res = ast_pbx_outgoing_app(o->tech, o->capabilities, o->dest, o->waittime * 1000,
- o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name,
+ res = ast_pbx_outgoing_app(o->tech, o->capabilities, o->dest,
+ o->waittime * 1000, o->app, o->data, &reason,
+ AST_OUTGOING_WAIT_COMPLETE, o->cid_num, o->cid_name,
o->vars, o->account, NULL, NULL);
} else {
ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
res = ast_pbx_outgoing_exten(o->tech, o->capabilities, o->dest,
o->waittime * 1000, o->context, o->exten, o->priority, &reason,
- 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL,
- ast_test_flag(&o->options, SPOOL_FLAG_EARLY_MEDIA), NULL);
+ AST_OUTGOING_WAIT_COMPLETE, o->cid_num, o->cid_name,
+ o->vars, o->account, NULL, ast_test_flag(&o->options, SPOOL_FLAG_EARLY_MEDIA),
+ NULL);
}
if (res) {
ast_log(LOG_NOTICE, "Call failed to go through, reason (%d) %s\n", reason, ast_channel_reason2str(reason));