Skip to content

Commit 5f8cabc

Browse files
InterLinked1gtjoseph
authored andcommitted
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
1 parent c8bf8a5 commit 5f8cabc

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

apps/app_confbridge.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -2535,10 +2535,6 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
25352535
AST_APP_ARG(menu_profile_name);
25362536
);
25372537

2538-
if (ast_channel_state(chan) != AST_STATE_UP) {
2539-
ast_answer(chan);
2540-
}
2541-
25422538
if (ast_bridge_features_init(&user.features)) {
25432539
pbx_builtin_setvar_helper(chan, "CONFBRIDGE_RESULT", "FAILED");
25442540
res = -1;
@@ -2588,6 +2584,11 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
25882584
goto confbridge_cleanup;
25892585
}
25902586

2587+
/* If channel hasn't been answered already, answer it, unless we're explicitly not supposed to */
2588+
if ((ast_channel_state(chan) != AST_STATE_UP) && (ast_test_flag(&user.u_profile, USER_OPT_ANSWER_CHANNEL))) {
2589+
ast_answer(chan);
2590+
}
2591+
25912592
quiet = ast_test_flag(&user.u_profile, USER_OPT_QUIET);
25922593

25932594
/* ask for a PIN immediately after finding user profile. This has to be

apps/confbridge/conf_config_parser.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
participants in the conference bridge. If disabled then no text
248248
messages are sent to the user.</para></description>
249249
</configOption>
250+
<configOption name="answer_channel" default="yes">
251+
<synopsis>Sets if a user's channel should be answered if currently unanswered.</synopsis>
252+
</configOption>
250253
</configObject>
251254
<configObject name="bridge_profile">
252255
<synopsis>A named profile to apply to specific bridges.</synopsis>
@@ -1609,9 +1612,12 @@ static char *handle_cli_confbridge_show_user_profile(struct ast_cli_entry *e, in
16091612
ast_cli(a->fd,"Announce User Count all: %s\n",
16101613
u_profile.flags & USER_OPT_ANNOUNCEUSERCOUNTALL ?
16111614
"enabled" : "disabled");
1612-
ast_cli(a->fd,"Text Messaging: %s\n",
1613-
u_profile.flags & USER_OPT_TEXT_MESSAGING ?
1614-
"enabled" : "disabled");
1615+
ast_cli(a->fd,"Text Messaging: %s\n",
1616+
u_profile.flags & USER_OPT_TEXT_MESSAGING ?
1617+
"enabled" : "disabled");
1618+
ast_cli(a->fd,"Answer Channel: %s\n",
1619+
u_profile.flags & USER_OPT_ANSWER_CHANNEL ?
1620+
"true" : "false");
16151621
ast_cli(a->fd, "\n");
16161622

16171623
return CLI_SUCCESS;
@@ -2410,6 +2416,7 @@ int conf_load_config(void)
24102416
aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
24112417
aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
24122418
aco_option_register(&cfg_info, "text_messaging", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_TEXT_MESSAGING);
2419+
aco_option_register(&cfg_info, "answer_channel", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANSWER_CHANNEL);
24132420

24142421
/* This option should only be used with the CONFBRIDGE dialplan function */
24152422
aco_option_register_custom(&cfg_info, "template", ACO_EXACT, user_types, NULL, user_template_handler, 0);

apps/confbridge/include/confbridge.h

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ enum user_profile_flags {
6969
USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */
7070
USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */
7171
USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */
72+
USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */
7273
};
7374

7475
enum bridge_profile_flags {

configs/samples/confbridge.conf.sample

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ type=user
165165
;text_messaging=yes ; When set to yes text messages will be sent to this user. Text messages
166166
; may occur as a result of events or can be received from other participants.
167167
; When set to no text messages will not be sent to this user.
168+
;answer_channel=yes ; Sets if the channel should be answered if it hasn't been already.
169+
; On by default.
168170

169171
; --- ConfBridge Bridge Profile Options ---
170172
[default_bridge]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Subject: app_confbridge answer supervision control
2+
3+
app_confbridge now provides a user option to prevent
4+
answer supervision if the channel hasn't been
5+
answered yet. To use it, set a user profile's
6+
answer_channel option to no.

0 commit comments

Comments
 (0)