From aa7f0bf1b2f3947a49f3012c5bf5661f19b5d876 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Fri, 26 Oct 2007 13:54:30 +0000 Subject: [PATCH] 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/branches/1.4@87120 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- funcs/func_curl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/funcs/func_curl.c b/funcs/func_curl.c index 940dfd8e21..63d6a05970 100644 --- a/funcs/func_curl.c +++ b/funcs/func_curl.c @@ -145,7 +145,8 @@ static int acf_curl_exec(struct ast_channel *chan, char *cmd, char *info, char * 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) { @@ -160,7 +161,8 @@ static int acf_curl_exec(struct ast_channel *chan, char *cmd, char *info, char * ast_log(LOG_ERROR, "Cannot allocate curl structure\n"); } - ast_autoservice_stop(chan); + if (chan) + ast_autoservice_stop(chan); ast_module_user_remove(u);