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

Freeswitch SVN anthm at freeswitch.org
Mon Oct 23 18:32:51 EDT 2006


Author: anthm
Date: Mon Oct 23 18:32:50 2006
New Revision: 3169

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

Log:
let you pick event type

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	Mon Oct 23 18:32:50 2006
@@ -495,6 +495,21 @@
 
 
 	if (!strncasecmp(cmd, "sendevent", 9)) {
+		char *ename;
+		strip_cr(cmd);
+
+		ename = cmd + 9;
+		if (*ename == '\r' || *ename == '\n') {
+			ename = NULL;
+		}
+		
+		if (ename) {
+			switch_event_types_t etype;
+			if (switch_name_event(ename, &etype) == SWITCH_STATUS_SUCCESS) {
+				event->event_id = etype;
+			}
+		}
+
 		switch_event_fire(&event);
 		snprintf(reply, reply_len, "+OK");
 		goto done;



More information about the Freeswitch-svn mailing list