Module: kamailio
Branch: master
Commit: 6da06e2683b484c19eac27b757c1f2e565aa2e5d
URL:
https://github.com/kamailio/kamailio/commit/6da06e2683b484c19eac27b757c1f2e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-08-17T21:27:36+02:00
ruxc: added http_retry modparam
---
Modified: src/modules/ruxc/doc/ruxc_admin.xml
Modified: src/modules/ruxc/ruxc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6da06e2683b484c19eac27b757c1f2e…
Patch:
https://github.com/kamailio/kamailio/commit/6da06e2683b484c19eac27b757c1f2e…
---
diff --git a/src/modules/ruxc/doc/ruxc_admin.xml b/src/modules/ruxc/doc/ruxc_admin.xml
index 794301bc06..d0cd3bf7f7 100644
--- a/src/modules/ruxc/doc/ruxc_admin.xml
+++ b/src/modules/ruxc/doc/ruxc_admin.xml
@@ -121,6 +121,25 @@ modparam("ruxc", "http_tlsmode", 1)
...
modparam("ruxc", "http_reuse", 1)
...
+</programlisting>
+ </example>
+ </section>
+ <section id="ruxc.p.http_retry">
+ <title><varname>http_retry</varname> (int)</title>
+ <para>
+ How many times to retry if the HTTP request does not get a 200ok response.
+ </para>
+ <para>
+ <emphasis>
+ Default value is 0 (no retry).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>http_retry</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("ruxc", "http_retry", 2)
+...
</programlisting>
</example>
</section>
diff --git a/src/modules/ruxc/ruxc_mod.c b/src/modules/ruxc/ruxc_mod.c
index 02fa278859..13c4a54b52 100644
--- a/src/modules/ruxc/ruxc_mod.c
+++ b/src/modules/ruxc/ruxc_mod.c
@@ -41,6 +41,7 @@ MODULE_VERSION
static int _ruxc_http_timeout = 5000;
static int _ruxc_http_tlsmode = 0;
static int _ruxc_http_reuse = 0;
+static int _ruxc_http_retry = 0;
static int mod_init(void);
static int child_init(int);
@@ -75,6 +76,7 @@ static param_export_t params[]={
{"http_timeout", PARAM_INT, &_ruxc_http_timeout},
{"http_tlsmode", PARAM_INT, &_ruxc_http_tlsmode},
{"http_reuse", PARAM_INT, &_ruxc_http_reuse},
+ {"http_retry", PARAM_INT, &_ruxc_http_retry},
{0, 0, 0}
};
@@ -135,6 +137,7 @@ static int ki_ruxc_http_get_helper(sip_msg_t *_msg, str *url, str
*hdrs,
v_http_request.timeout_write = _ruxc_http_timeout;
v_http_request.tlsmode = _ruxc_http_tlsmode;
v_http_request.reuse = _ruxc_http_reuse;
+ v_http_request.retry = _ruxc_http_retry;
v_http_request.url = url->s;
v_http_request.url_len = url->len;
@@ -233,6 +236,7 @@ static int ki_ruxc_http_post_helper(sip_msg_t *_msg, str *url, str
*body, str *h
v_http_request.timeout_write = _ruxc_http_timeout;
v_http_request.tlsmode = _ruxc_http_tlsmode;
v_http_request.reuse = _ruxc_http_reuse;
+ v_http_request.retry = _ruxc_http_retry;
v_http_request.url = url->s;
v_http_request.url_len = url->len;