[Freeswitch-svn] [commit] r12765 - in freeswitch/trunk/src: . include mod/applications/mod_dptools mod/endpoints/mod_sofia mod/event_handlers/mod_cdr_csv mod/event_handlers/mod_event_socket

FreeSWITCH SVN anthm at freeswitch.org
Tue Mar 24 16:44:03 PDT 2009


Author: anthm
Date: Tue Mar 24 18:44:03 2009
New Revision: 12765

Log:
fix var events to not have stamp info

Modified:
   freeswitch/trunk/src/include/switch_event.h
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
   freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/trunk/src/switch_channel.c

Modified: freeswitch/trunk/src/include/switch_event.h
==============================================================================
--- freeswitch/trunk/src/include/switch_event.h	(original)
+++ freeswitch/trunk/src/include/switch_event.h	Tue Mar 24 18:44:03 2009
@@ -332,6 +332,15 @@
 */
 #define switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY)
 
+static inline switch_status_t switch_event_create_plain(switch_event_t **event, switch_event_types_t event_id)
+{
+	switch_status_t status = switch_event_create(event, SWITCH_EVENT_CLONE);
+	if (status == SWITCH_STATUS_SUCCESS) {
+		(*event)->event_id = event_id;
+	}
+	
+	return status;
+}
 /*!
   \brief Deliver an event to all of the registered event listeners
   \param event the event to send (will be nulled)

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	Tue Mar 24 18:44:03 2009
@@ -938,7 +938,7 @@
 	switch_event_t *event;
 	char *buf;
 
-	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
+	if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(switch_core_session_get_channel(session), event);
 		switch_event_serialize(event, &buf, SWITCH_FALSE);
 		switch_assert(buf);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Mar 24 18:44:03 2009
@@ -1147,14 +1147,14 @@
 
 					if (in) {
 						if (!gateway->ib_vars) {
-							switch_event_create(&gateway->ib_vars, SWITCH_EVENT_GENERAL);
+							switch_event_create_plain(&gateway->ib_vars, SWITCH_EVENT_GENERAL);
 						}
 						switch_event_add_header_string(gateway->ib_vars, SWITCH_STACK_BOTTOM, var, val);
 					}
 
 					if (out) {
 						if (!gateway->ob_vars) {
-							switch_event_create(&gateway->ob_vars, SWITCH_EVENT_GENERAL);
+							switch_event_create_plain(&gateway->ob_vars, SWITCH_EVENT_GENERAL);
 						}
 						switch_event_add_header_string(gateway->ob_vars, SWITCH_STACK_BOTTOM, var, val);
 					}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Tue Mar 24 18:44:03 2009
@@ -1780,8 +1780,10 @@
 
 	if (first && ret == AUTH_OK) {
 		if (v_event) {
-			switch_event_create(v_event, SWITCH_EVENT_REQUEST_PARAMS);
+			switch_event_create_plain(v_event, SWITCH_EVENT_REQUEST_PARAMS);
 		}
+
+		
 		if (v_event && *v_event) {
 			switch_xml_t xparams[3];
 			int i = 0;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	Tue Mar 24 18:44:03 2009
@@ -199,7 +199,7 @@
 
 	if (globals.debug) {
 		switch_event_t *event;
-		if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
+		if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
 			char *buf;
 			switch_channel_event_set_data(channel, event);
 			switch_event_serialize(event, &buf, SWITCH_FALSE);

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	Tue Mar 24 18:44:03 2009
@@ -611,8 +611,7 @@
 
 		switch_mutex_lock(listener->filter_mutex);		
 		if (!listener->filters) {
-			switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
-			listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
+			switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
 		}
 
 		if (!strcasecmp(action, "delete")) {
@@ -623,8 +622,7 @@
 
 			if (!strcasecmp(header_val, "all")) {
 				switch_event_destroy(&listener->filters);
-				switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
-				listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
+				switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
 			} else {
 				switch_event_del_header(listener->filters, header_val);
 			}
@@ -1408,15 +1406,13 @@
 
 		switch_mutex_lock(listener->filter_mutex);		
 		if (!listener->filters) {
-			switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
-			listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
+			switch_event_create_plain(&listener->filters, 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_CLONE);
-				listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
+				switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
 			} else {
 				switch_event_del_header(listener->filters, header_val);
 			}

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Mar 24 18:44:03 2009
@@ -220,7 +220,7 @@
 		return SWITCH_STATUS_MEMERR;
 	}
 
-	switch_event_create(&(*channel)->variables, SWITCH_EVENT_GENERAL);
+	switch_event_create_plain(&(*channel)->variables, SWITCH_EVENT_CHANNEL_DATA);
 
 	switch_core_hash_init(&(*channel)->private_hash, pool);
 	switch_queue_create(&(*channel)->dtmf_queue, SWITCH_DTMF_LOG_LEN, pool);



More information about the Freeswitch-svn mailing list