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:
Sean Bright
2017-02-09 11:01:22 -05:00
parent c7fcc4468f
commit 8936568515
7 changed files with 51 additions and 25 deletions

View File

@@ -178,15 +178,15 @@ static int originate_exec(struct ast_channel *chan, const char *data)
chantech, chandata, args.arg1, exten, priority);
ast_pbx_outgoing_exten(chantech, cap_slin, chandata,
timeout * 1000, args.arg1, exten, priority, &outgoing_status, 1, NULL,
NULL, NULL, NULL, NULL, 0, NULL);
timeout * 1000, args.arg1, exten, priority, &outgoing_status,
AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, 0, NULL);
} else if (!strcasecmp(args.type, "app")) {
ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n",
chantech, chandata, args.arg1, S_OR(args.arg2, ""));
ast_pbx_outgoing_app(chantech, cap_slin, chandata,
timeout * 1000, args.arg1, args.arg2, &outgoing_status, 1, NULL,
NULL, NULL, NULL, NULL, NULL);
timeout * 1000, args.arg1, args.arg2, &outgoing_status,
AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, NULL);
} else {
ast_log(LOG_ERROR, "Incorrect type, it should be 'exten' or 'app': %s\n",
args.type);