forked from Mirrors/freeswitch
launch perl scripts on startup (MODLANG-72)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9074 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1df3896b34
commit
e23ce1f5db
|
@ -2,5 +2,15 @@
|
|||
<settings>
|
||||
<!--<param name="xml-handler-script" value="/tmp/xml.pl"/>-->
|
||||
<!--<param name="xml-handler-bindings" value="dialplan"/>-->
|
||||
|
||||
<!--
|
||||
The following options identifies a perl script that is launched
|
||||
at startup and may live forever in the background.
|
||||
You can define multiple lines, one for each script you
|
||||
need to run.
|
||||
-->
|
||||
<!--param name="startup-script" value="startup_script_1.pl"/-->
|
||||
<!--param name="startup-script" value="startup_script_2.pl"/-->
|
||||
|
||||
</settings>
|
||||
</configuration>
|
||||
|
|
|
@ -450,6 +450,9 @@ static switch_status_t do_config(void)
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, var);
|
||||
switch_xml_bind_search_function(perl_fetch, switch_xml_parse_section_string(val), NULL);
|
||||
}
|
||||
} else if (!strcmp(var, "startup-script")) {
|
||||
if ( val )
|
||||
perl_thread(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -469,7 +472,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
|
|||
globals.pool = pool;
|
||||
|
||||
if (!(my_perl = perl_alloc())) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate perl intrepreter\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate perl interpreter\n");
|
||||
return SWITCH_STATUS_MEMERR;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Allocated perl intrepreter.\n");
|
||||
|
|
Loading…
Reference in New Issue