<div dir="ltr">Maybe you have to enable another dmq_usrloc modparam [1]<div><br></div><div>[1] <a href="https://www.kamailio.org/docs/modules/5.6.x/modules/dmq_usrloc.html#usrloc_dmq.p.replicate_socket_info">https://www.kamailio.org/docs/modules/5.6.x/modules/dmq_usrloc.html#usrloc_dmq.p.replicate_socket_info</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 9, 2022 at 4:38 PM harneet singh <<a href="mailto:hbilling@gmail.com">hbilling@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Experts,<div><br></div><div>We have been using Kamailio in an Active/Standby Pair(with Keepalived under the rugs moving the single Virtual IP to access the Active Kamailio) for sometime now. <b>Kamailio also acts as a Registrar for our webrtc endpoints. </b></div><div>It has been serving the purpose pretty well and now we have a requirement where we need to be syncing the Registration DB between Two Pairs of Kamailios.</div><div><br></div><div> Kamailio-Active(<b>Pair 1</b>) -------- Kamailio-Standby(<b>Pair 1</b>)<br clear="all"><div>                                          ||</div><div> Kamailio-Active(<b>Pair 2</b>) -------- Kamailio-Standby(<b>Pair 2</b>)    </div><div><br></div><div>We generally keep the counterpart in the same Pair as a notifier(

<b>modparam("dmq", "notification_address", "sip:PEER1_IP:5060")</b>

) so as to sync the dialogs and the userloc data too(

<b>modparam("dmq_usrloc", "enable", 1)
</b>
). </div><div>In order to achieve the said requirement with the other Pair, we added another "<b>notification_address</b>" in the kamailio cfg. At this point, we ran into weird issues.</div><div><br></div><div><b>1. </b>With Kamailio ver <b>5.3.2, </b>the subsequent <b>notification_address </b>line in the cfg file, seemed to be overriding the previous one. Hence we see only the latter peer in the dmq list nodes.</div><div>    Example:</div><div>            <span style="font-family:Calibri;font-size:11pt">modparam("dmq",
"notification_address", "sip:<b>172.27.45.77</b>:5090")</span></div>

<div><span style="font-family:Calibri;font-size:11pt">             modparam("dmq",
"notification_address", "sip:<b>172.27.45.200</b>:5090")</span>         </div><div> </div><div>        In this case, the "<b>kamcmd dmq.list_nodes</b>" would show the local Machine and 172.27.45.200 as the only nodes in the output, ie <b>172.27.45.77 is not showing up at all,</b> which is problematic, since the local machine(172.27.45.243 in our case) would not been able to send any dmq sync info to its peer(172.27.45.77) in the same Pair.</div><div><br></div><div>  To see if the above issue might have been addressed in later release, we upgraded to the latest Kamailio ver <b>5.6.0</b></div><div><b>To our respite, the above issue no longer exists in the new version</b>(though not sure which immediate release after v 5.3.2 it would have been initially fixed.)</div><div>This is where we have a new issue explained below:</div><div><b><br></b></div><div><b>2. </b>The registration data does get synced to the peer Kamailio in the same Pair, and also to the Kamailio instances in the other Pair. However, the <b>Socket</b> Parameter in "<b>kamctl ul show</b>" output shows <b>[not set] </b>even on the side where the websocket connection actually exists. </div><div><br></div><div>[root@localhost ~]# <b>kamctl ul show </b><br>{<br>  "jsonrpc":  "2.0",<br>  "result": {<br>    "Domains":  [{<br>        "Domain": {<br>          "Domain": "location",<br>          "Size": 1024,<br>          "AoRs": [{<br>              "Info": {<br>                "AoR":  "9008077221",<br>                "HashID": 1952082106,<br>                "Contacts": [{<br>                    "Contact":  {<br>                      "Address":  "<a href="mailto:sip%3AHarneet_qifir@172.24.58.210" target="_blank">sip:Harneet_qifir@172.24.58.210</a>",<br>                      "Expires":  159,<br>                      "Q":  -1,<br>                      "Call-ID":  "vfli2uv8du3ppda73q5ppe",<br>                      "CSeq": 106,<br>                      "User-Agent": "EngageDigital",<br>                      "Received": "sip:172.27.44.252:60070;transport=ws",<br>                      "Path": "[not set]",<br>                      "State":  "CS_NEW",<br>                      "Flags":  0,<br>                      "CFlags": 0,<br>                     <b> "Socket": "[not set]",   <<<<<<<<<<<<<<<<<<<<<<</b><br>                      "Methods":  7071,<br>                      "Ruid": "uloc-62f26e3b-2677-1",<br>                      "Instance": "<urn:uuid:4fbd3e96-b4de-497b-886d-1ca8ffa016a4>",<br>                      "Reg-Id": 1,<br>                      "Server-Id":  0,<br>                      "Tcpconn-Id": -1,<br>                      "Keepalive":  0,<br>                      "Last-Keepalive": 1660063892,<br>                      "KA-Roundtrip": 0,<br>                      "Last-Modified":  1660063892<br>                    }<br>                  }]<br>              }<br>            }<br>  ],<br><br></div><div>In order to confirm that the socket actually exists on this Kamailio instance, I am pasting the below outputs from the same machine, where ws dump and even the native netstat confirms that.</div><div><br></div><div>[root@localhost ~]# <b>netstat -tunelap | grep 60070</b><br>tcp        0      0 <a href="http://172.27.45.199:8080" target="_blank">172.27.45.199:8080</a>      <a href="http://172.27.44.252" target="_blank">172.27.44.252</a>:<b>60070</b>     <b>ESTABLISHED</b> 994        17322355   16230/kamailio      <br>[root@localhost ~]# <b>kamcmd ws.dump</b><br>{<br>   connections: {<br>                1: ws:<a href="http://172.27.44.252" target="_blank">172.27.44.252</a>:<b>60070</b> -> ws:<a href="http://172.27.45.199:8080" target="_blank">172.27.45.199:8080</a> (state: <b>OPEN</b>,  last used 24s ago, sub-protocol: sip)<br>  }<br>     info: {<br>               wscounter: 1<br>          truncated: no<br> }<br>}<br></div><div><br></div><div>We do need to distinguish the actual Kamailio instance where the websocket connection actually exists, so as to route the call ahead from the same instance, or if it does not exist(and it's merely a sync'ed registration data received over DMQ Channel), then the Kamailio should route the call ahead to the Kamailio instance in the other Pair, which can then route it ahead to the Registered webrtc endpoint. We were hoping to use the Socket Parameter output, but for the said problem, unable to use the same as an indicator. </div><div><br></div><div><b>So what would be the best way to identify which Kamailio has the websocket connection with the Actual endpoint</b>? Should we rely on the output of netstat or ws.dump to infer that? I mean this needs to be done in kamailio.cfg for each call, so want to know the best way, or if there is completely different approach that can be suggested?</div><div><br></div><div>Apologies for the long email, but any pointers will be much helpful.</div><div><br></div><div>Thanks & Regards,</div><div>Harneet Singh</div><div>                      </div>-- <br><div dir="ltr">"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth" - Sir Arthur Conan Doyle<br></div></div></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>