[Freeswitch-svn] [commit] r12311 - in freeswitch/trunk: libs/esl/src libs/esl/src/include src src/include

FreeSWITCH SVN anthm at freeswitch.org
Thu Feb 26 10:54:00 PST 2009


Author: anthm
Date: Thu Feb 26 12:54:00 2009
New Revision: 12311

Log:
MODEVENT-39

Modified:
   freeswitch/trunk/libs/esl/src/esl_event.c
   freeswitch/trunk/libs/esl/src/include/esl_event.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_event.c

Modified: freeswitch/trunk/libs/esl/src/esl_event.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_event.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl_event.c	Thu Feb 26 12:54:00 2009
@@ -59,6 +59,7 @@
 */
 static const char *EVENT_NAMES[] = {
 	"CUSTOM",
+	"CLONE",
 	"CHANNEL_CREATE",
 	"CHANNEL_DESTROY",
 	"CHANNEL_STATE",
@@ -147,7 +148,7 @@
 {
 	*event = NULL;
 
-	if ((event_id > 0 && event_id != ESL_EVENT_CUSTOM) && subclass_name) {
+	if ((event_id != ESL_EVENT_CLONE && event_id != ESL_EVENT_CUSTOM) && subclass_name) {
 		return ESL_FAIL;
 	}
 
@@ -157,7 +158,7 @@
 
 	memset(*event, 0, sizeof(esl_event_t));
 
-	if (event_id) {
+	if (event_id != ESL_EVENT_CLONE) {
 		(*event)->event_id = event_id;
 		esl_event_add_header_string(*event, ESL_STACK_BOTTOM, "Event-Name", esl_event_name((*event)->event_id));
 	}
@@ -392,7 +393,7 @@
 {
 	esl_event_header_t *hp;
 
-	if (esl_event_create_subclass(event, 0, todup->subclass_name) != ESL_SUCCESS) {
+	if (esl_event_create_subclass(event, ESL_EVENT_CLONE, todup->subclass_name) != ESL_SUCCESS) {
 		return ESL_FAIL;
 	}
 

Modified: freeswitch/trunk/libs/esl/src/include/esl_event.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl_event.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl_event.h	Thu Feb 26 12:54:00 2009
@@ -47,6 +47,7 @@
 
 typedef enum {
 	ESL_EVENT_CUSTOM,
+	ESL_EVENT_CLONE,
 	ESL_EVENT_CHANNEL_CREATE,
 	ESL_EVENT_CHANNEL_DESTROY,
 	ESL_EVENT_CHANNEL_STATE,

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Thu Feb 26 12:54:00 2009
@@ -1160,6 +1160,7 @@
  */
 typedef enum {
 	SWITCH_EVENT_CUSTOM,
+	SWITCH_EVENT_CLONE,
 	SWITCH_EVENT_CHANNEL_CREATE,
 	SWITCH_EVENT_CHANNEL_DESTROY,
 	SWITCH_EVENT_CHANNEL_STATE,

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Thu Feb 26 12:54:00 2009
@@ -111,6 +111,7 @@
 */
 static char *EVENT_NAMES[] = {
 	"CUSTOM",
+	"CLONE",
 	"CHANNEL_CREATE",
 	"CHANNEL_DESTROY",
 	"CHANNEL_STATE",
@@ -598,7 +599,7 @@
 
 	*event = NULL;
 
-	if ((event_id > 0 && event_id != SWITCH_EVENT_CUSTOM) && subclass_name) {
+	if ((event_id != SWITCH_EVENT_CLONE && event_id != SWITCH_EVENT_CUSTOM) && subclass_name) {
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -611,7 +612,7 @@
 
 	memset(*event, 0, sizeof(switch_event_t));
 
-	if (event_id) {
+	if (event_id != SWITCH_EVENT_CLONE) {
 		(*event)->event_id = event_id;
 		switch_event_prep_for_delivery_detailed(file, func, line, *event);
 	}
@@ -813,7 +814,7 @@
 {
 	switch_event_header_t *hp;
 
-	if (switch_event_create_subclass(event, 0, todup->subclass_name) != SWITCH_STATUS_SUCCESS) {
+	if (switch_event_create_subclass(event, SWITCH_EVENT_CLONE, todup->subclass_name) != SWITCH_STATUS_SUCCESS) {
 		return SWITCH_STATUS_GENERR;
 	}
 



More information about the Freeswitch-svn mailing list