Hello all,
Following up on this, I made a patch (attached), could you please review
and apply if it looks ok?
The patch creates a new core cfg variable which, if set, will reject any
incoming NEW tcp connection attempt, so we can use this to gracefully drain
kamailio.
Thanks & Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
Forwarded Conversation
Subject: Reject TCP SYN
------------------------
From: David Villasmil <david.villasmil.work(a)gmail.com>
Date: Thu, Feb 8, 2024 at 2:27 PM
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Hello all,
Is there any way of actually rejecting (RST) NEW tcp connection attempts,
while allowing the ongoing ones to finish naturally?
I’m thinking maybe we can add this feature?
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
----------
From: Henning Westerholt <hw(a)gilawa.com>
Date: Fri, Feb 9, 2024 at 2:08 PM
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Cc: David Villasmil <david.villasmil.work(a)gmail.com>
Hello,
what about e.g. just using something like iptables, nftables etc..?
iptables -A INPUT -p tcp --syn --destination-port <port> -j REJECT
--reject-with icmp-host-prohibited
Cheers,
Henning
----------
From: David Villasmil <david.villasmil.work(a)gmail.com>
Date: Fri, Feb 9, 2024 at 2:42 PM
To: Henning Westerholt <hw(a)gilawa.com>
Cc: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Hey, Henning, yeah I thought about that, but thought that maybe there was a
better way to do it via Kamailio
Thanks!
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
### Description
I've recently spent some time debugging a case with JsSIP and usernames in form of a generated string which can be both upper and lower case letters plus digits.
On BYE from callee to JsSIP, it responded with a "404" and "Request-URI does not point to us" in the console while debugging.
JsSIP is using the Contact returned in the 200 OK to REGISTER (which is transformed to all lower case) for new outgoing INVITE.
It does not match this against the one used in BYE correctly, and return "404".
I see there is a setting in the registrar about this:
```
3.11. case_sensitive (integer)
If set to 1 then AOR comparison and also storing will be case sensitive, if set to 0 then AOR comparison and storing will be case insensitive.
This is recommended. This parameter can be modified via Kamailio config framework.
Default value is 0.
```
Since the RFC states that username should be handle case-sensitive, maybe it would be smart to change this default?
```
Comparison of the userinfo of SIP and SIPS URIs is case-
sensitive. This includes userinfo containing passwords or
formatted as telephone-subscribers.
...
The URIs within each of the following sets are not equivalent:
SIP:ALICE@AtLanTa.CoM;Transport=udp (different usernames)
sip:alice@AtLanTa.CoM;Transport=UDP
```
#### Reproduction
Make a registration with a username containing both upper and lower case characters. It will be stored in all lower case.
### Possible Solutions
Change default value.
Regardless of the outcome on this case - at least now there is a note about it here too.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3719
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3719(a)github.com>
Module: kamailio
Branch: 5.7
Commit: 2f0cca81bfc47783098e4c869b038229cd3e4ed0
URL: https://github.com/kamailio/kamailio/commit/2f0cca81bfc47783098e4c869b03822…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-02-12T07:52:26+01:00
Sample etc/kamailio.cfg: global var tls_threads_mode
- load tls first if used
- global var tls_threads_mode
---
Modified: etc/kamailio.cfg
---
Diff: https://github.com/kamailio/kamailio/commit/2f0cca81bfc47783098e4c869b03822…
Patch: https://github.com/kamailio/kamailio/commit/2f0cca81bfc47783098e4c869b03822…
---
diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
old mode 100644
new mode 100755
index fe7b111a012..a95a652b935
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -220,6 +220,13 @@ enable_tls=yes
/* upper limit for TLS connections */
tls_max_connections=2048
+
+/* For OpenSSL 3 integration
+ * functions calling libssl3 can be invoked in a transient thread
+ * 0: disable threaded calls
+ * 1: use threads for process#0 only
+ * 2: use threads for all processes */
+tls_threads_mode=1
#!endif
/* set it to yes to enable sctp and load sctp.so module */
@@ -257,6 +264,12 @@ voicemail.srv_port = "5060" desc "VoiceMail Port"
/* set paths to location of modules */
# mpath="/usr/local/lib/kamailio/modules/"
+# when using TLS with OpenSSL it is recommended to load this module
+# first so that OpenSSL is initialized correctly
+#!ifdef WITH_TLS
+loadmodule "tls.so"
+#!endif
+
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
#!endif
@@ -319,10 +332,6 @@ loadmodule "rtpproxy.so"
#!endif
#!endif
-#!ifdef WITH_TLS
-loadmodule "tls.so"
-#!endif
-
#!ifdef WITH_HTABLE
loadmodule "htable.so"
#!endif