diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 8957af9452..de0b8f67e0 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -254,7 +254,7 @@ static void event_handler(switch_event_t *event) send = 0; switch_mutex_lock(l->filter_mutex); - for (hp = l->filters->headers; hp; hp = hp->next) { + for (hp = l->filters->headers; hp; hp = hp->next) { if ((hval = switch_event_get_header(event, hp->name))) { const char *comp_to = hp->value; int pos = 1, cmp = 0; @@ -611,7 +611,8 @@ SWITCH_STANDARD_API(event_sink_function) switch_mutex_lock(listener->filter_mutex); if (!listener->filters) { - switch_event_create(&listener->filters, SWITCH_EVENT_CHANNEL_DATA); + switch_event_create(&listener->filters, SWITCH_EVENT_CLONE); + listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA; } if (!strcasecmp(action, "delete")) { @@ -622,7 +623,8 @@ SWITCH_STANDARD_API(event_sink_function) if (!strcasecmp(header_val, "all")) { switch_event_destroy(&listener->filters); - switch_event_create(&listener->filters, SWITCH_EVENT_CHANNEL_DATA); + switch_event_create(&listener->filters, SWITCH_EVENT_CLONE); + listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA; } else { switch_event_del_header(listener->filters, header_val); } @@ -1406,13 +1408,15 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even switch_mutex_lock(listener->filter_mutex); if (!listener->filters) { - switch_event_create(&listener->filters, SWITCH_EVENT_CHANNEL_DATA); + switch_event_create(&listener->filters, SWITCH_EVENT_CLONE); + listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA; } if (!strcasecmp(header_name, "delete")) { if (!strcasecmp(header_val, "all")) { switch_event_destroy(&listener->filters); - switch_event_create(&listener->filters, SWITCH_EVENT_CHANNEL_DATA); + switch_event_create(&listener->filters, SWITCH_EVENT_CLONE); + listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA; } else { switch_event_del_header(listener->filters, header_val); }