From 28babdea4ed2e0551ee7c8b53f945d39290a397d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 28 Apr 2014 21:16:52 +0500 Subject: [PATCH] FS-6491 --resolve This seems to be a paradox when running a perl script from a session then executing perl again on the same session from a different thread. I fixed it by converting any execution of perl in the execute_on_* family of operators to only run background mode which is to store the command in the session stack to be executed only by the session thread instead of on the spot by the outide thread. changing the execute_on_answer to perl::/path/to/script.pl would also eliminate the crash in code that has not been updated with this patch. This is just a limitation of embedded perl we have to live with. --- src/switch_channel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/switch_channel.c b/src/switch_channel.c index bf6cc8ed0e..7dbb1843cb 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -3519,6 +3519,9 @@ static void do_execute_on(switch_channel_t *channel, const char *variable) } } + if (!strncasecmp(app, "perl", 4)) { + bg++; + } if (bg) { switch_core_session_execute_application_async(channel->session, app, arg); -- 2.47.2