]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10261: Fire conference-destroy event later
authorChad Phillips <chad@apartmentlines.com>
Mon, 24 Apr 2017 13:33:38 +0000 (08:33 -0500)
committerMike Jerris <mike@jerris.com>
Thu, 1 Jun 2017 19:14:48 +0000 (15:14 -0400)
The conference-destroy event can fire later, after more conference shutdown
operations are complete, such as closing open recording files.

src/mod/applications/mod_conference/mod_conference.c

index 220d86bdff9dab745a45aff4cdc72857077eea7a..c9ebda1f8bd102e01a1cf83bbe66ef785da1fe7b 100644 (file)
@@ -770,11 +770,6 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
                switch_cond_next();
        }
 
-       switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
-       conference_event_add_data(conference, event);
-       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-destroy");
-       switch_event_fire(&event);
-
        switch_core_timer_destroy(&timer);
        switch_mutex_lock(conference_globals.hash_mutex);
        if (conference_utils_test_flag(conference, CFLAG_INHASH)) {
@@ -812,6 +807,12 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
        }
 
        conference->end_time = switch_epoch_time_now(NULL);
+
+       switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
+       conference_event_add_data(conference, event);
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-destroy");
+       switch_event_fire(&event);
+
        conference_cdr_render(conference);
 
        switch_mutex_lock(conference_globals.setup_mutex);