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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-08-04T22:17:48+02:00

tm: uac_req_t field to provide fromtag

---

Modified: src/modules/tm/uac.c
Modified: src/modules/tm/uac.h

---

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

---

diff --git a/src/modules/tm/uac.c b/src/modules/tm/uac.c
index ed31dc5a118..518929341d8 100644
--- a/src/modules/tm/uac.c
+++ b/src/modules/tm/uac.c
@@ -1191,7 +1191,11 @@ int request(uac_req_t *uac_r, str *ruri, str *to, str 
*from, str *next_hop)
        else
                callid = *uac_r->callid;
        cseqno = (uac_r->cseqno > 0) ? uac_r->cseqno : DEFAULT_CSEQ;
-       generate_fromtag(&fromtag, &callid, ruri);
+       if(uac_r->fromtag == NULL || uac_r->fromtag->len <= 0) {
+               generate_fromtag(&fromtag, &callid, ruri);
+       } else {
+               fromtag = *uac_r->fromtag;
+       }
 
        if(new_dlg_uac(&callid, &fromtag, cseqno, from, to, &dialog) < 0) {
                LM_ERR("Error while creating temporary dialog\n");
diff --git a/src/modules/tm/uac.h b/src/modules/tm/uac.h
index f35cf9f70ac..ab6b24366d5 100644
--- a/src/modules/tm/uac.h
+++ b/src/modules/tm/uac.h
@@ -54,6 +54,7 @@ typedef struct uac_req
        transaction_cb *cb;
        void *cbp;
        str *callid;
+       str *fromtag;
        unsigned int cseqno;
        unsigned int fr_timeout;
        unsigned int fr_inv_timeout;

_______________________________________________
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