FS-8280: [mod_conference] remove duplicate stop-recording event and move other-recordings item over to the place its sending the event
This commit is contained in:
parent
ffe671f7d6
commit
6752089c99
|
@ -2386,7 +2386,6 @@ switch_status_t conference_api_sub_record(conference_obj_t *conference, switch_s
|
|||
switch_status_t conference_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
|
||||
{
|
||||
int all, before = conference->record_count, ttl = 0;
|
||||
switch_event_t *event;
|
||||
|
||||
switch_assert(conference != NULL);
|
||||
switch_assert(stream != NULL);
|
||||
|
@ -2398,15 +2397,6 @@ switch_status_t conference_api_sub_norecord(conference_obj_t *conference, switch
|
|||
|
||||
if (!conference_record_stop(conference, stream, all ? NULL : argv[2]) && !all) {
|
||||
stream->write_function(stream, "non-existant recording '%s'\n", argv[2]);
|
||||
} else {
|
||||
if (test_eflag(conference, EFLAG_RECORD) &&
|
||||
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");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", all ? "all" : argv[2]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Recordings", conference->record_count ? "true" : "false");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
||||
ttl = before - conference->record_count;
|
||||
|
|
|
@ -91,6 +91,7 @@ switch_status_t conference_record_stop(conference_obj_t *conference, switch_stre
|
|||
switch_mutex_lock(conference->member_mutex);
|
||||
for (member = conference->members; member; member = member->next) {
|
||||
if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) {
|
||||
conference->record_count--;
|
||||
if (!conference_utils_test_flag(conference, CFLAG_CONF_RESTART_AUTO_RECORD) && member->rec && member->rec->autorec) {
|
||||
stream->write_function(stream, "Stopped AUTO recording file %s (Auto Recording Now Disabled)\n", member->rec_path);
|
||||
conference->auto_record = 0;
|
||||
|
@ -99,12 +100,12 @@ switch_status_t conference_record_stop(conference_obj_t *conference, switch_stre
|
|||
}
|
||||
|
||||
conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
|
||||
|
||||
count++;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
conference->record_count -= count;
|
||||
|
||||
switch_mutex_unlock(conference->member_mutex);
|
||||
return count;
|
||||
|
@ -384,6 +385,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
|
|||
conference_event_add_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Recordings", conference->record_count ? "true" : "false");
|
||||
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));
|
||||
|
|
Loading…
Reference in New Issue