diff --git a/CHANGES b/CHANGES index 2d50722..99d67ea 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,18 @@ ============================================================================== ------------------------------------------------------------------------------ +--- Functionality changes since Asterisk 11.22 ------------------------------- +------------------------------------------------------------------------------ + +app_confbridge +------------------- + * Added a bridge profile option called regexten that allows you to + dynamically register the conference bridge name as an extension into + the specified context. This allows tracking down conferences on multi- + server installations via alternate means (DUNDI for example). By default + this feature is not used. + +------------------------------------------------------------------------------ --- Functionality changes since Asterisk 11.21 ------------------------------- ------------------------------------------------------------------------------ diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 9ac1030..f292841 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -1154,9 +1154,17 @@ void conf_handle_second_active(struct conference_bridge *conference_bridge) void conf_ended(struct conference_bridge *conference_bridge) { + struct pbx_find_info q; + /* Called with a reference to conference_bridge */ ao2_unlink(conference_bridges, conference_bridge); send_conf_end_event(conference_bridge->name); + if (!ast_strlen_zero(conference_bridge->b_profile.regcontext) && \ + pbx_find_extension(NULL, NULL, &q, conference_bridge->b_profile.regcontext, + conference_bridge->name, 1, NULL, "", E_MATCH)) { + ast_context_remove_extension(conference_bridge->b_profile.regcontext, + conference_bridge->name, 1, NULL); + } ao2_lock(conference_bridge); conf_stop_record(conference_bridge); ao2_unlock(conference_bridge); @@ -1265,6 +1273,12 @@ static struct conference_bridge *join_conference_bridge(const char *name, struct send_conf_start_event(conference_bridge->name); ast_debug(1, "Created conference '%s' and linked to container.\n", name); + + if (!ast_strlen_zero(conference_bridge->b_profile.regcontext)) { + if (!ast_exists_extension(NULL, conference_bridge->b_profile.regcontext, conference_bridge->name, 1, NULL)) { + ast_add_extension(conference_bridge->b_profile.regcontext, 1, conference_bridge->name, 1, NULL, NULL, "Noop", NULL, NULL, "ConfBridge"); + } + } } ao2_unlock(conference_bridges); diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c index 98838de..cc5301e 100644 --- a/apps/confbridge/conf_config_parser.c +++ b/apps/confbridge/conf_config_parser.c @@ -930,6 +930,8 @@ static char *handle_cli_confbridge_show_bridge_profile(struct ast_cli_entry *e, break; } + ast_cli(a->fd,"Registration context: %s\n", b_profile.regcontext); + ast_cli(a->fd,"sound_only_person: %s\n", conf_get_sound(CONF_SOUND_ONLY_PERSON, b_profile.sounds)); ast_cli(a->fd,"sound_only_one: %s\n", conf_get_sound(CONF_SOUND_ONLY_ONE, b_profile.sounds)); ast_cli(a->fd,"sound_has_joined: %s\n", conf_get_sound(CONF_SOUND_HAS_JOINED, b_profile.sounds)); @@ -1395,6 +1397,7 @@ int conf_load_config(void) 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, "regcontext", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, regcontext)); 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 */ diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h index e05b1fc..e370568 100644 --- a/apps/confbridge/include/confbridge.h +++ b/apps/confbridge/include/confbridge.h @@ -200,6 +200,7 @@ struct bridge_profile { unsigned int internal_sample_rate; /*!< The internal sample rate of the bridge. 0 when set to auto adjust mode. */ unsigned int mix_interval; /*!< The internal mixing interval used by the bridge. When set to 0 the bridgewill use a default interval. */ struct bridge_profile_sounds *sounds; + char regcontext[AST_MAX_CONTEXT]; }; /*! \brief The structure that represents a conference bridge */ diff --git a/configs/confbridge.conf.sample b/configs/confbridge.conf.sample index d4a5865..d90ede9 100644 --- a/configs/confbridge.conf.sample +++ b/configs/confbridge.conf.sample @@ -200,6 +200,8 @@ type=bridge ;language=en ; Set the language used for announcements to the conference. ; Default is en (English). +;regcontext=conferences ; The name of the context into which to register conference names as extensions. + ; 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