]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6491 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Apr 2014 16:16:52 +0000 (21:16 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Apr 2014 16:20:02 +0000 (21:20 +0500)
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

index bf6cc8ed0ecc629d2d54566c87767acb9d463ca4..7dbb1843cbe3753db215f3ead3b8a3109e47d5f5 100644 (file)
@@ -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);