]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add reloadxml event
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 3 Mar 2008 19:32:42 +0000 (19:32 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 3 Mar 2008 19:32:42 +0000 (19:32 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7775 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_event.c
src/switch_xml.cpp

index 5743ac4e3e5d1806aaf5efead74fae155267d5d2..59dadead2c940287740f5a44ce026aaf32252f32 100644 (file)
@@ -988,6 +988,7 @@ typedef enum {
        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 @@ typedef enum {
        SWITCH_EVENT_DEL_SCHEDULE,
        SWITCH_EVENT_EXE_SCHEDULE,
        SWITCH_EVENT_RE_SCHEDULE,
+       SWITCH_EVENT_RELOADXML,
        SWITCH_EVENT_ALL
 } switch_event_types_t;
 
index 287762e56c6a4053da9aa9277ea5f70bf4b671ee..3364da1209d63b6c59c0a177d8de642374b1b8ff 100644 (file)
@@ -126,6 +126,7 @@ static char *EVENT_NAMES[] = {
        "DEL_SCHEDULE",
        "EXE_SCHEDULE",
        "RE_SCHEDULE",
+       "RELOADXML",
        "ALL"
 };
 
index 2f675a3c86e3dd00b54e676ebc277b1db5c9b4ce..7990d83c460c8668532057b6cd9b0ab6999d29d7 100644 (file)
@@ -1479,7 +1479,17 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
        }
        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)