FS-11310 #resolve add more params for conference record stop event
This commit is contained in:
parent
ce6366474f
commit
720128b61e
|
@ -167,6 +167,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
|
|||
switch_size_t len = 0;
|
||||
int flags = 0;
|
||||
mcu_canvas_t *canvas = NULL;
|
||||
const char *file_size = NULL;
|
||||
const char *file_trimmed = NULL;
|
||||
const char *file_trimmed_ms = NULL;
|
||||
|
||||
if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Read Lock Fail\n");
|
||||
|
@ -412,10 +415,15 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
|
|||
if (switch_test_flag((&member->rec->fh), SWITCH_FILE_OPEN)) {
|
||||
switch_mutex_lock(conference->mutex);
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
switch_core_file_pre_close(&member->rec->fh);
|
||||
switch_core_file_get_string(&member->rec->fh, SWITCH_AUDIO_COL_STR_FILE_SIZE, &file_size);
|
||||
switch_core_file_get_string(&member->rec->fh, SWITCH_AUDIO_COL_STR_FILE_TRIMMED, &file_trimmed);
|
||||
switch_core_file_get_string(&member->rec->fh, SWITCH_AUDIO_COL_STR_FILE_TRIMMED_MS, &file_trimmed_ms);
|
||||
switch_core_file_close(&member->rec->fh);
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Recording of %s Stopped\n", rec->path);
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_event_add_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording");
|
||||
|
@ -424,6 +432,15 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
|
|||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samples-Out", "%ld", (long) member->rec->fh.samples_out);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samplerate", "%ld", (long) member->rec->fh.samplerate);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Milliseconds-Elapsed", "%ld", (long) member->rec->fh.samples_out / (member->rec->fh.samplerate / 1000));
|
||||
|
||||
if (file_trimmed_ms) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Milliseconds-File-Trimmed", "%s", file_trimmed_ms);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Record-File-Duration", "%d", atoi(file_trimmed_ms)/1000);
|
||||
}
|
||||
|
||||
if (file_size) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Record-File-Size", "%s", file_size);
|
||||
if (file_trimmed) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File-Trimmed", "%s", file_trimmed);
|
||||
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue