From e23ce1f5dbe1d4c1bf17a8dd34e832d0761abb58 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 17 Jul 2008 20:01:53 +0000 Subject: [PATCH] launch perl scripts on startup (MODLANG-72) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9074 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/autoload_configs/perl.conf.xml | 10 ++++++++++ src/mod/languages/mod_perl/mod_perl.c | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/autoload_configs/perl.conf.xml b/conf/autoload_configs/perl.conf.xml index 83732890c6..b2435000ff 100644 --- a/conf/autoload_configs/perl.conf.xml +++ b/conf/autoload_configs/perl.conf.xml @@ -2,5 +2,15 @@ + + + + + diff --git a/src/mod/languages/mod_perl/mod_perl.c b/src/mod/languages/mod_perl/mod_perl.c index fa750f9d30..c68da54aef 100644 --- a/src/mod/languages/mod_perl/mod_perl.c +++ b/src/mod/languages/mod_perl/mod_perl.c @@ -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");