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

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2025-07-21T13:50:53+02:00

ims_dialog: dlg_onroute() use proper tag depending on direction

* needed for correctly updating cseq

---

Modified: src/modules/ims_dialog/dlg_handlers.c

---

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

---

diff --git a/src/modules/ims_dialog/dlg_handlers.c 
b/src/modules/ims_dialog/dlg_handlers.c
index 4acc5c3ad45..bf64e975392 100644
--- a/src/modules/ims_dialog/dlg_handlers.c
+++ b/src/modules/ims_dialog/dlg_handlers.c
@@ -871,6 +871,7 @@ void dlg_onroute(struct sip_msg *req, str *route_params, 
void *param)
        dlg_cell_t *dlg;
        dlg_iuid_t *iuid;
        str val, callid, ftag, ttag;
+       str *tag = NULL;
        int h_entry, h_id, new_state, old_state, unref, event, timeout;
        unsigned int dir;
        int ret = 0;
@@ -1143,7 +1144,12 @@ void dlg_onroute(struct sip_msg *req, str *route_params, 
void *param)
                                        || new_state == DLG_STATE_EARLY)) {
 
                if(event != DLG_EVENT_REQACK) {
-                       if(update_cseqs(dlg, req, dir, &ttag) != 0) {
+                       if(dir == DLG_DIR_UPSTREAM) {
+                               tag = &ftag;
+                       } else {
+                               tag = &ttag;
+                       }
+                       if(update_cseqs(dlg, req, dir, tag) != 0) {
                                LM_ERR("cseqs update failed\n");
                        } else {
                                dlg->dflags |= DLG_FLAG_CHANGED;

_______________________________________________
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