From c51b55a46eb1aef0691373653b0df56c10d135d0 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 9adb2a7d9f..421a1416a0 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -3544,6 +3544,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);