[sr-dev] git:master:37cf1433: timer: revert to use of route_get()

Daniel-Constantin Mierla miconda at gmail.com
Sun Oct 29 09:14:41 CET 2017


Module: kamailio
Branch: master
Commit: 37cf1433af55a8744dfccee873699e17b06b8ac4
URL: https://github.com/kamailio/kamailio/commit/37cf1433af55a8744dfccee873699e17b06b8ac4

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-10-29T08:57:33+01:00

timer: revert to use of route_get()

- route block is searched prior of being declared due to modparam
  callback

---

Modified: src/modules/timer/timer.c

---

Diff:  https://github.com/kamailio/kamailio/commit/37cf1433af55a8744dfccee873699e17b06b8ac4.diff
Patch: https://github.com/kamailio/kamailio/commit/37cf1433af55a8744dfccee873699e17b06b8ac4.patch

---

diff --git a/src/modules/timer/timer.c b/src/modules/timer/timer.c
index 4643db95fa..f6a739a2be 100644
--- a/src/modules/timer/timer.c
+++ b/src/modules/timer/timer.c
@@ -335,7 +335,6 @@ static int declare_timer(modparam_t type, char* param)
 	char *p, *save_p, c, *timer_name;
 	str s;
 	str route_name = STR_NULL;
-	sr_kemi_eng_t *keng = NULL;
 
 	timer_name = 0;
 	save_p = p = param;
@@ -359,16 +358,10 @@ static int declare_timer(modparam_t type, char* param)
 	}
 	c = s.s[s.len];
 	s.s[s.len] = '\0';
-	keng = sr_kemi_eng_get();
-	if(keng==NULL) {
-		n = route_lookup(&main_rt, s.s);
-		s.s[s.len] = c;
-		if (n == -1) goto err;
-		route_no = n;
-	} else {
-		s.s[s.len] = c;
-		route_no = -1;
-	}
+	n = route_get(&main_rt, s.s);
+	s.s[s.len] = c;
+	if (n == -1) goto err;
+	route_no = n;
 	route_name = s;
 
 	save_p = p;




More information about the sr-dev mailing list