Module: kamailio Branch: master Commit: a7aa7a7c5a863d4d1f4e31fc307bb57051e26627 URL: https://github.com/kamailio/kamailio/commit/a7aa7a7c5a863d4d1f4e31fc307bb570...
Author: Olle E. Johansson oej@edvina.net Committer: Olle E. Johansson oej@edvina.net Date: 2016-02-03T17:03:53+01:00
http_client Add configuration file example
---
Modified: modules/http_client/README Modified: modules/http_client/doc/http_client_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/a7aa7a7c5a863d4d1f4e31fc307bb570... Patch: https://github.com/kamailio/kamailio/commit/a7aa7a7c5a863d4d1f4e31fc307bb570...
---
diff --git a/modules/http_client/README b/modules/http_client/README index 668899a..6ac84aa 100644 --- a/modules/http_client/README +++ b/modules/http_client/README @@ -85,8 +85,9 @@ Carsten Bock 1.10. Set tlsverifyhost parameter 1.11. Set httpcon parameter 1.12. Set config_file parameter - 1.13. http_connect() usage - 1.14. curl_http_query() usage + 1.13. Short http_client config file + 1.14. http_connect() usage + 1.15. curl_http_query() usage
Chapter 1. Admin Guide
@@ -404,11 +405,28 @@ tstuff;timeout=12")
By default no config file is specified.
+ All the parameters that take filenames as values will be resolved using + the same rules as for the tls config filename itself: starting with a + '.' means relative to the working directory, a '/' means an absolute + path and anything else a path relative to the directory of the current + Kamailio main config file. + Example 1.12. Set config_file parameter ... modparam("http_client", "config_file", "httpconnections.cfg) ...
+ Example 1.13. Short http_client config file +[authapiserver] +url = https://api.runbo.example.com/v4.2/auth +timeout = 1 +maxdatasize = 4 +tlsversion = TLSv2 +verify_peer = yes +client_key = default_key.pem +client_cert = default_cert.pem +http_follow_redirect = no + 4. Functions
4.1. http_connect(connection, url, [content_type, data,] result) @@ -436,7 +454,7 @@ modparam("http_client", "config_file", "httpconnections.cfg) This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, and BRANCH_ROUTE.
- Example 1.13. http_connect() usage + Example 1.14. http_connect() usage ... modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/"); ... @@ -474,7 +492,7 @@ xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n" utils module. It is changed to use the same base library and settings as the rest of the functions in this module.
- Example 1.14. curl_http_query() usage + Example 1.15. curl_http_query() usage ... # GET-Request http_client_query("http://tutpro.com/index.php?r_uri=$(ru%7Bs.escape.param%7D)&f_uri diff --git a/modules/http_client/doc/http_client_admin.xml b/modules/http_client/doc/http_client_admin.xml index bcb5335..e49a87e 100644 --- a/modules/http_client/doc/http_client_admin.xml +++ b/modules/http_client/doc/http_client_admin.xml @@ -399,6 +399,13 @@ modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge <para> By default no config file is specified. </para> + <para> + All the parameters that take filenames as values will be resolved + using the same rules as for the tls config filename itself: starting + with a '.' means relative to the working directory, a '/' means an + absolute path and anything else a path relative to the directory of + the current &kamailio; main config file. + </para> <example> <title>Set <varname>config_file</varname> parameter</title> <programlisting format="linespecific"> @@ -407,6 +414,22 @@ modparam("http_client", "config_file", "httpconnections.cfg) ... </programlisting> </example> + <example> + <title>Short http_client config file</title> + <programlisting> +[authapiserver] +url = https://api.runbo.example.com/v4.2/auth +timeout = 1 +maxdatasize = 4 +tlsversion = TLSv2 +verify_peer = yes +client_key = default_key.pem +client_cert = default_cert.pem +http_follow_redirect = no + + </programlisting> + </example> + </section> </section>