diff --git a/CHANGES b/CHANGES index 6fc2b3765e2fc8d45b6232fae407b2648ad86ed7..3c6748d98c6a09ce9b5e188d584dc3b00a36db35 100644 --- a/CHANGES +++ b/CHANGES @@ -161,6 +161,10 @@ ConfBridge when the recording is stopped and then re-started, the existing recording will be used and appended to. + * 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. + ControlPlayback ------------------ * The channel variable CPLAYBACKSTATUS may now return the value diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 47cfa0b8bab0a35510bf4fae8ed42ee5caf2e0bb..6f1420fcd21be332d3283e9f2d7b2e78eb2e5e3a 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -1339,6 +1339,9 @@ static int alloc_playback_chan(struct confbridge_conference *conference) return -1; } + /* To make sure playback_chan has the same language of that profile */ + ast_channel_language_set(conference->playback_chan, conference->b_profile.language); + ast_debug(1, "Created announcer channel '%s' to conference bridge '%s'\n", ast_channel_name(conference->playback_chan), conference->name); return 0; diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c index 6c57f1614fd179af735035be49f6c86b3338cced..97c0696a7da1c855eb9fe7416eaff3eb379823b8 100644 --- a/apps/confbridge/conf_config_parser.c +++ b/apps/confbridge/conf_config_parser.c @@ -257,6 +257,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") will be used. </para></description> </configOption> + <configOption name="language" default="en"> + <synopsis>The language used for announcements to the conference.</synopsis> + <description><para> + By default, announcements to a conference use English. Which means + the prompts played to all users within the conference will be + English. By changing the language of a bridge, this will change + the language of the prompts played to all users. + </para></description> + </configOption> <configOption name="mixing_interval"> <synopsis>Sets the internal mixing interval in milliseconds for the bridge</synopsis> <description><para> @@ -1417,6 +1426,7 @@ static char *handle_cli_confbridge_show_bridge_profile(struct ast_cli_entry *e, 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); @@ -1934,6 +1944,7 @@ int conf_load_config(void) aco_option_register(&cfg_info, "record_file_append", ACO_EXACT, bridge_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_FILE_APPEND); 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 7c2abda6c484a5efb2a25aaf0f9c73cd7f2a6c8a..71ae5f7de37e5d8394013e9230b33f9a976359ab 100644 --- a/apps/confbridge/include/confbridge.h +++ b/apps/confbridge/include/confbridge.h @@ -192,6 +192,7 @@ struct bridge_profile_sounds { 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 08a2dd30575efd6c6da38933372ec4c9bffe46da..a4f829aa2cc93d2edbc0863aac1040b0e37ccfa5 100644 --- a/configs/confbridge.conf.sample +++ b/configs/confbridge.conf.sample @@ -197,6 +197,9 @@ type=bridge ; 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