From d93b1861c6e9be5991040d2da327d2f543d9f9ab Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 13 Aug 2019 09:15:43 +0200 Subject: [PATCH] http_client: docs for query_result parameter --- .../http_client/doc/http_client_admin.xml | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/modules/http_client/doc/http_client_admin.xml b/src/modules/http_client/doc/http_client_admin.xml index 70bcd2a433f..55c65ccc977 100644 --- a/src/modules/http_client/doc/http_client_admin.xml +++ b/src/modules/http_client/doc/http_client_admin.xml @@ -36,10 +36,10 @@ Like in SIP, the HTTP URL may need encoding to be transported safely over the network. Check the string encoding functions in the Transformation - Cookbook (as used in the http_client_query example below). + Cookbook (as used in the http_client_query() example below). - The function http_client_query allows &kamailio; to issue an HTTP GET + The function http_client_query() allows &kamailio; to issue an HTTP GET request and get access to parts of the reply. This function has been ported from the utils module and now use the same libcurl functions. We recommend using the new functionality provided by @@ -433,6 +433,31 @@ modparam("http_client", "authmethod", 3) ... modparam("http_client", "keep_connections", 1) +... + + + +
+ <varname>query_result</varname> (int) + + Control what is returned by the http_client_query(...) in the result + variable. + + + Valid values are: + + 0 - Return the entire HTTP result body + 1 - Return the first oine from HTTP result body + + + + Default value: 1 (return first line). + + + Set <varname>query_result</varname> parameter + +... +modparam("http_client", "query_result", 0) ... @@ -796,17 +821,18 @@ http_get_redirect("apiserver", "$var(targeturl)"); If HTTP server returns a class 2xx, 3xx or 4xx reply, - the first line of the reply's body (if any) is + the first line or the entire reply body (if any) is stored in result parameter, - which must be a writable pseudo variable. + which must be a writable pseudo variable. See the query_result + parameter for controling what value to be stored in the result + variable. Function returns reply code of HTTP reply or -1 if something went wrong. - This function can be used from REQUEST_ROUTE, - ONREPLY_ROUTE, FAILURE_ROUTE, and BRANCH_ROUTE. + This function can be used from ANY_ROUTE. Note that this function is based on the http_query function in the utils module.