Module: sip-router
Branch: master
Commit: 9d472adf9d2dd7241feeedd6b64699e2a6485fd0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9d472ad…
Author: Andreas Heise <Andreas.Heise(a)nextiraone.de>
Committer: Jan Janak <jan(a)iptel.org>
Date: Thu Mar 19 16:32:58 2009 +0100
Support for auto_inv_100_reason tm parameter.
This patch adds support for auto_inv_100_reason parameter in tm module.
The patch was created originally for kamailio and we merge it into the
sr version of tm module too. The parameter allows to configure the
reason phrase used in 100 replies.
Signed-off-by: Jan Janak <jan(a)iptel.org>
---
modules/tm/config.c | 3 +++
modules/tm/config.h | 1 +
modules/tm/doc/params.xml | 25 +++++++++++++++++++++++--
modules/tm/t_funcs.c | 2 +-
modules/tm/tm.c | 4 +++-
5 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/modules/tm/config.c b/modules/tm/config.c
index ffa3892..3303560 100644
--- a/modules/tm/config.c
+++ b/modules/tm/config.c
@@ -66,6 +66,7 @@ struct cfg_group_tm default_tm_cfg = {
MAX_NONINV_LIFETIME, /* tm_max_noninv_lifetime */
1, /* noisy_ctimer */
1, /* tm_auto_inv_100 */
+ "trying -- your call is important to us", /* tm_auto_inv_100_r */
500, /* tm_unix_tx_timeout -- 500 ms by default */
1, /* restart_fr_on_each_reply */
0, /* pass_provisional_replies */
@@ -126,6 +127,8 @@ cfg_def_t tm_cfg_def[] = {
"will be always replied"},
{"auto_inv_100", CFG_VAR_INT, 0, 1, 0, 0,
"automatically send 100 to an INVITE"},
+ {"auto_inv_100_reason", CFG_VAR_STRING, 0, 0, 0, 0,
+ "reason text of the automatically send 100 to an INVITE"},
{"unix_tx_timeout", CFG_VAR_INT, 0, 0, 0, 0,
"Unix socket transmission timeout, in milliseconds"},
{"restart_fr_on_each_reply", CFG_VAR_INT, 0, 1, 0, 0,
diff --git a/modules/tm/config.h b/modules/tm/config.h
index cf2227d..c2936ea 100644
--- a/modules/tm/config.h
+++ b/modules/tm/config.h
@@ -111,6 +111,7 @@ struct cfg_group_tm {
unsigned int tm_max_noninv_lifetime;
int noisy_ctimer;
int tm_auto_inv_100;
+ char *tm_auto_inv_100_r;
int tm_unix_tx_timeout;
int restart_fr_on_each_reply;
int pass_provisional_replies;
diff --git a/modules/tm/doc/params.xml b/modules/tm/doc/params.xml
index 2fc1723..1b61a59 100644
--- a/modules/tm/doc/params.xml
+++ b/modules/tm/doc/params.xml
@@ -332,8 +332,8 @@ modparam("tm", "restart_fr_on_each_reply", 0)
Default value is 1 (on).
</para>
<para>
- See also:
- <function>t_set_auto_inv_100()</function>.
+ See also: <function>t_set_auto_inv_100()</function>
+ <varname>auto_inv_100_reason</varname>.
</para>
<example>
<title>Set <varname>auto_inv_100</varname> parameter</title>
@@ -345,6 +345,27 @@ modparam("tm", "auto_inv_100", 0)
</example>
</section>
+ <section id="auto_inv_100_reason">
+ <title><varname>auto_inv_100_reason</varname> (string)</title>
+ <para>
+ Set reason text of the automatically send 100 to an INVITE.
+ </para>
+ <para>
+ Default value is "trying -- your call is important to us".
+ </para>
+ <para>
+ See also: <varname>auto_inv_100</varname>.
+ </para>
+ <example>
+ <title>Set <varname>auto_inv_100_reason</varname>
parameter</title>
+ <programlisting>
+...
+modparam("tm", "auto_inv_100_reason", "Trying")
+...
+ </programlisting>
+ </example>
+ </section>
+
<section id="unix_tx_timeout">
<title><varname>unix_tx_timeout</varname> (integer)</title>
<para>
diff --git a/modules/tm/t_funcs.c b/modules/tm/t_funcs.c
index 5f62f0e..f07b002 100644
--- a/modules/tm/t_funcs.c
+++ b/modules/tm/t_funcs.c
@@ -324,7 +324,7 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int
proto,
{
DBG( "SER: new INVITE\n");
if (!t_reply( t, p_msg , 100 ,
- "trying -- your call is important to us"))
+ cfg_get(tm, tm_cfg, tm_auto_inv_100_r)))
DBG("SER: ERROR: t_reply (100)\n");
}
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index ecb42ed..538e683 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -90,7 +90,8 @@
* t_relay_to_{udp,tcp,tls}(<no param>) (force protocol, but
* forward to uri) (andrei)
* 2008-08-11 sctp support: t_relay_to_sctp, t_replicate_sctp,
- * t_forward_nonack_sctp (andrei
+ * t_forward_nonack_sctp (andrei)
+ * 2009-03-18 added a new param: auto_inv_100_reason (aheise)
*/
@@ -425,6 +426,7 @@ static param_export_t params[]={
{"max_noninv_lifetime", PARAM_INT,
&default_tm_cfg.tm_max_noninv_lifetime},
{"noisy_ctimer", PARAM_INT, &default_tm_cfg.noisy_ctimer
},
{"auto_inv_100", PARAM_INT, &default_tm_cfg.tm_auto_inv_100
},
+ {"auto_inv_100_reason", PARAM_STRING, &default_tm_cfg.tm_auto_inv_100_r
},
{"unix_tx_timeout", PARAM_INT, &default_tm_cfg.tm_unix_tx_timeout
},
{"restart_fr_on_each_reply", PARAM_INT,
&default_tm_cfg.restart_fr_on_each_reply},