<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">Why not to use Kamailio in stateless mode?<br />
Also maybe this link would help you http://saevolgo.blogspot.com/2012/07/clustering-sip-proxy-opensipskamailio.html</div>
<div name="messageSignatureSection"><br />
Regards, Igor</div>
<div name="messageReplySection"><br />
26 авг. 2017 г., 13:03 +0300, Donat Zenichev <donat.zenichev@gmail.com>, писал:<br />
<blockquote type="cite">
<div dir="ltr">I've searched through the sr users list and found a few discussions on this count.
<div><br /></div>
<div>So the way (as I think) that is more relevant for kamailio failover, is solution with DNS:  NAPTR -> SRV records.</div>
<div><br /></div>
<div>Like:</div>
<div><br /></div>
<div>NAPTR record:</div>
<div>"IN NAPTR 10 10 SIP+D2U "" _sip._<a href="http://udp.domain.org">udp.domain.org</a>"</div>
<div><br /></div>
<div>SRV records:</div>
<div>"_sip._<a href="http://udp.domain.org">udp.domain.org</a>  SRV  10  1  5060  <a href="http://kamailio1.domain.org">kamailio1.domain.org</a>"<br /></div>
<div>"_sip._<a href="http://udp.domain.org">udp.domain.org</a>  SRV  10  1  5060  <a href="http://kamailio2.domain.org">kamailio2.domain.org</a>"<br /></div>
<div><br /></div>
<div>A records:</div>
<div>"kamailio1   IN  A  10.0.0.1"<br /></div>
<div>"kamailio2   IN  A  10.0.0.2"<br /></div>
<div><br /></div>
<div>So each kamailio will add rr with own hostname - e.g. <a href="http://kamailio1.domain.org">kamailio1.domain.org</a></div>
<div>So that, client will send in-dialog requests to route with fqdn <a href="http://kamailio1.domain.org">kamailio1.domain.org</a></div>
<div>And I can't add to rr <a href="http://sip.domain.org">sip.domain.org</a>, because every new request (whatever it is initial or indialog) will be sent to one of the kamailio servers, but I need to send in-dialog requests to the same kamailio.</div>
<div><br /></div>
<div>So for the goal of failover, I need to have more A records, like:</div>
<div>
<div>"kamailio1   IN  A  10.0.0.1"<br /></div>
<div>"kamailio1   IN  A  10.0.0.2"<br /></div>
<div>"kamailio2   IN  A  10.0.0.2"</div>
</div>
<div>"kamailio2   IN  A  10.0.0.1"<br /></div>
<div><br /></div>
<div>And in case when kamailio 1 goes down, uac will have two ip dst to send request: 10.0.0.1 and 10.0.0.2 (where indeed second one is kamailio2).</div>
<div>So as result I will have one database for userlocation and dialog module, and loadbalancing based on SRV priority/weight fields.</div>
<div><br /></div>
<div>And as failover, A records, that give possibility to send requests first to 10.0.0.1 and second to 10.0.0.2 (if rr was bind to kamailio1).</div>
<div>And otherwise, if rr was defined as kamailio2, first request tries to achive kamailio1 and then kamailio2.</div>
<div><br /></div>
<div>Am I right at this point?</div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
</div>
<div class="gmail_extra"><br />
<div class="gmail_quote">2017-08-22 21:57 GMT+03:00 Donat Zenichev <span dir="ltr"><<a href="mailto:donat.zenichev@gmail.com" target="_blank">donat.zenichev@gmail.com</a>></span>:<br />
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi.
<div><br /></div>
<div>I came up with idea to set up stand with two kamailio and one b2bua server (for routing).</div>
<div><br /></div>
<div>The idea consists of failover for dialogs, transactions.</div>
<div>So if one of kamailio nodes is down, another one is able to catch up the dialog and let users to properly end up the session.</div>
<div><br /></div>
<div>For better realizing of it, I will try to describe the idea step by step:</div>
<div>1. UAC invites UAS, they've done three-way-handshake, media stream is up.</div>
<div>2. Kamailio that processed this dialog is down.</div>
<div>3. Users decided to end the session with BYE method, but proxy that processed their three-way-handshake recently is down, so one of ua sends BYE to the destination route that contains domain name (that both kamailio serve), BYE achieves the second kamailio to let him properly end the dialog.</div>
<div> But, there is a big but, this second kamailio hasn't ever known about this dialog, he doesn't support any transactions for it and furthermore he doesn't know anything about this call-id.</div>
<div><br /></div>
<div>So the solution for it, as I think, is hidden in db mode for user location (columns that contain call-ids, branches etc.</div>
<div>But I need to be sure, if I'm on the right way.</div>
<div><br /></div>
<div>For purpose, where one ip is served by two nodes, I have two solutions:</div>
<div><br /></div>
<div>-First one. I want to create heartbeat cluster with two kamailio nodes, they will have one shared ip address, so when one node gets down, another one brings up shared ip interface and implements the same actions that master does.</div>
<div><br /></div>
<div>-Another method is to assign a few ip addresses to one domain name (ip addresses of different kamailio proxies).</div>
<div><br /></div>
<div><br /></div>
<div>So the goal looks simple, if someone has ever done something like that, I will be glad to read the ideas.</div>
<span class="HOEnZb"><font color="#888888"></font></span>
<div><span class="HOEnZb"><font color="#888888"></font></span>
<div><span class="HOEnZb"><font color="#888888"><br /></font></span></div>
<span class="HOEnZb"><font color="#888888">-- <br /></font></span>
<div class="m_8616329812126089398m_2950283228654730570gmail_signature" data-smartmail="gmail_signature"><span class="HOEnZb"><font color="#888888"></font></span>
<div dir="ltr"><span class="HOEnZb"><font color="#888888"><span>-- <br /></span>BR, Donat Zenichev<br />
Wnet VoIP team<br />
Tel:  <a dir="ltr" href="tel:+380(44)%205-900-808" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="21">+380(44) 5-900-808</a><br />
<a href="http://wnet.ua" target="_blank">http://wnet.ua</a></font></span></div>
</div>
</div>
</div>
</blockquote>
</div>
<br />
<br clear="all" />
<div><br /></div>
--<br />
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr"><span>-- <br /></span>BR, Donat Zenichev<br />
Wnet VoIP team<br />
Tel:  <a dir="ltr" href="tel:+380(44)%205-900-808" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="23">+380(44) 5-900-808</a><br />
<a href="http://wnet.ua" target="_blank">http://wnet.ua</a></div>
</div>
</div>
_______________________________________________<br />
Kamailio (SER) - Users Mailing List<br />
sr-users@lists.kamailio.org<br />
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<br /></blockquote>
</div>
</body>
</html>