Module: sip-router Branch: alexh/dialog-sync-wip Commit: c809cae1b1357852bd72cf8e37dc21420bd79112 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c809cae1...
Author: Alex Hermann alex@speakup.nl Committer: Alex Hermann alex@speakup.nl Date: Mon Sep 1 17:53:25 2014 +0200
dialog: Only DMQ-sync out our "own" dialogs
Do not sync-out dialogs we got from another proxy.
---
modules/dialog/dlg_dmq.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/dialog/dlg_dmq.c b/modules/dialog/dlg_dmq.c index 60b90d5..56da577 100644 --- a/modules/dialog/dlg_dmq.c +++ b/modules/dialog/dlg_dmq.c @@ -375,7 +375,7 @@ int dlg_dmq_replicate_action(dlg_dmq_action_t action, dlg_cell_t* dlg, int needl LM_DBG("replicating action [%d] on [%u:%u] to dmq peers\n", action, dlg->h_entry, dlg->h_id);
if (action == DLG_DMQ_UPDATE) { - if ((dlg->iflags & DLG_IFLAG_DMQ_SYNC) && ((dlg->dflags & DLG_FLAG_CHANGED_PROF) == 0)) { + if (!node && (dlg->iflags & DLG_IFLAG_DMQ_SYNC) && ((dlg->dflags & DLG_FLAG_CHANGED_PROF) == 0)) { LM_DBG("dlg not changed, no sync\n"); return 1; } @@ -490,8 +490,10 @@ int dmq_send_all_dlgs(dmq_node_t* dmq_node) { dlg_lock( d_table, &entry);
for(dlg = entry.first; dlg != NULL; dlg = dlg->next){ - dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC; - dlg_dmq_replicate_action(DLG_DMQ_UPDATE, dlg, 0, dmq_node); + if (dlg->iflags & DLG_IFLAG_DMQ_SYNC) { + dlg->dflags |= DLG_FLAG_CHANGED_PROF; + dlg_dmq_replicate_action(DLG_DMQ_UPDATE, dlg, 0, dmq_node); + } }
dlg_unlock( d_table, &entry);