UPD: 2019-november-5. An official tutorial is available now! And some discussion on the mail list.
Draft/some notes…
2 OpenSIPS nodes without MongoDB
- clusterer.so module – one node is configured as seed (in case of using MongoDB for usrloc, both nodes were seed)
- if a non-seed node restarts, it gets usrloc from seed one via bin interface
- if a seed node is restarted, we have to get all usrloc records from non-seed one using ‘opensipsctl fifo ul_cluster_sync’ command
Key settings:
loadmodule “usrloc.so”
modparam(“usrloc”, “db_url”, “mysql://opensips:pass@10.145.213.63/opensips”)
modparam(“usrloc”, “nat_bflag”, “NAT”)
modparam(“usrloc”, “working_mode_preset”, “full-sharing-cluster”)
modparam(“usrloc”, “location_cluster”, 1)
modparam(“usrloc”, “use_domain”, 1)
loadmodule “clusterer.so” # requires proto_bin.so
modparam(“clusterer”, “current_id”, 1)
modparam(“clusterer”, “db_mode”, 1)
modparam(“clusterer”, “db_url”, “mysql://opensips:pass@10.145.213.63/opensips”)
# initial INVITE
if(is_method("INVITE")) {
t_on_failure("1");
$var(lookup_flags) = "m";
if (cluster_check_addr("1", "$si")) {
xlog("si: $si . $rm from cluster, doing local lookup only\n");
} else {
xlog("si: $si . $rm from outside, doing global lookup\n");
$var(lookup_flags) = $var(lookup_flags) + "g";
}
if (!lookup("location", "$var(lookup_flags)")) {
t_reply("404", "Not Found");
exit;
}
if (has_body("application/sdp")) {
rtpengine_offer("RTP/AVP replace-origin replace-session-connection ICE=remove");
}
} # initial invite END
UPD: some useful notes from Liviu Chircu: http://lists.opensips.org/pipermail/users/2019-October/041819.html
Pay attention: according to his advice, we don’t need any data in ‘sip_addr’ columns when creating a full-sharing usrloc cluster. In case of federated cluster we have to fill them with IP addresses on which OpenSIPS nodes are listening.