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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-05-13T10:58:43+02:00

corex: kemi functions to forward uac with branch index

---

Modified: src/modules/corex/corex_mod.c

---

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

---

diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index aad49259036..70db47470ad 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -311,6 +311,20 @@ static int ki_forward_uac(sip_msg_t *msg)
        return -1;
 }
 
+/**
+ * forward request like initial uac sender, with only one via with branch index
+ */
+static int ki_forward_uac_branch(sip_msg_t *msg, int bindex)
+{
+       int ret;
+
+       ret = forward_uac_uri(msg, NULL, bindex);
+       if(ret >= 0) {
+               return 1;
+       }
+       return -1;
+}
+
 /**
  * forward request like initial uac sender, with only one via
  */
@@ -325,6 +339,20 @@ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri)
        return -1;
 }
 
+/**
+ * forward request like initial uac sender, with only one via with branch index
+ */
+static int ki_forward_uac_uri_branch(sip_msg_t *msg, str *vuri, int bindex)
+{
+       int ret;
+
+       ret = forward_uac_uri(msg, vuri, bindex);
+       if(ret >= 0) {
+               return 1;
+       }
+       return -1;
+}
+
 /**
  * forward request like initial uac sender, with only one via
  */
@@ -1845,11 +1873,21 @@ static sr_kemi_t sr_kemi_corex_exports[] = {
                { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
                        SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init("corex"), str_init("forward_uac_branch"),
+               SR_KEMIP_INT, ki_forward_uac_branch,
+               { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
        { str_init("corex"), str_init("forward_uac_uri"),
                SR_KEMIP_INT, ki_forward_uac_uri,
                { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
                        SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init("corex"), str_init("forward_uac_uri_branch"),
+               SR_KEMIP_INT, ki_forward_uac_uri_branch,
+               { SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE,
+                       SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
 
        { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };

_______________________________________________
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