<div>Sorry for delay, i was too busy with my work lately. Anyhow, I really doubt the software architecture you mentioned would scale or even work in the first place. Here is why,</div><div><br></div><div>1. You are registering same user &lt;number-of-asterisk-instance&gt; + 1 times, so if you have two asterisk behind kamailio then a single user registers on both asterisks as well as kamailio server. This is NOT load balancing but wastage of resources instead. Asterisk&#39;s capacity as SIP registrar is much much lower then kamailio, so whole system&#39;s capacity actually reduces down to asterisk capacity instead of increasing above kamailio.</div>

<div><br></div><div>2. You are using stateless forwarding, which completely disables any possibility of fail-over. Not only that, it will cause your calls kind bounce around between asterisk instances. How? its simple, user A wants to call user B, call comes to kamailio, which picks one asterisk instance through dispatcher and route calls to asterisk. When call comes to asterisk, it sees that user B is registered on kamailio, so it tries to forward call to kamailio. When call comes to kamailio, kamailio again picks next asterisk (due to round robin rule you are using) and send call to that asterisk, which again does the same thing as first asterisk, so call bounces between kamailio and all asterisk instance one by one till dispatcher list exhausts and eventually call is dropped. You may try to stop this by correcting DISPATCHER and FROMASTERISK routes but i guess call will still loop at least once.</div>

<div><br></div><div>The solution is simple, forget asterisk realtime integration, use kamailio as registrar and proxy. Use asterisk instances as services bridge which are load balanced by kamailio through dispatcher.</div>

<div><br></div><div>Hope this helps.</div><div><br></div><div>Thank you.</div><div><br></div><div><br></div><div class="gmail_quote">On Tue, Mar 5, 2013 at 4:39 PM, Prakash N <span dir="ltr">&lt;<a href="mailto:prakash.n@tevatel.com" target="_blank">prakash.n@tevatel.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div><br></div><div>    I am facing some challenge with dispatcher configuration with two Asterisk </div>

<div><br></div><div>    I have installed Kamailio and  two Asterisk server  and Phones are register with Asterisk through Kamailio </div>

<div>    I have followed this link <a href="http://lists.sip-router.org/pipermail/sr-users/2011-April/068175.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/2011-April/068175.html</a></div><div><br></div>

<div>    Now  i have added dispatcher module and dispatcher list also </div>

<div><br></div><div>    I am try to route all calls to Asterisk with load balance</div><div><br></div><div>  Can please advice the step by step configuration to route calls  from Kamailio   to two Asterisk ( one call first Asterisk and Second call to other asterisk )</div>



<div><br></div><div>With Regards</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>N.Prakash </div></font></span><div class="HOEnZb"><div class="h5"><div><br>
</div><br><br><div class="gmail_quote">On Mon, Mar 4, 2013 at 10:03 AM, Prakash N <span dir="ltr">&lt;<a href="mailto:prakash.n@tevatel.com" target="_blank">prakash.n@tevatel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><br></div><div>Hi Muhammad,</div><div><br></div><div>We are following below document for Kamailio and Asterisk integration</div><div><br></div><div><a href="http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb" target="_blank">http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb</a> </div>





<div><br></div><div><br></div><div>We are plan use one Kamailio with Multiple asterisk  (Queue,IVR and Conference purpose) </div><div><br></div><div><br></div>Now calls are landing to asterisk with load balancing using  dispatcher for Queue and IVR (One asterisk first and next Asterisk for second calls )<div>





<br></div><div>But if try to calls extension it is landing both Asterisk server instead landing one asterisk first and next Asterisk for second calls </div><div><br></div><div>Please advice</div><div><br></div><div>With Regards</div>




<span><font color="#888888">
<div><br></div></font></span><div><span><font color="#888888">N.Prakash</font></span><div><div><br><div><br><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 7:07 PM, Muhammad Shahzad <span dir="ltr">&lt;<a href="mailto:shaheryarkh@gmail.com" target="_blank">shaheryarkh@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am not sure what you are trying to do. Your description is too brief to understand. Can you send me complete call flow?<div>





<br></div><div>Thank you.</div><div><div><div><br><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 2:18 PM, Prakash N <span dir="ltr">&lt;<a href="mailto:prakash.n@tevatel.com" target="_blank">prakash.n@tevatel.com</a>&gt;</span> wrote:<br>







<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div>   Hi Muhammad,<div><br></div><div>    Thanks for your mail</div><div><br></div><div>   Actually we are trying to do load balance with one Kamailio with multiple Asterisk  server</div>







<div><br></div><div>   Now if call Queue,IVR to Kamailio it routing to asterisk with ramdam strategy load balance  ( first call on one and second to other server )</div>

<div>  If i call extension to extension it is landing to all Asterisk ( I have use all Asterisk feature for that i want to route all call to asterisk ) on the same time ,How to do load balance  for extension calling also</div>









<div><br></div><div>We are not sure what we are tiring  doi is right or wrong</div><div><br></div><div>Please advice and correct us if anything wrong</div><div><br></div><div>With Regards</div><span><font color="#888888"><div>







<br></div><div>N.Prakash</div></font></span><div><div>

<div><br></div><div> <br><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 6:30 PM, Muhammad Shahzad <span dir="ltr">&lt;<a href="mailto:shaheryarkh@gmail.com" target="_blank">shaheryarkh@gmail.com</a>&gt;</span> wrote:<br>









<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why are you forwarding instead of relaying the message to selected destination? Forward is stateless and therefore likely to have NAT issues, specially if destination server is behind NAT or client is behind NAT and destination server is unable to handle NAT etc. etc.<div>











<br></div><div>Also typically dispatcher is used to load balance calls between two or more upstream server, not for load balancing extensions within one server, though with some tweaking that might also be achieved but better to do this kind of thing on destination server rather then on kamailio.<div>











<br></div><div>Thank you.</div><div><div><div><br><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 10:31 AM, Prakash N <span dir="ltr">&lt;<a href="mailto:prakash.n@tevatel.com" target="_blank">prakash.n@tevatel.com</a>&gt;</span> wrote:<br>











<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>  Can you please advice for the below issue</div><div><br></div><div>With Regards</div><span><font color="#888888"><div>











<br></div></font></span><div><span><font color="#888888">N.Prakash</font></span><div><div><br><div><br></div><div><br><br><div class="gmail_quote">On Fri, Mar 1, 2013 at 9:32 AM, Prakash N <span dir="ltr">&lt;<a href="mailto:prakash.n@tevatel.com" target="_blank">prakash.n@tevatel.com</a>&gt;</span> wrote:<br>













<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Hi All,</span><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">














<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">We have finished the Kamailio &amp; Asterisk real time integration and load balancing also done using dispatcher module.</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Queue and voice mails are load balancing as well.When we are calling extension to extension it is showing in all the servers.It seems extension are not load balancing as per our knowledge.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">














<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">I have attached the kamailio.cfg for your reference,Find my coding below as mentioned.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">














<font color="#ff0000"><br></font></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><div><b><font color="#ff0000"># -- dispatcher params for DB support --</font></b></div>
<div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;,&quot;db_url&quot;, &quot;mysql://<a href="http://openser:openserrw@192.168.1.170/openser" style="color:rgb(17,85,204)" target="_blank">openser:openserrw@192.168.1.170/openser</a>&quot;)</font></b></div>














<div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;, &quot;table_name&quot;, &quot;dispatcher&quot;)</font></b></div><div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;, &quot;setid_col&quot;, &quot;setid&quot;)</font></b></div>














<div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;, &quot;destination_col&quot;, &quot;destination&quot;)</font></b></div><div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;, &quot;flags_col&quot;, &quot;flags&quot;)</font></b></div>














<div><b><font color="#ff0000">modparam(&quot;dispatcher&quot;, &quot;priority_col&quot;, &quot;priority&quot;)</font></b></div><div><b><font color="#ff0000"><br></font></b></div><div><b><font color="#ff0000">-----------------------------------------------------------------------------------------</font></b></div>














<div><b><font color="#ff0000"># Dispatch requests</font></b></div><div><b><font color="#ff0000">route[DISPATCH] {</font></b></div><div><b><font color="#ff0000">if ( method==&quot;INVITE&quot; ) {</font></b></div><div><b><font color="#ff0000"># dst_select( &quot;GROUP&quot;, &quot;HASH METHOD&quot;)</font></b></div>














<div><b><font color="#ff0000">  ds_select_dst(&quot;1&quot;,&quot;4&quot;);</font></b></div><div><b><font color="#ff0000">  sl_send_reply(&quot;100&quot;,&quot;Trying&quot;);</font></b></div><div><b><font color="#ff0000">  forward();#uri:host, uri:port);</font></b></div>














<div><b><font color="#ff0000">  exit();</font></b></div><div><b><font color="#ff0000">}}</font></b></div></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Kindly suggest the solution for the same.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Thanks in advance.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Regards,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">N.Prakash</div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">











<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">------------------------------</span><span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">-----</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">











<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">











<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">shaheryarkh@googlemail.com</a>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">







<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">------------------------------</span><span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">-----</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">







<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">







<span style="color:rgb(136,136,136);font-size:13px;font-family:arial,sans-serif">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">shaheryarkh@googlemail.com</a>
</div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">------------------------------</span><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-----</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shaheryarkh@googlemail.com</a>
<div><br></div>