<div dir="ltr">Hi,<br>do you ever get the feeling you are going nuts? Anyways...<br>I have 2 opensips servers, both version 3.2.12, on debian 11<br>they both share the same configuration, and start opensips using m4 as follows: `opensips -F -f /etc/opensips/opensips.cfg -p "m4 /etc/opensips/env.m4 -"`<br><br><br>m4 server1:divert(-1)<br>define(`M4_LAN_IP', `10.0.0.124')<br>define(`M4_WAN_IP', `10.0.0.124')<br>define(`M4_CLUSTER_NODE_ID', `1')<br>define(`M4_SHARING_TAG', `node_1')<br>define(`M4_CLUSTER_ID', `1')<br>divert(0)dnl<br><br><br>m4 server 2:divert(-1)<br>define(`M4_LAN_IP', `10.0.0.125')<br>define(`M4_WAN_IP', `10.0.0.125')<br>define(`M4_CLUSTER_NODE_ID', `2')<br>define(`M4_SHARING_TAG', `node_2')<br>define(`M4_CLUSTER_ID', `1')<br>divert(0)dnl<br><br><br>configuration:<br>debug_mode=no<br><br>log_level=2<br>xlog_level=2<br>log_stdout=yes<br>log_stderror=yes<br>log_facility=LOG_LOCAL0<br><br>auto_aliases=no<br><br>server_signature=yes<br><br>socket=udp:<a href="http://0.0.0.0:5060">0.0.0.0:5060</a> as M4_WAN_IP:5060<br>socket=tcp:<a href="http://0.0.0.0:5060">0.0.0.0:5060</a> as M4_WAN_IP:5060<br>socket=tls:<a href="http://0.0.0.0:5061">0.0.0.0:5061</a> as M4_WAN_IP:5061<br>socket=bin:<a href="http://0.0.0.0:5555">0.0.0.0:5555</a> as M4_WAN_IP:5555<br><br>tcp_connect_timeout=300<br><br>mpath="/usr/lib64/opensips/modules/"<br><br>loadmodule "tls_openssl.so"<br><br>loadmodule "tls_mgm.so"<br>modparam("tls_mgm", "tls_library", "openssl")<br><br>modparam("tls_mgm", "server_domain", "sd_1")<br>modparam("tls_mgm", "ca_list", "[sd_1]/opt/letsencrypt/fullchain.pem")<br>modparam("tls_mgm", "ca_dir", "[sd_1]/etc/ssl/certs")<br>modparam("tls_mgm", "certificate", "[sd_1]/opt/letsencrypt/cert.pem")<br>modparam("tls_mgm", "private_key", "[sd_1]/opt/letsencrypt/privkey.pem")<br>modparam("tls_mgm", "require_cert", "[sd_1]0")<br>modparam("tls_mgm", "tls_method", "[sd_1]TLSv1-")<br>modparam("tls_mgm", "verify_cert", "[sd_1]0")<br>modparam("tls_mgm", "ec_curve", "[sd_1]secp521r1")<br><br>modparam("tls_mgm", "client_domain", "cd_1")<br>modparam("tls_mgm", "ca_list", "[cd_1]/opt/letsencrypt/fullchain.pem")<br>modparam("tls_mgm", "ca_dir", "[cd_1]/etc/ssl/certs")<br>modparam("tls_mgm", "certificate", "[cd_1]/opt/letsencrypt/cert.pem")<br>modparam("tls_mgm", "private_key", "[cd_1]/opt/letsencrypt/privkey.pem")<br>modparam("tls_mgm", "require_cert", "[cd_1]0")<br>modparam("tls_mgm", "tls_method", "[cd_1]TLSv1-")<br>modparam("tls_mgm", "verify_cert", "[cd_1]0")<br>modparam("tls_mgm", "ec_curve", "[cd_1]secp521r1")<br>modparam("tls_mgm", "match_sip_domain", "[cd_1]*")<br>modparam("tls_mgm", "match_ip_address", "[cd_1]*")<br><br>loadmodule "cachedb_mongodb.so"<br><br>loadmodule "db_mysql.so"<br>modparam("db_mysql", "exec_query_threshold", 0)<br>modparam("db_mysql", "timeout_interval", 5)<br>modparam("db_mysql", "max_db_queries", 5)<br>modparam("db_mysql", "max_db_retries", 5)<br><br>loadmodule "clusterer.so"<br>modparam("clusterer", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")<br>modparam("clusterer", "my_node_id", M4_CLUSTER_NODE_ID)<br>modparam("clusterer", "seed_fallback_interval", 5)<br>modparam("clusterer", "sharing_tag", "M4_SHARING_TAG/M4_CLUSTER_ID=active")<br><br>loadmodule "signaling.so"<br><br>loadmodule "sl.so"<br><br>loadmodule "tm.so"<br>modparam("tm", "auto_100trying", 0)<br>modparam("tm", "fr_inv_timeout", 120)<br>modparam("tm", "fr_timeout", 30)<br>modparam("tm", "onreply_avp_mode", 1)<br>modparam("tm", "restart_fr_on_each_reply", 0)<br><br>loadmodule "rr.so"<br>modparam("rr", "append_fromtag", 1)<br><br>loadmodule "dialog.so"<br>modparam("dialog", "cachedb_url", "mongodb://<a href="http://10.0.0.120:27017/opensipsDB.dialog">10.0.0.120:27017/opensipsDB.dialog</a>")<br>modparam("dialog", "default_timeout", 14400) # 4 hours<br>modparam("dialog", "dialog_replication_cluster", M4_CLUSTER_ID)<br>modparam("dialog", "dlg_match_mode", 1)<br>modparam("dialog", "enable_stats", 1)<br>modparam("dialog", "profile_replication_cluster", M4_CLUSTER_ID)<br>modparam("dialog", "profiles_no_value", "shared/s")<br>modparam("dialog", "profiles_with_value", "caller")<br><br>loadmodule "topology_hiding.so"<br>modparam("topology_hiding", "force_dialog", 1)<br><br>loadmodule "uac.so"<br>modparam("uac", "restore_mode", "auto")<br>modparam("uac", "force_dialog", yes)<br><br>loadmodule "permissions.so"<br>modparam("permissions", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")<br><br>loadmodule "sipmsgops.so"<br><br>loadmodule "textops.so"<br><br>loadmodule "callops.so"<br><br>loadmodule "usrloc.so"<br>modparam("usrloc", "cachedb_url", "mongodb://<a href="http://10.0.0.120:27017/opensipsDB.usrloc">10.0.0.120:27017/opensipsDB.usrloc</a>")<br>modparam("usrloc", "location_cluster", M4_CLUSTER_ID)<br>modparam("usrloc", "nat_bflag", "NAT")<br>modparam("usrloc", "use_domain", 1)<br>modparam("usrloc", "working_mode_preset", "federation-cachedb-cluster")<br><br>loadmodule "registrar.so"<br>modparam("registrar", "max_contacts", 1)<br>modparam("registrar", "tcp_persistent_flag", "TCP_PERSIST_DURATION")<br><br>loadmodule "mid_registrar.so"<br>modparam("mid_registrar", "max_contacts", 1)<br>modparam("mid_registrar", "mode", 0)<br>modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")<br><br>loadmodule "proto_bin.so"<br><br>loadmodule "proto_udp.so"<br><br>loadmodule "proto_tcp.so"<br><br>loadmodule "proto_tls.so"<br><br>route {<br>  if (has_totag()) {<br>    if (topology_hiding_match("DID_FALLBACK")) {<br>    } else if (loose_route()) {<br>      if ($DLG_status != NULL && !validate_dialog()) {<br>        exit;<br>      }<br>    } else {<br>      if (is_method("ACK")) {<br>        if (t_check_trans()) {<br>          t_relay();<br>        }<br>        exit;<br>      }<br><br>      sl_send_reply(404, "Not Found");<br>      exit;<br>    }<br><br>    t_relay();<br><br>    exit;<br>  }<br><br>  if (is_method("CANCEL")) {<br>    if (t_check_trans()) {<br>      t_relay();<br>    }<br>    exit;<br>  }<br><br>  t_check_trans();<br><br>  if (is_myself($si)) {<br>    sl_send_reply(406, "Not Acceptable");<br>    exit;<br>  }<br><br>  if (is_method("REGISTER")) {<br>    mid_registrar_save("location", "p0", , , "M4_SHARING_TAG");<br>    switch ($retcode) {<br>      case 1:<br>        $ru = "sip:<a href="http://sip.test.com">sip.test.com</a>";<br>        t_relay();<br>        break;<br>      case 2:<br>        break;<br>      default:<br>        break;<br>    }<br><br>    exit;<br>  }<br><br>  if ($rU == NULL) {<br>    sl_send_reply(484, "Address Incomplete");<br>    exit;<br>  }<br><br><br>  if (is_method("INVITE")) {<br>    if (!create_dialog("B")) {<br>      sl_send_reply(500, "Internal Server Error");<br>      exit;<br>    }<br><br>    if (is_registered("location")) {<br>      $ru = "sip:" + $tU + "@<a href="http://sip.test.com">sip.test.com</a>";<br>    } else {<br>      t_reply(404, "Not Found");<br>      exit;<br>    }<br><br>    topology_hiding("UC");<br><br>    t_reply(100, "Giving it a try");<br><br>    set_dlg_sharing_tag("M4_SHARING_TAG");<br>    set_dlg_profile("shared");<br>  }<br><br>  route(relay);<br>}<br><br>route[relay] {<br>  if (!t_relay()) {<br>    sl_send_reply(500, "Internal Error");<br>  }<br><br>  exit;<br>}<br><br><br>With this configuration I can make a sip client register, and make calls, and I also get the usrloc collection in mongodb.<br><br>But why isn't the dialog collection created??<br><br>If I do the following commands: `opensips-cli -x mi clusterer_list` `opensips-cli -x mi clusterer_list_topology` `opensips-cli -x mi clusterer_list_shtags` `opensips-cli -x mi dlg_list`<br>I can see the clusterer is setup correctly, the nodes are there, the tags are there as active/backup, and they are both aware of the dialog. So they are sharing it over the bin interface, but why is it not saved in mongodb??<br><br>Follow up problem that's making me nuts: let's say call starts on the second server, so it's tagged as `node_2`<br><div>if I go on the first server and do `opensips-cli -x mi clusterer_shtag_set_active node_2/1` it makes the tag active on the first server and I can then `clusterer_list_shtags` and see that the tag has become active on the first node and backup on the second node, but nothing else happens.</div><div>Shouldn't the call be re-homed with a reinvite or an update??</div>If I try to re-home it manually on the first server with `opensips-cli -x mi dlg_send_sequential callid=afb2fe39aec0470f9cd3a010239f8aca mode=challenge body=outbound` it fails with 408 timeout.<br><br><div>What am I missing???</div><div><br></div><div>Thanks</div></div>