Module: kamailio Branch: master Commit: 62c7a4b35d335374d231324f42843afef8e0d6a5 URL: https://github.com/kamailio/kamailio/commit/62c7a4b35d335374d231324f42843afe...
Author: Alex Hermann alex@hexla.nl Committer: Henning Westerholt henningw@users.noreply.github.com Date: 2019-02-11T21:42:26+01:00
tm: Add option to add path and flags to redirected contacts
---
Modified: src/modules/tm/doc/params.xml Modified: src/modules/tm/t_reply.c Modified: src/modules/tm/tm.c
---
Diff: https://github.com/kamailio/kamailio/commit/62c7a4b35d335374d231324f42843afe... Patch: https://github.com/kamailio/kamailio/commit/62c7a4b35d335374d231324f42843afe...
---
diff --git a/src/modules/tm/doc/params.xml b/src/modules/tm/doc/params.xml index 3692dab0d4..75b60d9b0a 100644 --- a/src/modules/tm/doc/params.xml +++ b/src/modules/tm/doc/params.xml @@ -1485,4 +1485,34 @@ modparam("tm", "relay_100", 1) </example> </section>
+ <section id="tm.p.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> +... +modparam("tm", "rich_redirect", 3) +.... + </programlisting> + </example> + </section> + </section> diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c index e2058cae78..e1e8051cf1 100644 --- a/src/modules/tm/t_reply.c +++ b/src/modules/tm/t_reply.c @@ -102,6 +102,8 @@ int goto_on_sl_reply=0;
/* remap 503 response code to 500 */ extern int tm_remap_503_500; +/* send path and flags in 3xx class reply */ +int tm_rich_redirect = 0;
/* how to deal with winning branch reply selection in failure_route * can be overwritten per transaction with t_drop_replies(...) @@ -640,7 +642,7 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
/* if that is a redirection message, dump current message set to it */ if (code>=300 && code<400) { - dset=print_dset(p_msg, &dset_len, 0); + dset=print_dset(p_msg, &dset_len, tm_rich_redirect); if (dset) { add_lump_rpl(p_msg, dset, dset_len, LUMP_RPL_HDR); } diff --git a/src/modules/tm/tm.c b/src/modules/tm/tm.c index c8afee9c4c..c4a277d824 100644 --- a/src/modules/tm/tm.c +++ b/src/modules/tm/tm.c @@ -475,6 +475,7 @@ static param_export_t params[]={ {"xavp_contact", PARAM_STR, &ulattrs_xavp_name }, {"event_callback", PARAM_STR, &tm_event_callback }, {"relay_100", PARAM_INT, &default_tm_cfg.relay_100 }, + {"rich_redirect" , PARAM_INT, &tm_rich_redirect }, {0,0,0} };