[sr-dev] git:master: tm: ignore avp timers with 0 or empty value

Andrei Pelinescu-Onciul andrei at iptel.org
Mon Jun 22 17:31:21 CEST 2009


Module: sip-router
Branch: master
Commit: bcc993680ca2722aec2e4f240569cb7979808e18
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bcc993680ca2722aec2e4f240569cb7979808e18

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Mon Jun 22 16:00:10 2009 +0200

tm: ignore avp timers with 0 or empty value

Kamailio compatibility: If an avp timer (fr_timer_avp or
fr_inv_timer_avp) is empty ("") or 0, use the default timer
value (fr_timer or fr_inv_timer).

Reported-by: Juha Heinanen  jh at tutpro com.

---

 modules/tm/t_funcs.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/tm/t_funcs.c b/modules/tm/t_funcs.c
index c228b60..d60c99e 100644
--- a/modules/tm/t_funcs.c
+++ b/modules/tm/t_funcs.c
@@ -416,8 +416,9 @@ int init_avp_params(char *fr_timer_param, char *fr_inv_timer_param,
 }
 
 
-/*
- * Get the FR_{INV}_TIMER from corresponding AVP
+/** Get the FR_{INV}_TIMER from corresponding AVP.
+ * @return 0 on success (use *timer) or 1 on failure (avp non-existent,
+ *  avp present  but empty/0, avp value not numeric).
  */
 static inline int avp2timer(unsigned int* timer, int type, int_str name)
 {
@@ -443,7 +444,7 @@ static inline int avp2timer(unsigned int* timer, int type, int_str name)
 		*timer = val_istr.n;
 	}
 
-	return 0;
+	return *timer==0; /* 1 if 0 (use default), 0 if !=0 (use *timer) */
 }
 
 




More information about the sr-dev mailing list