Browse code

dialog: Only DMQ-sync out our "own" dialogs

Do not sync-out dialogs we got from another proxy.

Alex Hermann authored on 01/09/2014 15:53:25
Showing 1 changed files
... ...
@@ -375,7 +375,7 @@ int dlg_dmq_replicate_action(dlg_dmq_action_t action, dlg_cell_t* dlg, int needl
375 375
 	LM_DBG("replicating action [%d] on [%u:%u] to dmq peers\n", action, dlg->h_entry, dlg->h_id);
376 376
 
377 377
 	if (action == DLG_DMQ_UPDATE) {
378
-		if ((dlg->iflags & DLG_IFLAG_DMQ_SYNC) && ((dlg->dflags & DLG_FLAG_CHANGED_PROF) == 0)) {
378
+		if (!node && (dlg->iflags & DLG_IFLAG_DMQ_SYNC) && ((dlg->dflags & DLG_FLAG_CHANGED_PROF) == 0)) {
379 379
 			LM_DBG("dlg not changed, no sync\n");
380 380
 			return 1;
381 381
 		}
... ...
@@ -490,8 +490,10 @@ int dmq_send_all_dlgs(dmq_node_t* dmq_node) {
490 490
 		dlg_lock( d_table, &entry);
491 491
 
492 492
 		for(dlg = entry.first; dlg != NULL; dlg = dlg->next){
493
-			dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC;
494
-			dlg_dmq_replicate_action(DLG_DMQ_UPDATE, dlg, 0, dmq_node);
493
+			if (dlg->iflags & DLG_IFLAG_DMQ_SYNC) {
494
+				dlg->dflags |= DLG_FLAG_CHANGED_PROF;
495
+				dlg_dmq_replicate_action(DLG_DMQ_UPDATE, dlg, 0, dmq_node);
496
+			}
495 497
 		}
496 498
 
497 499
 		dlg_unlock( d_table, &entry);