Module: kamailio Branch: 4.3 Commit: 863739dec78161fdce871c281601a011572515a2 URL: https://github.com/kamailio/kamailio/commit/863739dec78161fdce871c281601a011...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-11-25T13:05:46+01:00
dialog: safety bump of cseq for bye if prack was involved in call setup
- reported by GH#409
(cherry picked from commit aab6547f39d723de6a01680cbd79b9365be8092f)
---
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/863739dec78161fdce871c281601a011... Patch: https://github.com/kamailio/kamailio/commit/863739dec78161fdce871c281601a011...
---
diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c index 656833c..6582ded 100644 --- a/modules/dialog/dlg_hash.c +++ b/modules/dialog/dlg_hash.c @@ -999,6 +999,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 64fb037..f756dc4 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 f862ab2..6c5922c 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);