app_confbridge: New option to prevent answer supervision

A new user option, answer_channel, adds the capability to
prevent answering the channel if it hasn't already been
answered yet.

ASTERISK-29440

Change-Id: I26642729d0345f178c7b8045506605c8402de54b
This commit is contained in:
Naveen Albert
2021-05-20 10:51:32 -04:00
committed by Friendly Automation
parent 8e2672d2a4
commit a861522467
5 changed files with 24 additions and 7 deletions

View File

@@ -2535,10 +2535,6 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
AST_APP_ARG(menu_profile_name);
);
if (ast_channel_state(chan) != AST_STATE_UP) {
ast_answer(chan);
}
if (ast_bridge_features_init(&user.features)) {
pbx_builtin_setvar_helper(chan, "CONFBRIDGE_RESULT", "FAILED");
res = -1;
@@ -2588,6 +2584,11 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
goto confbridge_cleanup;
}
/* If channel hasn't been answered already, answer it, unless we're explicitly not supposed to */
if ((ast_channel_state(chan) != AST_STATE_UP) && (ast_test_flag(&user.u_profile, USER_OPT_ANSWER_CHANNEL))) {
ast_answer(chan);
}
quiet = ast_test_flag(&user.u_profile, USER_OPT_QUIET);
/* ask for a PIN immediately after finding user profile. This has to be