[sr-dev] git:master:7f9547ae: misc/examples/kemi: native config upated

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 7 11:45:36 CET 2022


Module: kamailio
Branch: master
Commit: 7f9547ae2b5a5848f693544124f199f4082be22c
URL: https://github.com/kamailio/kamailio/commit/7f9547ae2b5a5848f693544124f199f4082be22c

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-12-07T11:44:56+01:00

misc/examples/kemi: native config upated

---

Modified: misc/examples/kemi/kamailio-basic-kemi-native.cfg

---

Diff:  https://github.com/kamailio/kamailio/commit/7f9547ae2b5a5848f693544124f199f4082be22c.diff
Patch: https://github.com/kamailio/kamailio/commit/7f9547ae2b5a5848f693544124f199f4082be22c.patch

---

diff --git a/misc/examples/kemi/kamailio-basic-kemi-native.cfg b/misc/examples/kemi/kamailio-basic-kemi-native.cfg
index c95517cc9e..984c45b877 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-native.cfg
+++ b/misc/examples/kemi/kamailio-basic-kemi-native.cfg
@@ -20,18 +20,20 @@ request_route {
 		exit;
 	}
 
+	# handle retransmissions
+	if (!is_method("ACK")) {
+		if(t_precheck_trans()) {
+			t_check_trans();
+			exit;
+		}
+		t_check_trans();
+	}
+
 	# handle requests within SIP dialogs
 	route(WITHINDLG);
 
 	### only initial requests (no To tag)
 
-	# handle retransmissions
-	if(t_precheck_trans()) {
-		t_check_trans();
-		exit;
-	}
-	t_check_trans();
-
 	# authentication
 	route(AUTH);
 
@@ -86,8 +88,14 @@ route[RELAY] {
 
 # Per SIP request initial checks
 route[REQINIT] {
+	# no connect for sending replies
+	set_reply_no_connect();
+	# enforce symmetric signaling
+	# - send back replies to the source address of request
+	force_rport();
+
 #!ifdef WITH_ANTIFLOOD
-	# flood dection from same IP and traffic ban for a while
+	# flood detection from same IP and traffic ban for a while
 	# be sure you exclude checking trusted peers, such as pstn gateways
 	# - local host excluded (e.g., loop to self)
 	if(src_ip!=myself) {
@@ -102,11 +110,12 @@ route[REQINIT] {
 			exit;
 		}
 	}
-	if($ua =~ "friendly-scanner") {
-		sl_send_reply("200", "OK");
+#!endif
+	if($ua =~ "friendly|scanner|sipcli|sipvicious|VaxSIPUserAgent|pplsip") {
+		# silent drop for scanners - uncomment next line if want to reply
+		# sl_send_reply("200", "OK");
 		exit;
 	}
-#!endif
 
 	if (!mf_process_maxfwd_header("10")) {
 		sl_send_reply("483","Too Many Hops");
@@ -118,8 +127,8 @@ route[REQINIT] {
 		exit;
 	}
 
-	if(!sanity_check("1511", "7")) {
-		xlog("Malformed SIP message from $si:$sp\n");
+	if(!sanity_check("17895", "7")) {
+		xlog("Malformed SIP request from $si:$sp\n");
 		exit;
 	}
 }




More information about the sr-dev mailing list