SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown);
SWITCH_MODULE_DEFINITION(mod_conference, mod_conference_load, mod_conference_shutdown, NULL);
+typedef enum {
+ CONF_SILENT_REQ = (1 << 0),
+ CONF_SILENT_DONE = (1 << 1)
+} conf_app_flag_t;
+
static const char global_app_name[] = "conference";
static char *global_cf_name = "conference.conf";
static char *cf_pin_url_param_name = "X-ConfPin=";
/* stop MoH if any */
conference_stop_file(conference, FILE_STOP_ASYNC);
}
- if (conference->enter_sound && (!switch_channel_test_flag(channel, CF_RECOVERED) ||
- switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) {
+
+ if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) {
conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session),
switch_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
}
switch_snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->iteration);
conference_member_say(member, saymsg, 0);
} else {
- if (zstr(conference->special_announce) && (!switch_channel_test_flag(channel, CF_RECOVERED) ||
- switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) {
+
+ if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) {
/* announce the total number of members in the conference */
if (conference->count >= conference->announce_count && conference->announce_count > 1) {
switch_snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
switch_set_flag(conference, CFLAG_ENFORCE_MIN);
}
- if (test_eflag(conference, EFLAG_ADD_MEMBER) && (!switch_channel_test_flag(channel, CF_RECOVERED) ||
- switch_true(switch_channel_get_variable(channel, "conference_silent_entry"))) &&
+ if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_add_event_member_data(member, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
switch_event_fire(&event);
}
+ switch_channel_clear_app_flag_key("conf_silent", channel, CONF_SILENT_REQ);
}
unlock_member(member);
switch_mutex_unlock(member->audio_out_mutex);
const char *prefix = switch_channel_get_variable(channel, "conference_auto_outcall_prefix");
int to = 60;
- if (ann && (!switch_channel_test_flag(channel, CF_RECOVERED) ||
- switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) {
+ if (ann && !switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) {
member->conference->special_announce = switch_core_strdup(member->conference->pool, ann);
}
}
-
/* Application interface function that is called from the dialplan to join the channel to a conference */
SWITCH_STANDARD_APP(conference_function)
{
switch_event_t *params = NULL;
int locked = 0;
-
+ if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_DONE) &&
+ (switch_channel_test_flag(channel, CF_RECOVERED) || switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) {
+ switch_channel_set_app_flag_key("conf_silent", channel, CONF_SILENT_REQ);
+ }
if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Channel answer failed.\n");
}
}
- if (conference->special_announce && (!switch_channel_test_flag(channel, CF_RECOVERED) ||
- switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) {
+ if (conference->special_announce && !switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) {
conference_local_play_file(conference, session, conference->special_announce, CONF_DEFAULT_LEADIN, NULL, 0);
}