--- func_curl.c 2019-10-16 15:50:40.000000000 +0000 +++ /usr/src/asterisk-16.6.1/funcs/func_curl.c 2020-09-02 17:48:17.049898395 +0000 @@ -711,6 +711,14 @@ * CURLOPT_ERRORBUFFER" (62bcf005f4678a93158358265ba905bace33b834). */ curl_easy_setopt(*curl, CURLOPT_ERRORBUFFER, (char*)NULL); + long http_code = 0; + ret=0; + curl_easy_getinfo (*curl, CURLINFO_RESPONSE_CODE, &http_code); + ast_log(LOG_WARNING, "Curl CURLINFO_RESPONSE_CODE (%ld).\n",http_code); + if (http_code == 404){ + ret=-1; + } + if (store) { AST_LIST_UNLOCK(list); } @@ -720,6 +728,7 @@ } if (args->cb_data.str && ast_str_strlen(args->cb_data.str)) { + ast_str_trim_blanks(args->cb_data.str); ast_debug(3, "CURL returned str='%s'\n", ast_str_buffer(args->cb_data.str)); @@ -745,7 +754,6 @@ ast_free(fields); ast_free(values); } - ret = 0; } if (chan) { @@ -940,3 +948,4 @@ .load_pri = AST_MODPRI_REALTIME_DEPEND2, .requires = "res_curl", ); +