Browse code

sworker: restrict use of sworker_task() in pre-processing phase

- allow execution only in event_route[core:pre-routing]

Daniel-Constantin Mierla authored on 26/11/2020 12:25:50
Showing 1 changed files
... ...
@@ -167,12 +167,15 @@ int ki_sworker_task(sip_msg_t *msg, str *gname)
167 167
 		return -1;
168 168
 	}
169 169
 
170
+	if(!(msg->rcv.rflags & RECV_F_PREROUTING)) {
171
+		LM_WARN("not used in pre-routing phase\n");
172
+		return -1;
173
+	}
170 174
 	if(sworker_send_task(msg, gname) < 0) {
171 175
 		return -1;
172 176
 	}
173 177
 
174
-	/* force exit in config */
175
-	return 0;
178
+	return 1;
176 179
 }
177 180
 
178 181
 /**