Module: kamailio
Branch: master
Commit: a7aa7a7c5a863d4d1f4e31fc307bb57051e26627
URL: https://github.com/kamailio/kamailio/commit/a7aa7a7c5a863d4d1f4e31fc307bb57…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)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/a7aa7a7c5a863d4d1f4e31fc307bb57…
Patch: https://github.com/kamailio/kamailio/commit/a7aa7a7c5a863d4d1f4e31fc307bb57…
---
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{s.escape.param})&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>
Module: kamailio
Branch: master
Commit: 0a1b5df76fededb0b9e065cd607d974bf8f333b5
URL: https://github.com/kamailio/kamailio/commit/0a1b5df76fededb0b9e065cd607d974…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2016-02-03T16:58:30+01:00
tls fix typo in README
---
Modified: modules/tls/README
Modified: modules/tls/doc/params.xml
---
Diff: https://github.com/kamailio/kamailio/commit/0a1b5df76fededb0b9e065cd607d974…
Patch: https://github.com/kamailio/kamailio/commit/0a1b5df76fededb0b9e065cd607d974…
---
diff --git a/modules/tls/README b/modules/tls/README
index da74077..75ebc01 100644
--- a/modules/tls/README
+++ b/modules/tls/README
@@ -1142,7 +1142,7 @@ modparam("tls", "renegotiation", 1)
configuration files from configuration directory, in which different
TLS parameters can be specified on a per role (server or client) and
domain basis (for now only IPs). The corresponding module parameters
- will be ignored if a separate configuraiton file is used.
+ will be ignored if a separate configuration file is used.
If the file or directory name starts with a '.' the path will be
relative to the working directory (at runtime). If it starts with a '/'
diff --git a/modules/tls/doc/params.xml b/modules/tls/doc/params.xml
index 397e83f..9d438ce 100644
--- a/modules/tls/doc/params.xml
+++ b/modules/tls/doc/params.xml
@@ -1004,7 +1004,7 @@ modparam("tls", "renegotiation", 1)
If set the TLS module will load a special configuration file or configuration files
from configuration directory, in which different TLS parameters can be specified on a per role (server or
client) and domain basis (for now only IPs). The corresponding module
- parameters will be ignored if a separate configuraiton file is used.
+ parameters will be ignored if a separate configuration file is used.
</para>
<para>
If the file or directory name starts with a '.' the path will be relative to the
Module: kamailio
Branch: master
Commit: e3bb82b99a0e8174852c180d567101d7d97ce370
URL: https://github.com/kamailio/kamailio/commit/e3bb82b99a0e8174852c180d567101d…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2016-02-03T16:57:34+01:00
http_client update README
---
Modified: modules/http_client/README
---
Diff: https://github.com/kamailio/kamailio/commit/e3bb82b99a0e8174852c180d567101d…
Patch: https://github.com/kamailio/kamailio/commit/e3bb82b99a0e8174852c180d567101d…
---
diff --git a/modules/http_client/README b/modules/http_client/README
index 88c4d80..668899a 100644
--- a/modules/http_client/README
+++ b/modules/http_client/README
@@ -42,6 +42,7 @@ Carsten Bock
3.9. tlsverifypeer (int)
3.10. tlsverifyhost (int)
3.11. httpcon (string)
+ 3.12. config_file (string)
4. Functions
@@ -83,8 +84,9 @@ Carsten Bock
1.9. Set tlsverifypeer parameter
1.10. Set tlsverifyhost parameter
1.11. Set httpcon parameter
- 1.12. http_connect() usage
- 1.13. curl_http_query() usage
+ 1.12. Set config_file parameter
+ 1.13. http_connect() usage
+ 1.14. curl_http_query() usage
Chapter 1. Admin Guide
@@ -109,6 +111,7 @@ Chapter 1. Admin Guide
3.9. tlsverifypeer (int)
3.10. tlsverifyhost (int)
3.11. httpcon (string)
+ 3.12. config_file (string)
4. Functions
@@ -141,6 +144,10 @@ Chapter 1. Admin Guide
and much more either using modparam settings or parameters to the
connection definition.
+ The connections can either be defined with the "httpcon" module
+ parameter or in a separate configuration file, as specified by the
+ "config_file" module parameter.
+
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
@@ -180,6 +187,7 @@ Chapter 1. Admin Guide
3.9. tlsverifypeer (int)
3.10. tlsverifyhost (int)
3.11. httpcon (string)
+ 3.12. config_file (string)
3.1. httpredirect (int)
@@ -363,6 +371,44 @@ modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge
tstuff;timeout=12")
...
+3.12. config_file (string)
+
+ The file name of a configuration file containing definitions of http
+ connections. This is an alternative to the "httpcon" module parameter -
+ especially when the number of options per line gets too big.
+
+ If the file or directory name starts with a '.' the path will be
+ relative to the working directory (at runtime). If it starts with a '/'
+ it will be an absolute path and if it starts with anything else the
+ path will be relative to the main config file directory (e.g.: for
+ kamailio -f /etc/kamailio/kamailio.cfg it will be relative to
+ /etc/kamailio/).
+
+ The following parameters can be set in the config file, for each
+ connection:
+ * url
+ * username
+ * password
+ * failover
+ * useragent
+ * verify_peer
+ * verify_host
+ * client_cert
+ * client_key
+ * tlsversion
+ * timeout
+ * maxdatasize
+ * http_follow_redirect
+
+ See the "httpcon" module parameter for explanation of these settings.
+
+ By default no config file is specified.
+
+ Example 1.12. Set config_file parameter
+...
+modparam("http_client", "config_file", "httpconnections.cfg)
+...
+
4. Functions
4.1. http_connect(connection, url, [content_type, data,] result)
@@ -390,7 +436,7 @@ tstuff;timeout=12")
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
FAILURE_ROUTE, and BRANCH_ROUTE.
- Example 1.12. http_connect() usage
+ Example 1.13. http_connect() usage
...
modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/");
...
@@ -428,7 +474,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.13. curl_http_query() usage
+ Example 1.14. curl_http_query() usage
...
# GET-Request
http_client_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_uri
Module: kamailio
Branch: master
Commit: 604a5c23f0abd15423c8846a5dd4e9403f6b3cd6
URL: https://github.com/kamailio/kamailio/commit/604a5c23f0abd15423c8846a5dd4e94…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2016-02-03T16:57:06+01:00
http_client Document new "config_file" module param
---
Modified: modules/http_client/doc/http_client_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/604a5c23f0abd15423c8846a5dd4e94…
Patch: https://github.com/kamailio/kamailio/commit/604a5c23f0abd15423c8846a5dd4e94…
---
diff --git a/modules/http_client/doc/http_client_admin.xml b/modules/http_client/doc/http_client_admin.xml
index adb22ca..bcb5335 100644
--- a/modules/http_client/doc/http_client_admin.xml
+++ b/modules/http_client/doc/http_client_admin.xml
@@ -28,6 +28,11 @@
connection definition.
</para>
<para>
+ The connections can either be defined with the "httpcon" module parameter
+ or in a separate configuration file, as specified by the "config_file" module
+ parameter.
+ </para>
+ <para>
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).
@@ -357,6 +362,52 @@ modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge
</programlisting>
</example>
</section>
+ <section id="http_client.p.config_file">
+ <title><varname>config_file</varname> (string)</title>
+ <para>
+ The file name of a configuration file containing definitions
+ of http connections. This is an alternative to the
+ "httpcon" module parameter - especially when the number of
+ options per line gets too big.
+ </para>
+ <para>
+ If the file or directory name starts with a '.' the path will be relative to the
+ working directory (<emphasis>at runtime</emphasis>). If it starts
+ with a '/' it will be an absolute path and if it starts with anything
+ else the path will be relative to the main config file directory
+ (e.g.: for kamailio -f /etc/kamailio/kamailio.cfg it will be relative to /etc/kamailio/).
+ </para>
+ <para>
+ The following parameters can be set in the config file, for each connection:
+ </para>
+ <itemizedlist>
+ <listitem><para>url</para></listitem>
+ <listitem><para>username</para></listitem>
+ <listitem><para>password</para></listitem>
+ <listitem><para>failover</para></listitem>
+ <listitem><para>useragent</para></listitem>
+ <listitem><para>verify_peer</para></listitem>
+ <listitem><para>verify_host</para></listitem>
+ <listitem><para>client_cert</para></listitem>
+ <listitem><para>client_key</para></listitem>
+ <listitem><para>tlsversion</para></listitem>
+ <listitem><para>timeout</para></listitem>
+ <listitem><para>maxdatasize</para></listitem>
+ <listitem><para>http_follow_redirect</para></listitem>
+ </itemizedlist>
+ See the "httpcon" module parameter for explanation of these settings.
+ <para>
+ By default no config file is specified.
+ </para>
+ <example>
+ <title>Set <varname>config_file</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("http_client", "config_file", "httpconnections.cfg)
+...
+ </programlisting>
+ </example>
+ </section>
</section>
<section>
Hi,
we renamed the module and functions according to the discussed guidelines.
If you are fine I can merge the module. Do you prefer a squashed commit?
Cheers,
Federico