Module: kamailio Branch: 5.5 Commit: 5ecf17bc2d308141534bdaf3a312704daf0db850 URL: https://github.com/kamailio/kamailio/commit/5ecf17bc2d308141534bdaf3a312704d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-07-30T13:33:06+02:00
sworker: KSR.sworker.active() exported to kemi
- equivalent to existing sworker_active() config function
(cherry picked from commit 9f140ce93b1f6db649cd0e8eda26444d6b186231)
---
Modified: src/modules/sworker/sworker_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/5ecf17bc2d308141534bdaf3a312704d... Patch: https://github.com/kamailio/kamailio/commit/5ecf17bc2d308141534bdaf3a312704d...
---
diff --git a/src/modules/sworker/sworker_mod.c b/src/modules/sworker/sworker_mod.c index 33ee3361bd..e6dce05c9b 100644 --- a/src/modules/sworker/sworker_mod.c +++ b/src/modules/sworker/sworker_mod.c @@ -196,6 +196,17 @@ static int w_sworker_task(sip_msg_t *msg, char *pgname, char *p2) return ki_sworker_task(msg, &gname); }
+/** + * + */ +static int ki_sworker_active(sip_msg_t *msg) +{ + if(_sworker_active==0) { + return -1; + } + return 1; +} + /** * */ @@ -217,6 +228,11 @@ static sr_kemi_t sr_kemi_sworker_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("sworker"), str_init("active"), + SR_KEMIP_INT, ki_sworker_active, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } } };