Browse code

dialog: Unset DMQ_SYNC flag upon restore from DB on another host

Don't try to sync non-local dialogs via DMQ after DB restore.

Alex Hermann authored on 22/08/2014 13:30:07
Showing 1 changed files
... ...
@@ -422,6 +422,10 @@ static int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows)
422 422
 				srjson_DestroyDoc(&jdoc);
423 423
 			}
424 424
 			dlg->iflags = (unsigned int)VAL_INT(values+22);
425
+			if (!dlg->bind_addr[DLG_CALLER_LEG] || !dlg->bind_addr[DLG_CALLEE_LEG]) {
426
+				/* non-local socket, probably not our dialog */
427
+				dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC;
428
+			}
425 429
 			/*restore the timer values */
426 430
 			if (0 != insert_dlg_timer( &(dlg->tl), (int)dlg->tl.timeout )) {
427 431
 				LM_CRIT("Unable to insert dlg %p [%u:%u] "