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

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2026-02-26T16:10:54+01:00

ims_dialog: populate_leg_info() simplify a bit the logic

* remove ternary if

---

Modified: src/modules/ims_dialog/dlg_handlers.c

---

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

---

diff --git a/src/modules/ims_dialog/dlg_handlers.c 
b/src/modules/ims_dialog/dlg_handlers.c
index d1d05dc90ec..a336ac40cc9 100644
--- a/src/modules/ims_dialog/dlg_handlers.c
+++ b/src/modules/ims_dialog/dlg_handlers.c
@@ -253,21 +253,17 @@ int populate_leg_info(struct dlg_cell *dlg, struct 
sip_msg *msg, struct cell *t,
                goto error0;
        }
 
-       if(leg == DLG_CALLER_LEG) {
-               skip_recs = 0;
-       } else {
-               skip_recs = 0;
+       skip_recs = 0;
+       if(leg != DLG_CALLER_LEG) {
                /* was the 200 OK received or local generated */
-               skip_recs = dlg->from_rr_nb
-                                       + ((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;
+               if(t->relayed_reply_branch >= 0) {
+                       if(t->uac[t->relayed_reply_branch].flags & 
TM_UAC_FLAG_R2) {
+                               skip_recs += 2;
+                       } else if(t->uac[t->relayed_reply_branch].flags & 
TM_UAC_FLAG_RR) {
+                               skip_recs += 1;
+                       }
+               }
        }
 
        if(msg->record_route) {

_______________________________________________
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