[asterisk-commits] app confbridge: Set the language used for announcements to t... (asterisk[certified/11.6])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 19 08:22:14 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: app_confbridge: Set the language used for announcements to the conference.
......................................................................


app_confbridge: Set the language used for announcements to the conference.

ConfBridge now has the ability to set the language of announcements to the
conference.  The language can be set on a bridge profile in
confbridge.conf or by the dialplan function
CONFBRIDGE(bridge,language)=en.

(closes issue ASTERISK-19983)
Reported by: Jonathan White
Patches:
      M19983_rev2.diff (license #5138) patch uploaded by junky (modified)
Tested by: rmudgett

Change-Id: Ibb77668ecfa626f66aa0eae6d555c516a1d5cd32
---
M UPGRADE.txt
M apps/app_confbridge.c
M apps/confbridge/conf_config_parser.c
M apps/confbridge/include/confbridge.h
M configs/confbridge.conf.sample
5 files changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Joshua Colp: Verified



diff --git a/UPGRADE.txt b/UPGRADE.txt
index 312c12d..de40fe5 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -44,6 +44,11 @@
    by the CLI command is always the Asterisk version. This CLI command
    will be removed in Asterisk 14.
 
+ConfBridge
+ - ConfBridge now has the ability to set the language of announcements to the
+   conference.  The language can be set on a bridge profile in confbridge.conf
+   or by the dialplan function CONFBRIDGE(bridge,language)=en.
+
 from 11.6-cert6 to 11.6-cert7:
 
 * Due to the POODLE vulnerability (see 
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 41eef79..b08af53 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -1342,6 +1342,9 @@
 
 	ast_channel_internal_bridge_set(conference_bridge->playback_chan, conference_bridge->bridge);
 
+	/* To make sure playback_chan has the same language of that profile */
+	ast_channel_language_set(conference_bridge->playback_chan, conference_bridge->b_profile.language);
+
 	if (ast_call(conference_bridge->playback_chan, "", 0)) {
 		ast_hangup(conference_bridge->playback_chan);
 		conference_bridge->playback_chan = NULL;
diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
index 9244a42..4d3e03d 100644
--- a/apps/confbridge/conf_config_parser.c
+++ b/apps/confbridge/conf_config_parser.c
@@ -852,6 +852,7 @@
 
 	ast_cli(a->fd,"--------------------------------------------\n");
 	ast_cli(a->fd,"Name:                 %s\n", b_profile.name);
+	ast_cli(a->fd,"Language:             %s\n", b_profile.language);
 
 	if (b_profile.internal_sample_rate) {
 		snprintf(tmp, sizeof(tmp), "%d", b_profile.internal_sample_rate);
@@ -1364,6 +1365,7 @@
 	aco_option_register_custom(&cfg_info, "video_mode", ACO_EXACT, bridge_types, NULL, video_mode_handler, 0);
 	aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
 	aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
+	aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
 	aco_option_register_custom(&cfg_info, "^sound_", ACO_REGEX, bridge_types, NULL, sound_option_handler, 0);
 	/* This option should only be used with the CONFBRIDGE dialplan function */
 	aco_option_register_custom(&cfg_info, "template", ACO_EXACT, bridge_types, NULL, bridge_template_handler, 0);
diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h
index 0de2c50..f9fc93d 100644
--- a/apps/confbridge/include/confbridge.h
+++ b/apps/confbridge/include/confbridge.h
@@ -191,6 +191,7 @@
 
 struct bridge_profile {
 	char name[64];
+	char language[MAX_LANGUAGE];		  /*!< Language used for playback_chan */
 	char rec_file[PATH_MAX];
 	unsigned int flags;
 	unsigned int max_members;          /*!< The maximum number of participants allowed in the conference */
diff --git a/configs/confbridge.conf.sample b/configs/confbridge.conf.sample
index 08a2dd3..a4f829a 100644
--- a/configs/confbridge.conf.sample
+++ b/configs/confbridge.conf.sample
@@ -197,6 +197,9 @@
                            ;               is the single source of video distribution among all participants. If
                            ;               that user leaves, the marked user to join after them becomes the source.
 
+;language=en               ; Set the language used for announcements to the conference.
+                           ; Default is en (English).
+
 ; All sounds in the conference are customizable using the bridge profile options below.
 ; Simply state the option followed by the filename or full path of the filename after
 ; the option.  Example: sound_had_joined=conf-hasjoin  This will play the conf-hasjoin

-- 
To view, visit https://gerrit.asterisk.org/1277
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb77668ecfa626f66aa0eae6d555c516a1d5cd32
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/11.6
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list