sl: Add option to add path and flags to redirected contacts
authorAlex Hermann <alex@hexla.nl>
Thu, 31 Jan 2019 16:28:31 +0000 (17:28 +0100)
committerHenning Westerholt <henningw@users.noreply.github.com>
Mon, 11 Feb 2019 20:42:26 +0000 (21:42 +0100)
src/modules/sl/doc/sl_params.xml
src/modules/sl/sl.c
src/modules/sl/sl_funcs.c
src/modules/sl/sl_funcs.h

index f6ee54b..79db29a 100644 (file)
@@ -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>
index 36c8a8e..10361b1 100644 (file)
@@ -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}
 };
index c9730d7..7cdce0c 100644 (file)
@@ -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);
                }
index 659061f..53711ef 100644 (file)
@@ -30,6 +30,8 @@
 
 #define SL_TOTAG_SEPARATOR '.'
 
+extern int sl_rich_redirect;
+
 int sl_startup();
 int sl_shutdown();