Merged revisions 87120 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 26 Oct 2007 14:00:48 +0000 (14:00 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 26 Oct 2007 14:00:48 +0000 (14:00 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87120 | tilghman | 2007-10-26 08:54:30 -0500 (Fri, 26 Oct 2007) | 7 lines

The addition of autoservice to func_curl additionally made func_curl dependent
on the existence of a channel, with no real reason.  This should make func_curl
once again work without a channel.
Reported by jmls.
Fixed by tilghman.
Closes issue #11090

........

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

funcs/func_curl.c

index 514be8b..4e7b44e 100644 (file)
@@ -148,7 +148,8 @@ static int acf_curl_exec(struct ast_channel *chan, const char *cmd, char *info,
 
        AST_STANDARD_APP_ARGS(args, info);      
 
-       ast_autoservice_start(chan);
+       if (chan)
+               ast_autoservice_start(chan);
 
        if (!curl_internal(&chunk, args.url, args.postdata)) {
                if (chunk.memory) {
@@ -163,7 +164,8 @@ static int acf_curl_exec(struct ast_channel *chan, const char *cmd, char *info,
                ast_log(LOG_ERROR, "Cannot allocate curl structure\n");
        }
 
-       ast_autoservice_stop(chan);
+       if (chan)
+               ast_autoservice_stop(chan);
        
        return 0;
 }