Module: kamailio
Branch: master
Commit: 3c6b3ecbe14162d810286bac8f8aec87a5567e6f
URL:
https://github.com/kamailio/kamailio/commit/3c6b3ecbe14162d810286bac8f8aec8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-12T14:53:59+02:00
dialog: new parameters - early_timeout and noack_timeout
- early_timeout - set the interval in seconds after which the dialogs in
early state (not answered yet) are destroyed. Default value is 300.
- noack_timeout - set the interval in seconds after which the dialogs
that were answered with 200ok but didn't receive the ACK are marked
for termination (lifetime set to 10 more seconds). Default value 60.
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3c6b3ecbe14162d810286bac8f8aec8…
Patch:
https://github.com/kamailio/kamailio/commit/3c6b3ecbe14162d810286bac8f8aec8…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 9f90e07a0b..37b5dedde7 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -107,6 +107,8 @@ int dlg_wait_ack = 1;
static int dlg_timer_procs = 0;
static int _dlg_track_cseq_updates = 0;
int dlg_ka_failed_limit = 1;
+int dlg_early_timeout = 300;
+int dlg_noack_timeout = 60;
int dlg_enable_dmq = 0;
@@ -301,7 +303,9 @@ static param_export_t mod_params[]={
{ "db_skip_load", INT_PARAM, &db_skip_load },
{ "ka_failed_limit", INT_PARAM, &dlg_ka_failed_limit },
{ "enable_dmq", INT_PARAM, &dlg_enable_dmq },
- {"event_callback", PARAM_STR, &dlg_event_callback },
+ { "event_callback", PARAM_STR, &dlg_event_callback },
+ { "early_timeout", PARAM_INT, &dlg_early_timeout },
+ { "noack_timeout", PARAM_INT, &dlg_noack_timeout },
{ 0,0,0 }
};
diff --git a/src/modules/dialog/dlg_hash.c b/src/modules/dialog/dlg_hash.c
index 8c5c7a6acb..e9b0af65ea 100644
--- a/src/modules/dialog/dlg_hash.c
+++ b/src/modules/dialog/dlg_hash.c
@@ -48,6 +48,9 @@ extern int dlg_ka_interval;
extern int dlg_enable_dmq;
+extern int dlg_early_timeout;
+extern int dlg_noack_timeout;
+
/*! global dialog table */
struct dlg_table *d_table = 0;
@@ -229,14 +232,16 @@ int dlg_clean_run(ticks_t ti)
while (dlg) {
tdlg = dlg;
dlg = dlg->next;
- if(tdlg->state==DLG_STATE_UNCONFIRMED && tdlg->init_ts<tm-300) {
+ if(tdlg->state==DLG_STATE_UNCONFIRMED
+ && tdlg->init_ts<tm-dlg_early_timeout) {
/* dialog in early state older than 5min */
LM_NOTICE("dialog in early state is too old (%p ref %d)\n",
tdlg, tdlg->ref);
unlink_unsafe_dlg(&d_table->entries[i], tdlg);
destroy_dlg(tdlg);
}
- if(tdlg->state==DLG_STATE_CONFIRMED_NA && tdlg->start_ts<tm-60) {
+ if(tdlg->state==DLG_STATE_CONFIRMED_NA
+ && tdlg->start_ts<tm-dlg_noack_timeout) {
if(update_dlg_timer(&tdlg->tl, 10)<0) {
LM_ERR("failed to update dialog lifetime in long non-ack state\n");
}