Skip to content

Commit

Permalink
dialog: suppress in-dialog pinging when replication tag is backup
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu committed Mar 14, 2018
1 parent 71a11a1 commit b1100cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/dialog/dlg_replication.c
Expand Up @@ -232,21 +232,18 @@ int dlg_replicated_create(bin_packet_t *packet, struct dlg_cell *cell, str *ftag
/* reference the dialog as kept in the timer list */
ref_dlg_unsafe(dlg, 1);

LM_DBG("Received initial timeout of %d for dialog %.*s, safe = %d\n", dlg->tl.timeout, callid.len, callid.s, safe);
LM_DBG("Received initial timeout of %d for dialog %.*s, safe = %d\n",
dlg->tl.timeout, callid.len, callid.s, safe);

dlg->lifetime = 0;

/*
Do not replicate the pinging - we might terminate dialogs badly when running
as backup
if (dlg->flags & DLG_FLAG_PING_CALLER || dlg->flags & DLG_FLAG_PING_CALLEE) {
if (insert_ping_timer(dlg) != 0)
LM_CRIT("Unable to insert dlg %p into ping timer\n",dlg);
else {
ref_dlg_unsafe(dlg, 1);
}
}
*/

if (dlg_db_mode == DB_MODE_DELAYED) {
/* to be later removed by timer */
Expand Down
11 changes: 11 additions & 0 deletions modules/dialog/dlg_timer.c
Expand Up @@ -30,6 +30,7 @@
#include "dlg_timer.h"
#include "dlg_hash.h"
#include "dlg_req_within.h"
#include "dlg_replication.h"

struct dlg_timer *d_timer = 0;
dlg_timer_handler timer_hdl = 0;
Expand Down Expand Up @@ -943,6 +944,11 @@ void dlg_options_routine(unsigned int ticks , void * attr)
dlg = it->dlg;
next=it->next;

if (dialog_repl_cluster && get_repltag_state(dlg) == REPLTAG_STATE_BACKUP) {
it = next;
continue;
}

/* do not ping ended dialogs - we might have missed them earlier or
* might have terminated in the mean time - we'll clean them up on
* our next iteration */
Expand Down Expand Up @@ -1041,6 +1047,11 @@ void dlg_reinvite_routine(unsigned int ticks , void * attr)
dlg = it->dlg;
next=it->next;

if (dialog_repl_cluster && get_repltag_state(dlg) == REPLTAG_STATE_BACKUP) {
it = next;
continue;
}

/* do not ping ended dialogs - we might have missed them earlier or
* might have terminated in the mean time - we'll clean them up on
* our next iteration */
Expand Down

0 comments on commit b1100cd

Please sign in to comment.