Browse code

sipdump: if drop executed in event route, skip writing to file

(cherry picked from commit 1672a9b356cc864310d0ade139d7c8bb6c4c4b11)

Daniel-Constantin Mierla authored on 13/07/2020 07:46:44
Showing 1 changed files
... ...
@@ -323,7 +323,7 @@ static sipdump_info_t* sipdump_event_info = NULL;
323 323
 /**
324 324
  *
325 325
  */
326
-void sipdump_event_route(sipdump_info_t* sdi)
326
+int sipdump_event_route(sipdump_info_t* sdi)
327 327
 {
328 328
 	int backup_rt;
329 329
 	run_act_ctx_t ctx;
... ...
@@ -352,6 +352,10 @@ void sipdump_event_route(sipdump_info_t* sdi)
352 352
 	}
353 353
 	sipdump_event_info = NULL;
354 354
 	set_route_type(backup_rt);
355
+	if(ctx.run_flags & DROP_R_F) {
356
+		return DROP_R_F;
357
+	}
358
+	return RETURN_R_F;
355 359
 }
356 360
 
357 361
 /**
... ...
@@ -396,7 +400,10 @@ int sipdump_msg_received(sr_event_param_t *evp)
396 400
 	get_valid_proto_string(evp->rcv->proto, 0, 0, &sdi.proto);
397 401
 
398 402
 	if(sipdump_mode & SIPDUMP_MODE_EVROUTE) {
399
-		sipdump_event_route(&sdi);
403
+		if(sipdump_event_route(&sdi) == DROP_R_F) {
404
+			/* drop() used in event_route - all done */
405
+			return 0;
406
+		}
400 407
 	}
401 408
 
402 409
 	if(!(sipdump_mode & SIPDUMP_MODE_WFILE)) {