Module: kamailio
Branch: master
Commit: ea96ddf5ab1716855afe1fe4f0efe32dc1d765f4
URL:
https://github.com/kamailio/kamailio/commit/ea96ddf5ab1716855afe1fe4f0efe32…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2019-02-11T21:42:26+01:00
sl: Add option to add path and flags to redirected contacts
---
Modified: src/modules/sl/doc/sl_params.xml
Modified: src/modules/sl/sl.c
Modified: src/modules/sl/sl_funcs.c
Modified: src/modules/sl/sl_funcs.h
---
Diff:
https://github.com/kamailio/kamailio/commit/ea96ddf5ab1716855afe1fe4f0efe32…
Patch:
https://github.com/kamailio/kamailio/commit/ea96ddf5ab1716855afe1fe4f0efe32…
---
diff --git a/src/modules/sl/doc/sl_params.xml b/src/modules/sl/doc/sl_params.xml
index f6ee54ba3d..79db29ab88 100644
--- a/src/modules/sl/doc/sl_params.xml
+++ b/src/modules/sl/doc/sl_params.xml
@@ -61,4 +61,34 @@ modparam("sl", "bind_tm", 0) # feature disabled
</example>
</section>
+ <section id="rich_redirect">
+ <title><varname>rich_redirect</varname> (int)</title>
+ <para>
+ When sending a 3xx class reply, include additional branch info
+ to the contacts such as path vector and branch flags.
+ </para>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>0</emphasis> - no extra info is added (default)
+ </para></listitem>
+ <listitem><para>
+ <emphasis>1</emphasis> - include branch flags as contact header parameter
+ </para></listitem>
+ <listitem><para>
+ <emphasis>2</emphasis> - include path as contact uri Route header
+ </para></listitem>
+ </itemizedlist>
+ <para>
+ Values may be combined (added).
+ </para>
+ <example>
+ <title>rich_redirect example</title>
+ <programlisting format="linespecific">
+...
+modparam("sl", "rich_redirect", 3)
+...
+ </programlisting>
+ </example>
+ </section>
+
</section>
diff --git a/src/modules/sl/sl.c b/src/modules/sl/sl.c
index 36c8a8eec7..10361b12e1 100644
--- a/src/modules/sl/sl.c
+++ b/src/modules/sl/sl.c
@@ -116,6 +116,7 @@ static param_export_t params[] = {
{"default_code", PARAM_INT, &default_code},
{"default_reason", PARAM_STR, &default_reason},
{"bind_tm", PARAM_INT, &sl_bind_tm},
+ {"rich_redirect", PARAM_INT, &sl_rich_redirect},
{0, 0, 0}
};
diff --git a/src/modules/sl/sl_funcs.c b/src/modules/sl/sl_funcs.c
index c9730d7195..7cdce0cda2 100644
--- a/src/modules/sl/sl_funcs.c
+++ b/src/modules/sl/sl_funcs.c
@@ -55,6 +55,9 @@ static int _sl_filtered_ack_route = -1; /* default disabled */
static int _sl_evrt_local_response = -1; /* default disabled */
+/* send path and flags in 3xx class reply */
+int sl_rich_redirect = 0;
+
/*!
* lookup sl event routes
*/
@@ -150,7 +153,7 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str
*tag)
/* if that is a redirection message, dump current message set to it */
if (code>=300 && code<400) {
- dset.s=print_dset(msg, &dset.len, 0);
+ dset.s=print_dset(msg, &dset.len, sl_rich_redirect);
if (dset.s) {
add_lump_rpl(msg, dset.s, dset.len, LUMP_RPL_HDR);
}
diff --git a/src/modules/sl/sl_funcs.h b/src/modules/sl/sl_funcs.h
index 659061f366..53711efd37 100644
--- a/src/modules/sl/sl_funcs.h
+++ b/src/modules/sl/sl_funcs.h
@@ -30,6 +30,8 @@
#define SL_TOTAG_SEPARATOR '.'
+extern int sl_rich_redirect;
+
int sl_startup();
int sl_shutdown();