Module: sip-router
Branch: tmp/k3.0_sr_backports
Commit: 9ec0cfc8a2cae52c4bed6e0f777f220840ba30c7
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9ec0cfc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Jan 15 20:29:46 2010 +0100
tm: t_on_xyz("0") fixup updates
- if parameter of t_on_reply, t_on_failure, t_on_branch is 0 do not call
fix_routes and set the parameter value to 0
- resets previous calls of the function with non-zero value and does not
print warning message at startup because the route is not found
(cherry picked from commit 53d7cb1dae02e4709a10f869e8ec748df73bec37)
---
modules/tm/tm.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index 767b36e..cef4463 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -542,6 +542,11 @@ static int fixup_t_reply(void** param, int param_no)
static int fixup_on_failure(void** param, int param_no)
{
if (param_no==1){
+ if(strlen((char*)*param)<=1
+ && (*(char*)(*param)==0 || *(char*)(*param)=='0')) {
+ *param = (void*)0;
+ return 0;
+ }
return fixup_routes("t_on_failure", &failure_rt, param);
}
return 0;
@@ -552,6 +557,11 @@ static int fixup_on_failure(void** param, int param_no)
static int fixup_on_reply(void** param, int param_no)
{
if (param_no==1){
+ if(strlen((char*)*param)<=1
+ && (*(char*)(*param)==0 || *(char*)(*param)=='0')) {
+ *param = (void*)0;
+ return 0;
+ }
return fixup_routes("t_on_reply", &onreply_rt, param);
}
return 0;
@@ -562,6 +572,11 @@ static int fixup_on_reply(void** param, int param_no)
static int fixup_on_branch(void** param, int param_no)
{
if (param_no==1){
+ if(strlen((char*)*param)<=1
+ && (*(char*)(*param)==0 || *(char*)(*param)=='0')) {
+ *param = (void*)0;
+ return 0;
+ }
return fixup_routes("t_on_branch", &branch_rt, param);
}
return 0;