Module: sip-router
Branch: alexh/dialog-sync-wip
Commit: b5ca1979ccc2d39f4c905fc036b9b4f321e20325
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b5ca1979ccc2d39f4c905fc036b9b4f321e20325

Author: Alex Hermann <[email protected]>
Committer: Alex Hermann <[email protected]>
Date:   Fri Aug 22 15:30:07 2014 +0200

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.

---

 modules/dialog/dlg_db_handler.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c
index fcc04e8..9a4d1c8 100644
--- a/modules/dialog/dlg_db_handler.c
+++ b/modules/dialog/dlg_db_handler.c
@@ -422,6 +422,10 @@ static int load_dialog_info_from_db(int dlg_hash_size, int 
fetch_num_rows)
                                srjson_DestroyDoc(&jdoc);
                        }
                        dlg->iflags = (unsigned int)VAL_INT(values+22);
+                       if (!dlg->bind_addr[DLG_CALLER_LEG] || 
!dlg->bind_addr[DLG_CALLEE_LEG]) {
+                               /* non-local socket, probably not our dialog */
+                               dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC;
+                       }
                        /*restore the timer values */
                        if (0 != insert_dlg_timer( &(dlg->tl), 
(int)dlg->tl.timeout )) {
                                LM_CRIT("Unable to insert dlg %p [%u:%u] "


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to