#include <Bogdan-Andrei Iancu.h> // created 13/06/2008 11:30
(Sorry for direct contact.. i have to fix thunderbird!)
Hi kionez,
ok - send it to me or uploaded it on the tracker
Hi, here's my little patch.. i try to merge a patch found on sourceforge
bugtracker, i don't have many coding experience neither knowledge of
openser core, it seems working.. but surely there are to fix many
things, such as "unref_dlg"..
maybe it could be a start point to implement a new feature ;)
1:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=164289…
k.
diff -Naur modules/dialog-orig/dlg_handlers.c modules/dialog/dlg_handlers.c
--- modules/dialog-orig/dlg_handlers.c 2008-05-15 17:24:31.000000000 +0200
+++ modules/dialog/dlg_handlers.c 2008-06-09 17:15:48.000000000 +0200
@@ -62,6 +62,8 @@
#include "dlg_cb.h"
#include "dlg_handlers.h"
#include "dlg_db_handler.h"
+#include "dlg_req_within.h"
+
static str rr_param;
static int dlg_flag;
@@ -654,6 +656,7 @@
int new_state;
int old_state;
int unref;
+ str extra_hdrs = {NULL,0};
dlg = get_dlg_tl_payload(tl);
@@ -668,6 +671,13 @@
/* dialog timeout */
run_dlg_callbacks( DLGCB_EXPIRED, dlg, 0);
+ /*send_bye*/
+ if (send_bye(dlg,DLG_CALLER_LEG,&extra_hdrs))
+ LM_ERR("sending bye to caller failed\n");
+
+ if (send_bye(dlg,DLG_CALLEE_LEG,&extra_hdrs))
+ LM_ERR("sending bye to callee failed\n");
+
/* delete the dialog from DB */
if (dlg_db_mode)
remove_dialog_from_db(dlg);
diff -Naur modules/dialog-orig/dlg_hash.c modules/dialog/dlg_hash.c
--- modules/dialog-orig/dlg_hash.c 2008-05-15 17:24:31.000000000 +0200
+++ modules/dialog/dlg_hash.c 2008-06-09 17:26:53.000000000 +0200
@@ -534,6 +534,7 @@
switch (dlg->state) {
case DLG_STATE_CONFIRMED_NA:
case DLG_STATE_CONFIRMED:
+ case DLG_STATE_DELETED:
dlg->flags |= DLG_FLAG_HASBYE;
dlg->state = DLG_STATE_DELETED;
*unref = 1;
diff -Naur modules/dialog-orig/dlg_req_within.c modules/dialog/dlg_req_within.c
--- modules/dialog-orig/dlg_req_within.c 2008-04-07 11:15:02.000000000 +0200
+++ modules/dialog/dlg_req_within.c 2008-06-09 17:29:32.000000000 +0200
@@ -45,7 +45,7 @@
#define MAX_FWD_HDR_LEN (sizeof(MAX_FWD_HDR) - 1)
extern str dlg_extra_hdrs;
-
+extern stat_var *expired_dlgs;
int free_tm_dlg(dlg_t *td)
@@ -155,13 +155,14 @@
remove_dlg_timer(&dlg->tl);
/* dialog terminated (BYE) */
- run_dlg_callbacks( DLGCB_TERMINATED, dlg, ps->req);
+ run_dlg_callbacks( DLGCB_TERMINATED | DLGCB_EXPIRED, dlg, ps->req);
LM_DBG("first final reply\n");
/* derefering the dialog */
unref_dlg(dlg, unref+2);
if_update_stat( dlg_enable_stats, active_dlgs, -1);
+ if_update_stat( dlg_enable_stats, expired_dlgs, 1);
}
if(new_state == DLG_STATE_DELETED && old_state == DLG_STATE_DELETED ) {
@@ -215,7 +216,7 @@
* DLG_CALLER_LEG (0): caller
* DLG_CALLEE_LEG (1): callee
*/
-static inline int send_bye(struct dlg_cell * cell, int dir, str *extra_hdrs)
+inline int send_bye(struct dlg_cell * cell, int dir, str *extra_hdrs)
{
/*verify direction*/
dlg_t* dialog_info;
diff -Naur modules/dialog-orig/dlg_req_within.h modules/dialog/dlg_req_within.h
--- modules/dialog-orig/dlg_req_within.h 2007-12-13 14:38:17.000000000 +0100
+++ modules/dialog/dlg_req_within.h 2008-06-09 17:29:03.000000000 +0200
@@ -44,5 +44,6 @@
extern stat_var * active_dlgs;
struct mi_root * mi_terminate_dlg(struct mi_root *cmd_tree, void *param );
+inline int send_bye(struct dlg_cell * cell, int dir, str *extra_hdrs);
#endif