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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-02-26T08:55:26+01:00

dialog: do not execute dialog state kemi callbacks on unknown event

- GH #4600

---

Modified: src/modules/dialog/dlg_handlers.c

---

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

---

diff --git a/src/modules/dialog/dlg_handlers.c 
b/src/modules/dialog/dlg_handlers.c
index 822175eb829..61024ac8721 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -240,15 +240,16 @@ int populate_leg_info(struct dlg_cell *dlg, struct 
sip_msg *msg, struct cell *t,
                skip_recs = 0;
        } else {
                /* was the 200 OK received or local generated */
-               own_rr = ((t->relayed_reply_branch >= 0) ? (
-                                                 
(t->uac[t->relayed_reply_branch].flags
-                                                                 & 
TM_UAC_FLAG_R2)
-                                                                 ? 2
-                                                                 : 
((t->uac[t->relayed_reply_branch].flags
-                                                                               
         & TM_UAC_FLAG_RR)
-                                                                               
                  ? 1
-                                                                               
                  : 0))
-                                                                               
                 : 0);
+               own_rr = ((t->relayed_reply_branch >= 0)
+                                                 ? 
((t->uac[t->relayed_reply_branch].flags
+                                                                        & 
TM_UAC_FLAG_R2)
+                                                                               
        ? 2
+                                                                               
        : ((t->uac[t->relayed_reply_branch]
+                                                                               
                                           .flags
+                                                                               
                           & TM_UAC_FLAG_RR)
+                                                                               
                                          ? 1
+                                                                               
                                          : 0))
+                                                 : 0);
                skip_recs = dlg->from_rr_nb + ((keep_proxy_rr & 1) > 0 ? 0 : 
own_rr);
        }
 
@@ -1774,7 +1775,7 @@ int dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, 
int ostate, int nstate)
        int rt;
        int bkroute;
        sr_kemi_eng_t *keng = NULL;
-       str evname = str_init("unknown");
+       str evname = str_init("");
        int h_entry = 0;
        int h_id = 0;
        dlg_cell_t *dlg0 = NULL;
@@ -1822,7 +1823,7 @@ int dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, 
int ostate, int nstate)
                }
        }
 
-       if(rt >= 0 || dlg_event_callback.len > 0) {
+       if(rt >= 0 || (dlg_event_callback.len > 0 && evname.len > 0)) {
                if(msg == NULL)
                        fmsg = faked_msg_next();
                else

_______________________________________________
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