Hi Christian,
You can try the following patch. I don't use OPTIONS pings, so I haven't tested it.
Best regards, Kristian Høgh
On Friday, 24 November 2023 09.11.28 CET Henning Westerholt via sr-users wrote:
Hi Christian,
you are right, it is missing in the generated OPTIONS from nathelper. It needs to be added in the respective code part probably.
Cheers,
Henning Westerholt
-----Original Message----- From: Christian Schnell via sr-users sr-users@lists.kamailio.org Sent: Donnerstag, 23. November 2023 13:41 To: sr-users@lists.kamailio.org Cc: Christian Schnell cs@rekoba.de Subject: [SR-Users] Max-Forwards header missing in OPTIONS keep-alive messages
Hello,
in RFC 3261 (sec. 8.1.1.6) it states about the Max-Forwards header field:
A UAC MUST insert a Max-Forwards header field into each request it
originates with a value that SHOULD be 70.
Source: https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1.6
When Kamailio sends its OPTIONS keep-alive requests (from the nathelper module I believe), Max-Forwards is missing:
OPTIONS sip:alice@example.com:61266 SIP/2.0 Via: SIP/2.0/UDP aa.bb.cc.dd:5060;branch=z9hG4bK5124450 From: sip:pinger@sip.example.com;tag=uloc-6550aa14-7456-2461-6390f173-
5fdb46
67 To: sip:alice@example.com:61266 Call-ID: aba25282-2ca72be1-9d1fd53@aa.bb.cc.dd CSeq: 1 OPTIONS Content-Length: 0
The user agent library I'm using (libre from baresip) rejects these requests with a "400 Bad Request" response, I looked at the sources and it denies these requests because of the missing Max-Forwards header.
Of course this suffices for the keep-alive logic because all that's needed is any traffic in both directions to keep both (potential) NATs open. However you might agree that it does look a bit confusing at first, and the RFC is clear about that.
So it's not a bug, but is this behavior intended?
Thanks, also thanks for all the great work that has been put into Kamailio.
Christian
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: