[OpenSIPS-Users] UsrLoc Events are not working with Full-Sharing-CacheDB-Cluster and MongoDB

Yury Kirsanov y.kirsanov at gmail.com
Wed Apr 10 10:21:28 UTC 2024


Hi,
I've got three OpenSIPS nodes in a cluster and it was working fine in
'full-sharing-cluster' mode. Then I decided to add MongoDB as a cachedb to
store all the registrations, so I enabled the mongodb module and added
'cachedb_url' parameter into the usrloc module config. After doing that I
noticed that I'm not receiving events for usrloc on all nodes as it was
before. For example, registration comes to OpenSIPS node 3, it successfully
processes the registration request and stores it into MongoDB. But the
other 2 nodes do not see that event!

Even if I subscribe for events using following code:

t_newtran();
t_wait_for_new_branches();

$avp(filter) = "aor="+$tU;
notify_on_event("E_UL_CONTACT_UPDATE",$avp(filter),"fork_call", 20);
notify_on_event("E_UL_CONTACT_INSERT",$avp(filter),"fork_call", 20);

I'm not receiving the event notifications anywhere but on the node where
the SIP REGISTER packet came. This doesn't allow to use
't_inject_branches("event")' command.

I have following routes defined for events:

event_route[E_UL_CONTACT_INSERT]
event_route[E_UL_CONTACT_UPDATE]
event_route[E_UL_CONTACT_DELETE]
route[fork_call]

None of them are getting called on other nodes of the cluster except for
the node that accepted the REGISTER packet.

Here's my cluster and usrloc configuration:

# USRLoc module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset", "full-sharing-cachedb-cluster")
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "location_cluster", 1)
modparam("usrloc", "cachedb_url",
"mongodb://10.x.x.1,10.x.x.2,10.x.x.3:27017/opensipsDB.userlocation")

# Clusterer Module
loadmodule "clusterer.so"
modparam("clusterer", "db_mode", 0)
modparam("clusterer", "my_node_info",
"cluster_id=1,node_id=1,url=bin:10.y.y.1:3857,flags=seed")
modparam("clusterer", "neighbor_node_info",
"cluster_id=1,node_id=2,url=bin:10.y.y.2:3857,flags=seed")
modparam("clusterer", "neighbor_node_info",
"cluster_id=1,node_id=3,url=bin:10.y.y.3:3857,flags=seed")
modparam("clusterer", "seed_fallback_interval", 5)
modparam("clusterer", "ping_interval", 1)
modparam("clusterer", "ping_timeout", 500)
modparam("clusterer", "node_timeout", 10)
modparam("clusterer", "sharing_tag", "vip1/1=active")

# Event Route module
loadmodule "event_route.so"

# Event Routing module
loadmodule "event_routing.so"

# Event Stream
loadmodule "event_stream.so"

# Registrar module
loadmodule "registrar.so"
modparam("registrar", "received_avp", "$avp(received)")
modparam("registrar", "min_expires", 60)
modparam("registrar", "default_expires", 120)
modparam("registrar", "max_expires", 3600)
modparam("registrar", "max_contacts", 1)
modparam("registrar", "attr_avp", "$avp(event_attr)")

Am I doing something wrong? How to enable event notifications on all nodes
in a full sharing cachedb cluster? Thanks.

Best regards,
Yury.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240410/63c4cdb9/attachment.html>


More information about the Users mailing list