Module: kamailio
Branch: master
Commit: d2479c96891db6656dbe880c6600d18f5fa38e33
URL:
https://github.com/kamailio/kamailio/commit/d2479c96891db6656dbe880c6600d18…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-03-23T08:34:34+01:00
evrexec: use route_get() in modparam callback
- routing blocks might not have been parsed yet
---
Modified: src/modules/evrexec/evrexec_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d2479c96891db6656dbe880c6600d18…
Patch:
https://github.com/kamailio/kamailio/commit/d2479c96891db6656dbe880c6600d18…
---
diff --git a/src/modules/evrexec/evrexec_mod.c b/src/modules/evrexec/evrexec_mod.c
index a91ab4d9f7..0fdd06923a 100644
--- a/src/modules/evrexec/evrexec_mod.c
+++ b/src/modules/evrexec/evrexec_mod.c
@@ -158,7 +158,12 @@ void evrexec_process(evrexec_task_t *it, int idx)
if(it->wait>0) sleep_us(it->wait);
keng = sr_kemi_eng_get();
if(keng==NULL) {
- run_top_route(event_rt.rlist[it->rtid], fmsg, 0);
+ if(it->rtid>=0 && event_rt.rlist[it->rtid]!=NULL) {
+ run_top_route(event_rt.rlist[it->rtid], fmsg, 0);
+ } else {
+ LM_WARN("empty event route block [%.*s]\n",
+ it->ename.len, it->ename.s);
+ }
} else {
sidx.s = int2str(idx, &sidx.len);
if(keng->froute(fmsg, EVENT_ROUTE,
@@ -227,7 +232,7 @@ int evrexec_param(modparam_t type, void *val)
tmp.ename.s[tmp.ename.len] = '\0';
keng = sr_kemi_eng_get();
if(keng==NULL) {
- tmp.rtid = route_lookup(&event_rt, tmp.ename.s);
+ tmp.rtid = route_get(&event_rt, tmp.ename.s);
if(tmp.rtid == -1) {
LM_ERR("event route not found: %.*s\n", tmp.ename.len, tmp.ename.s);
free_params(params_list);