]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
The System() and TrySystem() applications can take a substantial amount of
authorRussell Bryant <russell@russellbryant.com>
Wed, 19 Sep 2007 19:50:48 +0000 (19:50 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 19 Sep 2007 19:50:48 +0000 (19:50 +0000)
time to execute while not servicing the channel.  So, put the channel in
autoservice while the command is being executed.
(closes issue #10726, reported by mnicholson)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83179 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_system.c

index 4bada66b23e5bf0bf54089238c78b79b192de298..b60e11c5a2b320861b06995ba9cd4bba6c936fdb 100644 (file)
@@ -95,6 +95,8 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
 
        u = ast_module_user_add(chan);
 
+       ast_autoservice_start(chan);
+
        /* Do our thing here */
        res = ast_safe_system((char *)data);
        if ((res < 0) && (errno != ECHILD)) {
@@ -118,6 +120,8 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
                res = 0;
        } 
 
+       ast_autoservice_stop(chan);
+
        ast_module_user_remove(u);
 
        return res;