]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODLANG-92 startup scripts do not honor the LUA_PATH and LUA_CPATH env vars
authorMichael Jerris <mike@jerris.com>
Mon, 15 Dec 2008 20:50:22 +0000 (20:50 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 15 Dec 2008 20:50:22 +0000 (20:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10784 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_lua/mod_lua.cpp

index 37af26e23a97db2021ad962bcb0d5b4c9fa29a74..8a7aa89eb35189db66cb914838df790c1751ebde 100644 (file)
@@ -278,10 +278,6 @@ static switch_status_t do_config(void)
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
                                        switch_xml_bind_search_function(lua_fetch, switch_xml_parse_section_string(val), NULL);
                                }
-                       } else if (!strcmp(var, "startup-script")) {
-                               if (val) {
-                                       lua_thread(val);
-                               }
                        } else if (!strcmp(var, "module-directory") && !switch_strlen_zero(val)) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending module directory: '%s'\n", val);
                                if(cpath_stream.data_len) {
@@ -332,6 +328,19 @@ static switch_status_t do_config(void)
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: LUA_PATH set to: '%s'\n", (char *)path_stream.data);
                }
        }
+
+       if ((settings = switch_xml_child(cfg, "settings"))) {
+               for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+                       char *var = (char *) switch_xml_attr_soft(param, "name");
+                       char *val = (char *) switch_xml_attr_soft(param, "value");
+                       if (!strcmp(var, "startup-script")) {
+                               if (val) {
+                                       lua_thread(val);
+                               }
+                       }
+               }
+       }
+
        switch_safe_free(path_stream.data);
     
        switch_xml_free(xml);