<p dir="ltr">Hi,</p>
<p dir="ltr">I think the best guide closest to your description is here : <a href="http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb">http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb</a></p>
<p dir="ltr">Here is what you need to do. (<i>Besides mentioning what you tried and what problems were faced</i>).</p>
<p dir="ltr">1 - Configure kamailio to use the DB schema where your users are stored with their password and PBX to use info.<br>
2 - Point Phones to REGISTER to your kamailio.<br>
3 - When a User makes a call execute query in Kamailio to find what client this user belongs to  and what Asterisk it should be routed to.<br>
4 - Send Calls to the selected Asterisk. </p>
<p dir="ltr">You can further add Memcache to save your DB query in step-3. </p>
<p dir="ltr">Good Part:<br>
1 - Kamailio Authenticates all users and calls.<br>
2 - One Public IP to point all domains/PBX tenants to. <br>
3 - Use RTPproxy to bridge media to Asterisks and you can shift your Asterisks on Private Subnet too.(depends on your design)<br>
4 - Sending a hand crafted REGISTER to Asterisk makes asterisk aware of the device state and hence BLF/MWI are handled by Asterisk.</p>
<p dir="ltr">Less Good Part: (As I see it)</p>
<p dir="ltr">Kamailio sends REGISTER packet to just one Asterisk ! thereby only one server out of pool is aware of the device states. It can be resolved by extra effort required as following:</p>
<p dir="ltr">      a) Yes we can use Dispatcher and send to failover/loadbalanced asterisks in the pool<br>
      b) A script of some sorts can be written and started in asterisk servers to share device states/hints and \<br>
          hence all asterisk servers in pool know whats going on. (I haven't tried it myself)<br>
      c) REGFWD route can be blocked and BLF, MWI are handled solely by Kamailio.  (<i> I personally had rough time with this mostly due to different standards </i>from IP Phones)</p>
<p dir="ltr">I'd love to hear other valuable suggestions and experiences. </p>
<p dir="ltr">Regards,<br>
Sammy </p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Hello Kevin,<div>If I understood properly you want to build a system which authenticates users and routes the Asterisk servers for communication.</div><div><br></div><div>First, Kamailio supports the routing, balancing and authentication. For example we use Kamailio and Freeswitch. Here the how its work:</div><div>We have 1 Kamailio server that makes routes and balancing issues.</div><div>First client goes to our Kamailio servers:</div><div><br></div><div><b>Client -> Internet -> Kamailio (authentication) (address, asked for communication)</b></div><div><br></div><div>After that, Kamailio looks the Freeswitch servers, which is free for routing.</div><div><br></div><div><b>                  (sending)</b></div><div><b>Kamailio -----------------> Freeswitch Server</b></div><div><b>                  (user req)</b></div><div><br></div><div>After routing proccess, Kamailio fade from the scene and clients start communicate with themselves via Freeswitch servers.</div><div><br></div><div>BTW, our Freeswitch servers and Kamailio servers stay on different servers. Of course you can serve on same server too.</div><div>If I understood properly, you can do it like this. If I did not, you can give more details for understanding :)</div><div><br></div><div>Regards.</div><div><br></div><div>Barış.</div><div><div><hr>From: <a href="mailto:kfpelletier@connextek.ca" target="_blank">kfpelletier@connextek.ca</a><br>To: <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>; <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>; <a href="mailto:buisness@lists.kamailio.org" target="_blank">buisness@lists.kamailio.org</a><br>Date: Fri, 26 Feb 2016 15:35:50 -0500<br>Subject: [SR-Users] Help<br><br>












<div>

<p>Hi,</p>

<p> </p>

<p>I work for a VOIP service provider, and have been tasked
with optimizing our infrastructure.  We have been providing VOIP services
to our clients via Asterisk VM’s (PIAF) in an ESXi environment, hosted in a
datacenter.  We are looking for some kind of SIP Router, which would
authenticate clients and route their SIP traffic to the appropriate
server.  By doing so, we are hoping to further secure our infrastructure
and to possibly have only one Public IP (which would resolve to the Private IP
of the SIP router).  The Asterisk servers serve
IVR/RINGGROUPS/OUTBOUNDTRUNKS/INBOUNDROUTES/OUTBOUNDROUTES.  The Sip
Router would therefore route all SIP traffic between the phones and the
Asterisk servers, ad the phones would register to the SIP Router.  I have
tried many solutions (Kamailio, OpenSER, siproxd, Brekeke), but have not been
able to configure these services to work the way we want them to.  I am
including a chart along with this email to outline what we would like to
accomplish.</p>

<p> </p>

<p>Any suggestions or guides would be immensely appreciated.</p>

<p> </p>

<p>Thank you all for your time. </p>

<p> </p>

<p> </p>

<p><img width="574" height="746" src="https://bay182.afx.ms/att/GetInline.aspx?messageid=97323db9-dd2b-11e5-a43e-002264c2c15c&attindex=0&cp=-1&attdepth=0&imgsrc=cid%3aimage001.png%4001D170AA.7BE6F5A0&cid=2b0a9cd0762d32a3&hm__login=baris.sekerciler&hm__domain=outlook.com&ip=10.148.202.8&d=d576&mf=4&hm__ts=Sat%2c%2027%20Feb%202016%2009%3a59%3a05%20GMT&st=baris.sekerciler%25outlook.com%407&hm__ha=01_8c29ac04e2732b509af03a6dca692f63647f210d90bd719c84a5b1630efa3503&oneredir=1"></p>

<p> </p>

<p> </p>

<div>

<div>

<p><b><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:gray">Kevin Farrell Pelletier - Technicien informatique</span></b><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#1f497d"> </span></p>

<p><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>

<p><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#1f497d"><img width="178" height="30" src="https://bay182.afx.ms/att/GetInline.aspx?messageid=97323db9-dd2b-11e5-a43e-002264c2c15c&attindex=1&cp=-1&attdepth=1&imgsrc=cid%3aimage002.jpg%4001D170AA.7BE6F5A0&cid=2b0a9cd0762d32a3&hm__login=baris.sekerciler&hm__domain=outlook.com&ip=10.148.202.8&d=d576&mf=4&hm__ts=Sat%2c%2027%20Feb%202016%2009%3a59%3a05%20GMT&st=baris.sekerciler%25outlook.com%407&hm__ha=01_d70ddc46ce35b840854ad95f118dcd11082d209c279965e21f330d7e627e858a&oneredir=1">  <br>
<br>
</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">TI<b>
//</b> Réseautique // Téléphonie IP <b>//</b> Programmation<br>
IT // Networking // VoIP // Application development<br>
<br>
9060, boul Parkway, Anjou, Québec, Canada H1J1N5<b><br>
Téléphone / Phone :</b> 514.907.2000 Ext.203<b> <br>
F :</b> 1.888.582.4001  -  <b>SF/TF :</b> 1.855.907.2001<b> Web : </b></span><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:#1f497d"><a href="http://www.connextek.ca/" target="_blank"><span style="font-size:12.0pt">www.connextek.ca</span></a></span><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:gray">
 </span><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">
</span><i><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:#a1a100"><br>
Pensez ENVIRONNEMENT, c'est important: n'imprimez que si nécessaire </span></i><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:#1f497d"><br>
</span><i><span style="font-size:10.0pt;font-family:"Times New Roman","serif";color:#a1a100">            Consider the
ENVIRONMENT before printing</span></i><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>

</div>

</div>

<p><i><br>
<br>
<br>
</i></p>

</div>




<br>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></div></div>                                         </div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></div>