[Freeswitch-svn] [commit] r12894 - freeswitch/trunk/src/mod/applications/mod_dptools

FreeSWITCH SVN anthm at freeswitch.org
Thu Apr 2 12:40:26 PDT 2009


Author: anthm
Date: Thu Apr  2 14:40:26 2009
New Revision: 12894

Log:
MODAPP-249

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Thu Apr  2 14:40:26 2009
@@ -962,7 +962,6 @@
 	char *lbuf;
 
 	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_APPLICATION) == SWITCH_STATUS_SUCCESS) {
-		switch_channel_event_set_data(switch_core_session_get_channel(session), event);
 		if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
 			&& (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 			int x = 0;
@@ -987,11 +986,24 @@
 						while (*p == ' ')
 							*p++ = '\0';
 						val = p;
-						switch_event_add_header(event, SWITCH_STACK_BOTTOM, var, "%s", val);
+						if (!strcasecmp(var,"Event-Name")) {
+							switch_name_event(val, &event->event_id);
+							switch_event_del_header(event, var);
+							switch_event_add_header(event, SWITCH_STACK_BOTTOM, var, "%s", val);
+						} else if (!strcasecmp(var,"Event-Subclass")) {
+							size_t len = strlen(val) + 1;
+							void *new = malloc(len);
+							switch_assert(new);
+							memcpy(new, val, len);
+							event->subclass_name = new;
+						} else {
+							switch_event_add_header(event, SWITCH_STACK_BOTTOM, var, "%s", val);
+						}
 					}
 				}
 			}
 		}
+		switch_channel_event_set_data(switch_core_session_get_channel(session), event);
 		switch_event_fire(&event);
 	}
 }



More information about the Freeswitch-svn mailing list