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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2025-12-12T16:40:47+01:00

tm: use directly former function when tm_local_ack_branch_mode not 1

---

Modified: src/modules/tm/t_msgbuilder.c

---

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

---

diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c
index 582df04a3f4..c22941012cc 100644
--- a/src/modules/tm/t_msgbuilder.c
+++ b/src/modules/tm/t_msgbuilder.c
@@ -1825,24 +1825,27 @@ int t_calc_branch_ack(struct cell *t, int b, char 
*branch, int *branch_len)
        int i = 0;
        int k = 0;
 
-       if(tm_local_ack_branch_mode == 1) {
-               memcpy(md5b, t->md5, MD5_LEN);
-               md5b[MD5_LEN] = '\0';
-               for(k = 0; k < 4; k++) {
-                       i = MD5_LEN - 1 - k;
-                       if(md5b[i] >= '0' && md5b[i] < '9') {
-                               md5b[i] = md5b[i] + 1;
-                       } else if(md5b[i] == '9') {
-                               md5b[i] = '0';
-                       } else if(md5b[i] >= 'a' && md5b[i] < 'z') {
-                               md5b[i] = md5b[i] + 1;
-                       } else if(md5b[i] == 'z') {
-                               md5b[i] = 'a';
-                       } else if(md5b[i] >= 'A' && md5b[i] < 'Z') {
-                               md5b[i] = md5b[i] + 1;
-                       } else if(md5b[i] == 'z') {
-                               md5b[i] = 'A';
-                       }
+       if(tm_local_ack_branch_mode != 1) {
+               return branch_builder(
+                               t->hash_index, 0, t->md5, NULL, b, branch, 
branch_len);
+       }
+
+       memcpy(md5b, t->md5, MD5_LEN);
+       md5b[MD5_LEN] = '\0';
+       for(k = 0; k < 4; k++) {
+               i = MD5_LEN - 1 - k;
+               if(md5b[i] >= '0' && md5b[i] < '9') {
+                       md5b[i] = md5b[i] + 1;
+               } else if(md5b[i] == '9') {
+                       md5b[i] = '0';
+               } else if(md5b[i] >= 'a' && md5b[i] < 'z') {
+                       md5b[i] = md5b[i] + 1;
+               } else if(md5b[i] == 'z') {
+                       md5b[i] = 'a';
+               } else if(md5b[i] >= 'A' && md5b[i] < 'Z') {
+                       md5b[i] = md5b[i] + 1;
+               } else if(md5b[i] == 'z') {
+                       md5b[i] = 'A';
                }
        }
 

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to