[Freeswitch-trunk] [commit] r12489 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket

FreeSWITCH SVN anthm at freeswitch.org
Fri Mar 6 11:25:20 PST 2009


Author: anthm
Date: Fri Mar  6 13:25:19 2009
New Revision: 12489

Log:
fix broken filter command in event socket

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Fri Mar  6 13:25:19 2009
@@ -254,7 +254,7 @@
 
 			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_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 @@
 
 			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 @@
 
 		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);
 			}



More information about the Freeswitch-trunk mailing list