Browse code

sworker: KSR.sworker.active() exported to kemi

- equivalent to existing sworker_active() config function

Daniel-Constantin Mierla authored on 30/07/2021 11:31:30
Showing 1 changed files
... ...
@@ -196,6 +196,17 @@ static int w_sworker_task(sip_msg_t *msg, char *pgname, char *p2)
196 196
 	return ki_sworker_task(msg, &gname);
197 197
 }
198 198
 
199
+/**
200
+ *
201
+ */
202
+static int ki_sworker_active(sip_msg_t *msg)
203
+{
204
+	if(_sworker_active==0) {
205
+		return -1;
206
+	}
207
+	return 1;
208
+}
209
+
199 210
 /**
200 211
  *
201 212
  */
... ...
@@ -217,6 +228,11 @@ static sr_kemi_t sr_kemi_sworker_exports[] = {
217 228
 		{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
218 229
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
219 230
 	},
231
+	{ str_init("sworker"), str_init("active"),
232
+		SR_KEMIP_INT, ki_sworker_active,
233
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
234
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
235
+	},
220 236
 
221 237
 	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
222 238
 };