From 216fc94cf3f2aa708f50797de3c74e58e28cc6fe Mon Sep 17 00:00:00 2001 From: mikomarrache Date: Wed, 15 Apr 2015 16:00:47 +0300 Subject: [PATCH 1/2] dialog: add new flag for expired dialogs --- modules/dialog/dlg_hash.h | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dialog/dlg_hash.h b/modules/dialog/dlg_hash.h index e142027c31b..d79d994bc41 100644 --- a/modules/dialog/dlg_hash.h +++ b/modules/dialog/dlg_hash.h @@ -67,6 +67,7 @@ #define DLG_FLAG_DEL (1<<8) /*!< delete this var */ #define DLG_FLAG_TM (1<<9) /*!< dialog is set in transaction */ +#define DLG_FLAG_EXPIRED (1<<10)/*!< dialog is expired */ /* internal flags stored in db */ #define DLG_IFLAG_TIMEOUTBYE (1<<0) /*!< send bye on time-out */ From fa90ad3daef2dc34b97c4c13c0b97bf5f04165d5 Mon Sep 17 00:00:00 2001 From: mikomarrache Date: Wed, 15 Apr 2015 16:28:47 +0300 Subject: [PATCH 2/2] dialog: set DLG_FLAG_EXPIRED flag when timeout --- modules/dialog/dlg_handlers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index 34551a54a81..fdfc3c31f54 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -1376,6 +1376,9 @@ void dlg_ontimeout(struct dlg_tl *tl) dlg = ((struct dlg_cell*)((char *)(tl) - (unsigned long)(&((struct dlg_cell*)0)->tl))); + /* mark dialog as expired */ + dlg->dflags |= DLG_FLAG_EXPIRED; + if(dlg->state==DLG_STATE_CONFIRMED_NA || dlg->state==DLG_STATE_CONFIRMED) {