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

Author: Kristian Hogh <k...@uni-tel.dk>
Committer: Henning Westerholt <h...@gilawa.com>
Date: 2023-11-30T06:21:25Z

nathelper: add Max-Forwards headers which is mandatory for OPTIONS according to 
RFC 3261 (GH 3657)

- add Max-Forwards headers which is mandatory for OPTIONS according to RFC 3261
- similar patch is used from several large customer installations since many 
years
- GH #3657 with small formatting change

---

Modified: src/modules/nathelper/sip_pinger.h

---

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

---

diff --git a/src/modules/nathelper/sip_pinger.h 
b/src/modules/nathelper/sip_pinger.h
index 733e38f21c3..b3ee4d39f3d 100644
--- a/src/modules/nathelper/sip_pinger.h
+++ b/src/modules/nathelper/sip_pinger.h
@@ -151,7 +151,7 @@ static inline char *build_sipping(str *curi, struct 
socket_info *s, str *path,
                                        + ruid->len + 1 + 8 + 1 + 8 + 
s_len(CRLF "To: ") + curi->len
                                        + s_len(CRLF "Call-ID: ") + 
sipping_callid.len + 1 + 8 + 1
                                        + 8 + 1 + s->address_str.len + 
s_len(CRLF "CSeq: 1 ")
-                                       + sipping_method.len
+                                       + sipping_method.len + s_len(CRLF 
"Max-Forwards: 70")
                                        + s_len(CRLF "Content-Length: 0" CRLF 
CRLF)
                        > MAX_SIPPING_SIZE) {
                LM_ERR("len exceeds %d\n", MAX_SIPPING_SIZE);
@@ -205,6 +205,7 @@ static inline char *build_sipping(str *curi, struct 
socket_info *s, str *path,
        append_str(p, s->address_str.s, s->address_str.len);
        append_fix(p, CRLF "CSeq: 1 ");
        append_str(p, sipping_method.s, sipping_method.len);
+       append_fix(p, CRLF "Max-Forwards: 70");
        append_fix(p, CRLF "Content-Length: 0" CRLF CRLF);
 
        *len_p = p - buf;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to