From 72f0cf476d55f08f49c85af192792f6b67624fdb Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 19 Sep 2012 16:34:22 -0500 Subject: [PATCH] add conference-create and conference-destroy action events --- .../applications/mod_conference/mod_conference.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 0b1adcab57..0bdf28822b 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1910,7 +1910,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v int32_t z = 0; int member_score_sum = 0; int divisor = 0; - + if (!(divisor = conference->rate / 8000)) { divisor = 1; } @@ -1932,6 +1932,13 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v conference->is_recording = 0; conference->record_count = 0; + + + switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); + conference_add_event_data(conference, event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-create"); + switch_event_fire(&event); + while (globals.running && !switch_test_flag(conference, CFLAG_DESTRUCT)) { switch_size_t file_sample_len = samples; switch_size_t file_data_len = samples * 2; @@ -2448,6 +2455,11 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v } } + + switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); + conference_add_event_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(globals.hash_mutex);