Index: apps/app_curl.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_curl.c,v retrieving revision 1.18 diff -u -r1.18 app_curl.c --- apps/app_curl.c 8 Nov 2005 19:47:56 -0000 1.18 +++ apps/app_curl.c 9 Nov 2005 20:38:37 -0000 @@ -40,6 +40,7 @@ #include "asterisk/cli.h" #include "asterisk/options.h" #include "asterisk/module.h" +#include "asterisk/app.h" static char *tdesc = "Load external URL"; @@ -116,9 +117,13 @@ { int res = 0; struct localuser *u; - char *info, *post_data=NULL, *url; + char *info; struct MemoryStruct chunk = { NULL, 0 }; static int dep_warning = 0; + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(url); + AST_APP_ARG(postdata); + ); if (!dep_warning) { ast_log(LOG_WARNING, "The application Curl is deprecated. Please use the CURL() function instead.\n"); @@ -133,15 +138,14 @@ LOCAL_USER_ADD(u); if ((info = ast_strdupa(data))) { - url = strsep(&info, "|"); - post_data = info; + AST_STANDARD_APP_ARGS(args, info); } else { ast_log(LOG_ERROR, "Out of memory\n"); LOCAL_USER_REMOVE(u); return -1; } - if (! curl_internal(&chunk, url, post_data)) { + if (! curl_internal(&chunk, args.url, args.postdata)) { if (chunk.memory) { chunk.memory[chunk.size] = '\0'; if (chunk.memory[chunk.size - 1] == 10) @@ -163,8 +167,12 @@ static char *acf_curl_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { struct localuser *u; - char *info, *post_data=NULL, *url; + char *info; struct MemoryStruct chunk = { NULL, 0 }; + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(url); + AST_APP_ARG(postdata); + ); *buf = '\0'; @@ -181,11 +189,10 @@ LOCAL_USER_REMOVE(u); return buf; } + + AST_STANDARD_APP_ARGS(args, info); - url = strsep(&info, "|"); - post_data = info; - - if (! curl_internal(&chunk, url, post_data)) { + if (! curl_internal(&chunk, args.url, args.postdata)) { if (chunk.memory) { chunk.memory[chunk.size] = '\0'; if (chunk.memory[chunk.size - 1] == 10)