Module: kamailio
Branch: 5.8
Commit: 8eff811614b72fbf80af6d546d65c65e6b59c1a5
URL: 
https://github.com/kamailio/kamailio/commit/8eff811614b72fbf80af6d546d65c65e6b59c1a5

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-01-22T10:49:34+01:00

core: add extra params to first via only for generated replies

(cherry picked from commit 9045c8d537b8960a18451f870effe2255cb4861d)

---

Modified: src/core/msg_translator.c

---

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

---

diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index 262ba07a23a..f7590dc5161 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -2692,16 +2692,17 @@ char *build_res_buf_from_sip_req(unsigned int code, str 
*text, str *new_tag,
                                                                (hdr->body.s + 
hdr->body.len) - hdr->name.s,
                                                                msg);
                                        }
-                                       if(received_buf)
+                                       if(received_buf) {
                                                append_str(p, received_buf, 
received_len);
+                                       }
+                                       if(xparams.len > 0) {
+                                               append_str(p, xparams.s, 
xparams.len);
+                                       }
                                } else {
                                        /* normal whole via copy */
                                        append_str_trans(p, hdr->name.s,
                                                        (hdr->body.s + 
hdr->body.len) - hdr->name.s, msg);
                                }
-                               if(xparams.len > 0) {
-                                       append_str(p, xparams.s, xparams.len);
-                               }
                                append_str(p, CRLF, CRLF_LEN);
                                /* if is HTTP, replace Via with Sia
                                 * - HTTP Via format is different than SIP Via

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to