فهرست منبع

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

- reported by GH#409

(cherry picked from commit aab6547f39d723de6a01680cbd79b9365be8092f)
(cherry picked from commit 863739dec78161fdce871c281601a011572515a2)
Daniel-Constantin Mierla 10 سال پیش
والد
کامیت
96d5dda983
3فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 2 0
      modules/dialog/dlg_hash.c
  2. 1 0
      modules/dialog/dlg_hash.h
  3. 5 0
      modules/dialog/dlg_req_within.c

+ 2 - 0
modules/dialog/dlg_hash.c

@@ -1020,6 +1020,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:

+ 1 - 0
modules/dialog/dlg_hash.h

@@ -88,6 +88,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 */

+ 5 - 0
modules/dialog/dlg_req_within.c

@@ -338,6 +338,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);