FS-11848 [core] add user_data to event_channel_bind

* also adds a convenience switch_event_channel_deliver for already in thread
This commit is contained in:
Luis Azedo authored and Mike Jerris committed 2019-07-17 16:02:12 -04:00
1 parent eb31e17e6c
commit 302b409815
7 files changed
+58 -38

No files matched your search

@@ -57,7 +57,8 @@ static cJSON *get_canvas_info(mcu_canvas_t *canvas)
return obj;
}
void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id)
void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data)
{
cJSON *data, *addobj = NULL;
const char *action = NULL;
@@ -413,7 +414,7 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json
}
void conference_event_chat_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id)
void conference_event_chat_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data)
{
cJSON *data;
cJSON *jid = 0;
@@ -475,12 +476,12 @@ void conference_event_chat_channel_handler(const char *event_channel, cJSON *jso
switch_safe_free(conference_name);
}
void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id)
void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data)
{
switch_live_array_parse_json(json, conference_globals.event_channel_id);
}
void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id)
void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data)
{
char *domain = NULL, *name = NULL;
conference_obj_t *conference = NULL;
@@ -3934,10 +3934,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load)
switch_console_add_complete_func("::conference::conference_list_conferences", conference_list_conferences);
switch_event_channel_bind("conference", conference_event_channel_handler, &conference_globals.event_channel_id);
switch_event_channel_bind("conference-liveArray", conference_event_la_channel_handler, &conference_globals.event_channel_id);
switch_event_channel_bind("conference-mod", conference_event_mod_channel_handler, &conference_globals.event_channel_id);
switch_event_channel_bind("conference-chat", conference_event_chat_channel_handler, &conference_globals.event_channel_id);
switch_event_channel_bind("conference", conference_event_channel_handler, &conference_globals.event_channel_id, NULL);
switch_event_channel_bind("conference-liveArray", conference_event_la_channel_handler, &conference_globals.event_channel_id, NULL);
switch_event_channel_bind("conference-mod", conference_event_mod_channel_handler, &conference_globals.event_channel_id, NULL);
switch_event_channel_bind("conference-chat", conference_event_chat_channel_handler, &conference_globals.event_channel_id, NULL);
if ( conference_api_sub_syntax(&api_syntax) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_TERM;
@@ -3991,10 +3991,10 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown)
/* signal all threads to shutdown */
conference_globals.running = 0;
switch_event_channel_unbind(NULL, conference_event_channel_handler);
switch_event_channel_unbind(NULL, conference_event_la_channel_handler);
switch_event_channel_unbind(NULL, conference_event_mod_channel_handler);
switch_event_channel_unbind(NULL, conference_event_chat_channel_handler);
switch_event_channel_unbind(NULL, conference_event_channel_handler, NULL);
switch_event_channel_unbind(NULL, conference_event_la_channel_handler, NULL);
switch_event_channel_unbind(NULL, conference_event_mod_channel_handler, NULL);
switch_event_channel_unbind(NULL, conference_event_chat_channel_handler, NULL);
switch_console_del_complete_func("::conference::conference_list_conferences");
@@ -1167,10 +1167,10 @@ void conference_cdr_del(conference_member_t *member);
void conference_cdr_add(conference_member_t *member);
void conference_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason);
void conference_cdr_render(conference_obj_t *conference);
void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
void conference_event_chat_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data);
void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data);
void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data);
void conference_event_chat_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data);
void conference_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conference_api_member_cmd_t pfncallback, void *data);
int conference_video_flush_queue(switch_queue_t *q, int min);