[SR-Dev] git:master: rtimer: update to use the new sr core routes list

Daniel-Constantin Mierla miconda at gmail.com
Fri May 8 18:32:24 CEST 2009


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri May  8 18:31:35 2009 +0200

rtimer: update to use the new sr core routes list

---

 modules_k/rtimer/rtimer_mod.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules_k/rtimer/rtimer_mod.c b/modules_k/rtimer/rtimer_mod.c
index d54124e..4313330 100644
--- a/modules_k/rtimer/rtimer_mod.c
+++ b/modules_k/rtimer/rtimer_mod.c
@@ -274,6 +274,7 @@ int stm_e_param(modparam_t type, void *val)
 	stm_route_t *rt;
 	stm_timer_t *nt;
 	str s;
+	char c;
 
 	if(val==NULL)
 		return -1;
@@ -291,7 +292,7 @@ int stm_e_param(modparam_t type, void *val)
 			tmp.timer = pit->body;
 		} else if(pit->name.len==5
 				&& strncasecmp(pit->name.s, "route", 5)==0) {
-			str2int(&pit->body, &tmp.route);
+			s = pit->body;
 		}
 	}
 	if(tmp.timer.s==NULL)
@@ -315,10 +316,14 @@ int stm_e_param(modparam_t type, void *val)
 		free_params(params_list);
 		return -1;
 	}
-	if(tmp.route>=RT_NO)
+	c = s.s[s.len];
+	s.s[s.len] = '\0';
+	tmp.route = route_get(&main_rt, s.s);
+	s.s[s.len] = c;
+	if(tmp.route == -1)
 	{
-		LM_ERR("invalid route number: %u\n",
-				tmp.route);
+		LM_ERR("invalid route: %.*s\n",
+				s.len, s.s);
 		free_params(params_list);
 		return -1;
 	}




More information about the sr-dev mailing list