[Freeswitch-svn] [commit] r7775 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Mon Mar 3 14:32:43 EST 2008


Author: anthm
Date: Mon Mar  3 14:32:42 2008
New Revision: 7775

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_event.c
   freeswitch/trunk/src/switch_xml.cpp

Log:
add reloadxml event

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Mon Mar  3 14:32:42 2008
@@ -988,6 +988,7 @@
 	SWITCH_EVENT_DEL_SCHEDULE		- Something has been unscheduled
 	SWITCH_EVENT_EXE_SCHEDULE		- Something scheduled has been executed
 	SWITCH_EVENT_RE_SCHEDULE		- Something scheduled has been rescheduled
+	SWITCH_EVENT_RELOADXML			- XML registry has been reloaded
     SWITCH_EVENT_ALL				- All events at once
 </pre>
 
@@ -1041,6 +1042,7 @@
 	SWITCH_EVENT_DEL_SCHEDULE,
 	SWITCH_EVENT_EXE_SCHEDULE,
 	SWITCH_EVENT_RE_SCHEDULE,
+	SWITCH_EVENT_RELOADXML,
 	SWITCH_EVENT_ALL
 } switch_event_types_t;
 

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Mon Mar  3 14:32:42 2008
@@ -126,6 +126,7 @@
 	"DEL_SCHEDULE",
 	"EXE_SCHEDULE",
 	"RE_SCHEDULE",
+	"RELOADXML",
 	"ALL"
 };
 

Modified: freeswitch/trunk/src/switch_xml.cpp
==============================================================================
--- freeswitch/trunk/src/switch_xml.cpp	(original)
+++ freeswitch/trunk/src/switch_xml.cpp	Mon Mar  3 14:32:42 2008
@@ -1479,7 +1479,17 @@
 	}
 	switch_mutex_unlock(XML_LOCK);
 
-	return errcnt == 0 ? switch_xml_root() : NULL;
+	if (errcnt == 0) {
+		switch_event_t *event;
+		if (switch_event_create(&event, SWITCH_EVENT_RELOADXML) == SWITCH_STATUS_SUCCESS) {
+			if (switch_event_fire(&event) != SWITCH_STATUS_SUCCESS) {
+				switch_event_destroy(&event);
+			}
+		}
+		return switch_xml_root();
+	}
+
+	return NULL;
 }
 
 SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, const char **err)



More information about the Freeswitch-svn mailing list