[sr-dev] git:master:5efe3229: dmq_usrloc: new param sync - control sync'ing all contacts at startup
Daniel-Constantin Mierla
miconda at gmail.com
Fri Nov 20 12:33:41 CET 2015
Module: kamailio
Branch: master
Commit: 5efe3229da3c98ed2bd531c6c9eb712bdbd9ea67
URL: https://github.com/kamailio/kamailio/commit/5efe3229da3c98ed2bd531c6c9eb712bdbd9ea67
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-11-20T12:33:19+01:00
dmq_usrloc: new param sync - control sync'ing all contacts at startup
- default 1 - require sync'ing of all contacts at startup
- set to 0 to disable
---
Modified: modules/dmq_usrloc/dmq_usrloc.c
Modified: modules/dmq_usrloc/usrloc_sync.c
---
Diff: https://github.com/kamailio/kamailio/commit/5efe3229da3c98ed2bd531c6c9eb712bdbd9ea67.diff
Patch: https://github.com/kamailio/kamailio/commit/5efe3229da3c98ed2bd531c6c9eb712bdbd9ea67.patch
---
diff --git a/modules/dmq_usrloc/dmq_usrloc.c b/modules/dmq_usrloc/dmq_usrloc.c
index cd5fedd..c3ec54d 100644
--- a/modules/dmq_usrloc/dmq_usrloc.c
+++ b/modules/dmq_usrloc/dmq_usrloc.c
@@ -35,6 +35,7 @@ static int mod_init(void);
static int child_init(int);
int dmq_usrloc_enable = 0;
+int _dmq_usrloc_sync = 1;
usrloc_api_t dmq_ul;
@@ -42,6 +43,7 @@ MODULE_VERSION
static param_export_t params[] = {
{"enable", INT_PARAM, &dmq_usrloc_enable},
+ {"sync", INT_PARAM, &_dmq_usrloc_sync},
{0, 0, 0}
};
diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c
index 2246c36..d1c534f 100644
--- a/modules/dmq_usrloc/usrloc_sync.c
+++ b/modules/dmq_usrloc/usrloc_sync.c
@@ -43,6 +43,8 @@ int usrloc_dmq_send_contact(ucontact_t* ptr, str aor, int action, dmq_node_t* no
#define MAX_AOR_LEN 256
+extern int _dmq_usrloc_sync;
+
static int add_contact(str aor, ucontact_info_t* ci)
{
urecord_t* r;
@@ -425,6 +427,10 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t*
int usrloc_dmq_request_sync() {
srjson_doc_t jdoc;
+
+ if(_dmq_usrloc_sync==0)
+ return 0;
+
LM_DBG("requesting sync from dmq peers\n");
srjson_InitDoc(&jdoc, NULL);
More information about the sr-dev
mailing list