[sr-dev] git:master:aab6547f: dialog: safety bump of cseq for bye if prack was involved in call setup

Daniel-Constantin Mierla miconda at gmail.com
Mon Nov 23 16:45:31 CET 2015


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-11-23T16:43:43+01:00

dialog: safety bump of cseq for bye if prack was involved in call setup

- reported by GH#409

---

Modified: modules/dialog/dlg_hash.c
Modified: modules/dialog/dlg_hash.h
Modified: modules/dialog/dlg_req_within.c

---

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

---

diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index 99235ee..55aa14f 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -1068,6 +1068,8 @@ void next_state_dlg(dlg_cell_t *dlg, int event,
 			switch (dlg->state) {
 				case DLG_STATE_EARLY:
 				case DLG_STATE_CONFIRMED_NA:
+					dlg->iflags |= DLG_IFLAG_PRACK;
+					break;
 				case DLG_STATE_DELETED:
 					break;
 				default:
diff --git a/modules/dialog/dlg_hash.h b/modules/dialog/dlg_hash.h
index 166174e..ef94514 100644
--- a/modules/dialog/dlg_hash.h
+++ b/modules/dialog/dlg_hash.h
@@ -76,6 +76,7 @@
 #define DLG_IFLAG_KA_DST            (1<<2) /*!< send keep alive to dst */
 #define DLG_IFLAG_TIMER_NORESET     (1<<3) /*!< don't reset dialog timers on in-dialog messages reception */
 #define DLG_IFLAG_CSEQ_DIFF         (1<<4) /*!< CSeq changed in dialog */
+#define DLG_IFLAG_PRACK             (1<<5) /*!< PRACK was routed during initial state */
 
 #define DLG_CALLER_LEG         0 /*!< attribute that belongs to a caller leg */
 #define DLG_CALLEE_LEG         1 /*!< attribute that belongs to a callee leg */
diff --git a/modules/dialog/dlg_req_within.c b/modules/dialog/dlg_req_within.c
index c40a08d..7fb4f4b 100644
--- a/modules/dialog/dlg_req_within.c
+++ b/modules/dialog/dlg_req_within.c
@@ -348,6 +348,11 @@ static inline int send_bye(struct dlg_cell * cell, int dir, str *hdrs)
 		goto err;
 	}
 
+	/* safety bump of cseq if prack was involved in call setup */
+	if(cell->iflags & DLG_IFLAG_PRACK) {
+		dialog_info->loc_seq.value += 80;
+	}
+
 	LM_DBG("sending BYE to %s\n", (dir==DLG_CALLER_LEG)?"caller":"callee");
 
 	iuid = dlg_get_iuid_shm_clone(cell);




More information about the sr-dev mailing list