提交 fb43f805 authored 作者: Marc Olivier Chouinard's avatar Marc Olivier Chouinard

FS-3705 --resolve

上级 8379a292
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
<!-- <param name="ivr-dtmf-timeout" value="500"/> --> <!-- <param name="ivr-dtmf-timeout" value="500"/> -->
<!-- How much to wait for the first DTMF, 0 forever --> <!-- How much to wait for the first DTMF, 0 forever -->
<!-- <param name="ivr-input-timeout" value="0" /> --> <!-- <param name="ivr-input-timeout" value="0" /> -->
<!-- Delay before a conference is asked to be terminated -->
<!-- <param name="endconf-grace-time" value="120" /> -->
</profile> </profile>
<profile name="wideband"> <profile name="wideband">
......
...@@ -312,6 +312,10 @@ typedef struct conference_obj { ...@@ -312,6 +312,10 @@ typedef struct conference_obj {
uint32_t eflags; uint32_t eflags;
uint32_t verbose_events; uint32_t verbose_events;
int end_count; int end_count;
/* allow extra time after 'endconf' member leaves */
switch_time_t endconf_time;
int endconf_grace_time;
uint32_t relationship_total; uint32_t relationship_total;
uint32_t score; uint32_t score;
int mux_loop_count; int mux_loop_count;
...@@ -900,7 +904,9 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe ...@@ -900,7 +904,9 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
conference->count++; conference->count++;
if (switch_test_flag(member, MFLAG_ENDCONF)) { if (switch_test_flag(member, MFLAG_ENDCONF)) {
if (conference->end_count++) {}; if (conference->end_count++) {
conference->endconf_time = 0;
}
} }
conference_send_presence(conference); conference_send_presence(conference);
...@@ -1107,7 +1113,8 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe ...@@ -1107,7 +1113,8 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
if (switch_test_flag(member, MFLAG_ENDCONF)) { if (switch_test_flag(member, MFLAG_ENDCONF)) {
if (!--conference->end_count) { if (!--conference->end_count) {
switch_set_flag_locked(conference, CFLAG_DESTRUCT); //switch_set_flag_locked(conference, CFLAG_DESTRUCT);
conference->endconf_time = switch_epoch_time_now(NULL);
} }
} }
...@@ -1693,6 +1700,13 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v ...@@ -1693,6 +1700,13 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
} }
if (!conference->end_count && conference->endconf_time &&
switch_epoch_time_now(NULL) - conference->endconf_time > conference->endconf_grace_time) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Conference %s: endconf grace time exceeded (%u)\n",
conference->name, conference->endconf_grace_time);
switch_set_flag(conference, CFLAG_DESTRUCT);
}
switch_mutex_unlock(conference->mutex); switch_mutex_unlock(conference->mutex);
} }
/* Rinse ... Repeat */ /* Rinse ... Repeat */
...@@ -4411,6 +4425,11 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer ...@@ -4411,6 +4425,11 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
switch_xml_set_attr_d(x_conference, "recording", "true"); switch_xml_set_attr_d(x_conference, "recording", "true");
} }
if (conference->endconf_grace_time > 0) {
switch_snprintf(i, sizeof(i), "%u", conference->endconf_grace_time);
switch_xml_set_attr_d(x_conference, "endconf_grace_time", ival);
}
switch_snprintf(i, sizeof(i), "%d", switch_epoch_time_now(NULL) - conference->run_time); switch_snprintf(i, sizeof(i), "%d", switch_epoch_time_now(NULL) - conference->run_time);
switch_xml_set_attr_d(x_conference, "run_time", ival); switch_xml_set_attr_d(x_conference, "run_time", ival);
...@@ -6791,6 +6810,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c ...@@ -6791,6 +6810,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
char *auto_record = NULL; char *auto_record = NULL;
char *conference_log_dir = NULL; char *conference_log_dir = NULL;
char *terminate_on_silence = NULL; char *terminate_on_silence = NULL;
char *endconf_grace_time = NULL;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1]; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1];
switch_uuid_t uuid; switch_uuid_t uuid;
switch_codec_implementation_t read_impl = { 0 }; switch_codec_implementation_t read_impl = { 0 };
...@@ -6998,6 +7018,8 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c ...@@ -6998,6 +7018,8 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
auto_record = val; auto_record = val;
} else if (!strcasecmp(var, "terminate-on-silence") && !zstr(val)) { } else if (!strcasecmp(var, "terminate-on-silence") && !zstr(val)) {
terminate_on_silence = val; terminate_on_silence = val;
} else if (!strcasecmp(var, "endconf-grace-time") && !zstr(val)) {
endconf_grace_time = val;
} }
} }
...@@ -7222,9 +7244,12 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c ...@@ -7222,9 +7244,12 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
if (!zstr(auto_record)) { if (!zstr(auto_record)) {
conference->auto_record = switch_core_strdup(conference->pool, auto_record); conference->auto_record = switch_core_strdup(conference->pool, auto_record);
} }
if (!zstr(terminate_on_silence)) { if (!zstr(terminate_on_silence)) {
conference->terminate_on_silence = atoi(terminate_on_silence); conference->terminate_on_silence = atoi(terminate_on_silence);
} }
if (!zstr(endconf_grace_time)) {
conference->endconf_grace_time = atoi(endconf_grace_time);
}
if (!zstr(verbose_events) && switch_true(verbose_events)) { if (!zstr(verbose_events) && switch_true(verbose_events)) {
conference->verbose_events = 1; conference->verbose_events = 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论