diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index fa1f12c..22d3b40 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -287,6 +287,7 @@ typedef struct conference_obj { uint32_t avg_itt; uint32_t avg_tally; switch_time_t run_time; + switch_uuid_t uuid; } conference_obj_t; /* Relationship with another member */ @@ -435,11 +436,14 @@ static switch_status_t conference_add_event_member_data(conference_member_t *mem static switch_status_t conference_add_event_data(conference_obj_t *conference, switch_event_t *event) { + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1]; switch_status_t status = SWITCH_STATUS_SUCCESS; + switch_uuid_format(uuid_str, &(conference->uuid)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", conference->profile_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Unique-ID", uuid_str); return status; } @@ -2779,6 +2783,12 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th switch_core_file_close(&fh); } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recording of %s Stopped\n", rec->path); + if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { + conference_add_event_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_fire(&event); + } if (rec->pool) { switch_memory_pool_t *pool = rec->pool; @@ -6315,6 +6325,9 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_m conference->verbose_events = 1; } + /* Create the conference unique identifier */ + switch_uuid_get(&(conference->uuid)); + /* Activate the conference mutex for exclusivity */ switch_mutex_init(&conference->mutex, SWITCH_MUTEX_NESTED, conference->pool); switch_mutex_init(&conference->flag_mutex, SWITCH_MUTEX_NESTED, conference->pool);