mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +00:00
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
This commit is contained in:
@@ -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'");
|
||||
|
||||
Reference in New Issue
Block a user