Module: kamailio
Branch: master
Commit: 09d9a34923fa2ca3441f8b67a740383466a92481
URL:
https://github.com/kamailio/kamailio/commit/09d9a34923fa2ca3441f8b67a740383…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-11-26T13:25:50+01:00
sworker: restrict use of sworker_task() in pre-processing phase
- allow execution only in event_route[core:pre-routing]
---
Modified: src/modules/sworker/sworker_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/09d9a34923fa2ca3441f8b67a740383…
Patch:
https://github.com/kamailio/kamailio/commit/09d9a34923fa2ca3441f8b67a740383…
---
diff --git a/src/modules/sworker/sworker_mod.c b/src/modules/sworker/sworker_mod.c
index bf3782e5cb..33ee3361bd 100644
--- a/src/modules/sworker/sworker_mod.c
+++ b/src/modules/sworker/sworker_mod.c
@@ -167,12 +167,15 @@ int ki_sworker_task(sip_msg_t *msg, str *gname)
return -1;
}
+ if(!(msg->rcv.rflags & RECV_F_PREROUTING)) {
+ LM_WARN("not used in pre-routing phase\n");
+ return -1;
+ }
if(sworker_send_task(msg, gname) < 0) {
return -1;
}
- /* force exit in config */
- return 0;
+ return 1;
}
/**