confbridge: Add support for disabling text messaging.

When in a conference bridge it may be necessary to have
text messages disabled for specific participants or for
all. This change adds a configuration option, "text_messaging",
which can be used to enable or disable this on the
user profile. By default existing behavior is preserved
as it defaults to "yes".

ASTERISK-28841

Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13
This commit is contained in:
Joshua C. Colp
2020-04-16 10:15:42 -03:00
committed by Joshua Colp
parent 191f136260
commit 6cfc6ff53c
8 changed files with 41 additions and 1 deletions

View File

@@ -2628,6 +2628,13 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
user.features.dtmf_passthrough = 0;
}
/* Set if text messaging is enabled for this user or not */
if (ast_test_flag(&user.u_profile, USER_OPT_TEXT_MESSAGING)) {
user.features.text_messaging = 1;
} else {
user.features.text_messaging = 0;
}
/* Set dsp threshold values if present */
if (user.u_profile.talking_threshold) {
user.tech_args.talking_threshold = user.u_profile.talking_threshold;

View File

@@ -240,6 +240,13 @@
<configOption name="timeout">
<synopsis>Kick the user out of the conference after this many seconds. 0 means there is no timeout for the user.</synopsis>
</configOption>
<configOption name="text_messaging" default="yes">
<synopsis>Sets if text messages are sent to the user.</synopsis>
<description><para>If text messaging is enabled for this user then
text messages will be sent to it. These may be events or from other
participants in the conference bridge. If disabled then no text
messages are sent to the user.</para></description>
</configOption>
</configObject>
<configObject name="bridge_profile">
<synopsis>A named profile to apply to specific bridges.</synopsis>
@@ -1588,7 +1595,10 @@ static char *handle_cli_confbridge_show_user_profile(struct ast_cli_entry *e, in
ast_cli(a->fd,"Announce User Count all: %s\n",
u_profile.flags & USER_OPT_ANNOUNCEUSERCOUNTALL ?
"enabled" : "disabled");
ast_cli(a->fd,"\n");
ast_cli(a->fd,"Text Messaging: %s\n",
u_profile.flags & USER_OPT_TEXT_MESSAGING ?
"enabled" : "disabled");
ast_cli(a->fd, "\n");
return CLI_SUCCESS;
}
@@ -2381,6 +2391,7 @@ int conf_load_config(void)
aco_option_register(&cfg_info, "dsp_talking_threshold", ACO_EXACT, user_types, __stringify(DEFAULT_TALKING_THRESHOLD), OPT_UINT_T, 0, FLDSET(struct user_profile, talking_threshold));
aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
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);
/* This option should only be used with the CONFBRIDGE dialplan function */
aco_option_register_custom(&cfg_info, "template", ACO_EXACT, user_types, NULL, user_template_handler, 0);

View File

@@ -68,6 +68,7 @@ enum user_profile_flags {
USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */
USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */
USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */
};
enum bridge_profile_flags {