<span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: 16px; "><div style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px; font: normal normal normal small/normal arial; ">
Hi,<div><br></div><div>I have the following configuration for my opensips server with mysql. I have showed the mysql table and opensips cfg file content. The issue I am facing is when I place 20 calls to opensips it routes 10 calls to 10.128.46.103 and it disconnects the rest of the calls, it doesnot even go for the other gate way. Please help me.</div>
<div><br></div><div>--Rajib</div><div><p class="MsoNormal">mysql&gt; select * from load_balancer;</p><p class="MsoNormal">+----+----------+------------------------+-----------+------------+-------------+</p><p class="MsoNormal">
| id | group_id | dst_uri<span>                </span>| resources | probe_mode | description |</p><p class="MsoNormal">+----+----------+------------------------+-----------+------------+-------------+</p><p class="MsoNormal">
|<span>  </span>1 |<span>        </span>1 | sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a> | pstn=10<span>   </span>|<span>          </span>2 | gateway_2<span>   </span>|</p><p class="MsoNormal">|<span>  </span>2 |<span>        </span>1 | sip:<a href="http://10.128.46.50:5060">10.128.46.50:5060</a><span>  </span>| pstn=25<span>   </span>|<span>          </span>2 | gateway_3<span>   </span>|</p>
<p class="MsoNormal">+----+----------+------------------------+-----------+------------+-------------</p><p class="MsoNormal">Routing Script:</p><p class="MsoNormal">debug=3</p><p class="MsoNormal">memlog=1</p><p class="MsoNormal">
log_stderror=no</p><p class="MsoNormal">log_facility=LOG_LOCAL0</p><p class="MsoNormal"> </p><p class="MsoNormal">fork=yes</p><p class="MsoNormal">children=4</p><p class="MsoNormal">check_via=no<span>     </span># (cmd. line: -v)</p>
<p class="MsoNormal">dns=off<span>          </span># (cmd. line: -r)</p><p class="MsoNormal">rev_dns=off<span>      </span># (cmd. line: -R)</p><p class="MsoNormal"> </p><p class="MsoNormal">port=5060</p><p class="MsoNormal">
 </p><p class="MsoNormal">#set module path</p><p class="MsoNormal">mpath=&quot;/usr/local/lib/opensips/modules/&quot;</p><p class="MsoNormal"> </p><p class="MsoNormal">loadmodule &quot;maxfwd.so&quot;</p><p class="MsoNormal">
loadmodule &quot;sl.so&quot;</p><p class="MsoNormal">loadmodule &quot;db_mysql.so&quot;</p><p class="MsoNormal">loadmodule &quot;tm.so&quot;</p><p class="MsoNormal">loadmodule &quot;xlog.so&quot;</p><p class="MsoNormal">loadmodule &quot;uri.so&quot;</p>
<p class="MsoNormal">loadmodule &quot;rr.so&quot;</p><p class="MsoNormal">loadmodule &quot;dialog.so&quot;</p><p class="MsoNormal">loadmodule &quot;mi_fifo.so&quot;</p><p class="MsoNormal">loadmodule &quot;signaling.so&quot;</p>
<p class="MsoNormal">loadmodule &quot;textops.so&quot;</p><p class="MsoNormal">loadmodule &quot;load_balancer.so&quot;</p><p class="MsoNormal"> </p><p class="MsoNormal">modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/opensips_fifo&quot;)</p>
<p class="MsoNormal">modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 13)</p><p class="MsoNormal">modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 1)</p><p class="MsoNormal">modparam(&quot;dialog&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</p>
<p class="MsoNormal"> </p><p class="MsoNormal">modparam(&quot;rr&quot;,&quot;enable_double_rr&quot;,1)</p><p class="MsoNormal">modparam(&quot;rr&quot;,&quot;append_fromtag&quot;,1)</p><p class="MsoNormal"> </p><p class="MsoNormal">
modparam(&quot;load_balancer&quot;, &quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</p><p class="MsoNormal">modparam(&quot;load_balancer&quot;, &quot;probing_interval&quot;, 10)</p><p class="MsoNormal">
 </p><p class="MsoNormal">route{</p><p class="MsoNormal"><span>        </span>if (!mf_process_maxfwd_header(&quot;10&quot;)) {</p><p class="MsoNormal"><span>                </span>sl_send_reply(&quot;483&quot;,&quot;looping&quot;);</p>
<p class="MsoNormal"><span>                </span>exit;</p><p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"><span>        </span>if (!has_totag()) {</p>
<p class="MsoNormal"><span>                </span># initial request</p><p class="MsoNormal"><span>                </span>record_route();</p><p class="MsoNormal"><span>        </span>} else {</p><p class="MsoNormal"><span>      </span><span>          </span># sequential request -&gt; obey Route indication</p>
<p class="MsoNormal"><span>                </span>loose_route();</p><p class="MsoNormal"><span>                </span>t_relay();</p><p class="MsoNormal"><span>                </span>exit;</p><p class="MsoNormal"><span>        </span>}</p>
<p class="MsoNormal"><span>   </span># handle cancel and re-transmissions</p><p class="MsoNormal"><span>        </span>if ( is_method(&quot;CANCEL&quot;) ) {</p><p class="MsoNormal"><span>                </span>if ( t_check_trans() )</p>
<p class="MsoNormal"><span>                        </span>t_relay();</p><p class="MsoNormal"><span>                </span>exit;</p><p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal"> </p><p class="MsoNormal">
<span>        </span># from now on we have only the initial requests</p><p class="MsoNormal"><span>        </span>if (!is_method(&quot;INVITE&quot;)) {</p><p class="MsoNormal"><span>                </span>send_reply(&quot;405&quot;,&quot;Method Not Allowed&quot;);</p>
<p class="MsoNormal"><span> </span><span>               </span>exit;</p><p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal"> </p><p class="MsoNormal"><span>        </span># detect resources and do balancing</p>
<p class="MsoNormal"><span>      </span>#<span>  </span>if ($rU=~&quot;^1&quot;) {</p><p class="MsoNormal"><span>                </span># looks like a Conference call</p><p class="MsoNormal"><span>       </span>#<span>         </span>load_balance(&quot;1&quot;,&quot;conf&quot;);</p>
<p class="MsoNormal"><span>       </span># } else if ($rU=~&quot;^2&quot;) {</p><p class="MsoNormal"><span>                </span># looks like a VoiceMail call</p><p class="MsoNormal"><span>        </span>#<span>        </span>load_balance(&quot;1&quot;,&quot;vm&quot;);</p>
<p class="MsoNormal"><span>        </span>#} else {</p><p class="MsoNormal"><span>                </span># PSTN call</p><p class="MsoNormal"><span>                </span>load_balance(&quot;1&quot;,&quot;pstn&quot;);</p><p class="MsoNormal">
<span>        </span>#}</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"><span>        </span># LB function returns negative if no suitable destination (for requested resources) is found,</p><p class="MsoNormal">
<span>        </span># or if all destinations are full</p><p class="MsoNormal"><span>        </span>if ($retcode&lt;0) {</p><p class="MsoNormal"><span>             </span>#rewritehost(&quot;<a href="http://10.128.46.103:5060">10.128.46.103:5060</a>&quot;);</p>
<p class="MsoNormal"><span>             </span>sl_send_reply(&quot;500&quot;,&quot;Service full&quot;);</p><p class="MsoNormal"><span>             </span>xlog(&quot;SGS: Service full : Call failed&quot;);</p><p class="MsoNormal">
<span>             </span>exit;</p><p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal"> </p><p class="MsoNormal"><span>        </span>xlog(&quot;SGS: Selected destination is: $du\n&quot;);</p><p class="MsoNormal">
<span>        </span>$rd = $dd;</p><p class="MsoNormal"><span>        </span># send it out</p><p class="MsoNormal"><span>        </span>if (!t_relay()) {</p><p class="MsoNormal"><span>                </span>sl_reply_error();</p>
<p class="MsoNormal"><span>     </span><span>           </span>xlog(&quot;SGS: Call Not Connected&quot;);</p><p class="MsoNormal"><span>        </span>}else{</p><p class="MsoNormal"><span>                </span>xlog(&quot;SGS: Call Connected&quot;);</p>
<p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal"> </p><p class="MsoNormal"><span>        </span>if ( is_method(&quot;BYE&quot;) ) {</p><p class="MsoNormal"><span>                </span>xlog(&quot;SGS: Selected Route : $du\n&quot;);</p>
<p class="MsoNormal"><span>        </span>}</p><p class="MsoNormal">}</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]: hash = 2054 fragments no.:<span>     </span>1, unused:<span>     </span>0<span>                 </span>bucket size:<span>    </span>524288 -<span>   </span>1048576 (first<span>    </span>989664)</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: hash = 101 fragments no.:<span>     </span>1, unused:<span>     </span>0<span>                  </span>bucket size:<span>       </span>808 -<span>       </span>808 (first<span>       </span>808)</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25317]: -----------------------------</p><p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25312]: TOTAL:<span>     </span>71 free fragments = 993256 free bytes</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]: TOTAL:<span>     </span>73 free fragments = 994016 free bytes</p><p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: hash = 2054 fragments no.:<span>     </span>1, unused:<span>     </span>0<span>                 </span>bucket size:<span>    </span>524288 -<span>   </span>1048576 (first<span>    </span>988864)</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25312]: -----------------------------</p><p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25311]: -----------------------------</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: TOTAL:<span>     </span>59 free fragments = 993120 free bytes</p><p class="MsoNormal">Dec<span>  </span>3 09:58:57 usnjpar1askvm01 /usr/local/sbin/opensips[25310]: -----------------------------</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]: Memory status (pkg):</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]: fm_status (0x81b1e40):</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25299]:<span>  </span>heap size= 1048576</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 opensips: INFO:core:init_tcp: using epoll_lt as the TCP io watch method (auto detected)</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: NOTICE:core:main: version: opensips 1.6.0-notls (i386/linux)</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:core:main: using 32 Mb shared memory</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:core:main: using 1 Mb private memory per process</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:maxfwd:mod_init: initializing...</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:sl:mod_init: Initializing StateLess engine</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:tm:mod_init: TM - initializing...</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:xlog:mod_init: initializing...</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:dialog:mod_init: Dialog module - initializing</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: ERROR:db_mysql:db_mysql_submit_query: driver error: Unknown column &#39;vars&#39; in &#39;field list&#39;</p><p class="MsoNormal">
Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: ERROR:core:db_do_query: error while submitting query</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: ERROR:dialog:select_entire_dialog_table: Error while querying (fetch) database</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: ERROR:db_mysql:db_mysql_free_result: invalid parameter value</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: NOTICE:signaling:mod_init: initializing module ...</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:textops:mod_init: initializing...</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:load_balancer:mod_init: Load-Balancer module - initializing</p>
<p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb</p><p class="MsoNormal">Dec<span>  </span>3 09:58:58 usnjpar1askvm01 /usr/local/sbin/opensips[25632]: INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25650]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25650]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Selected destination is: sip:<a href="http://10.128.46.103:5060">10.128.46.103:5060</a></p><p class="MsoNormal">Dec<span>  </span>3 09:59:30 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Call Connected</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25645]: SGS: Service full : Call failed</p><p class="MsoNormal">Dec<span>  </span>3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25644]: SGS: Service full : Call failed</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:35 usnjpar1askvm01 last message repeated 4 times</p><p class="MsoNormal">Dec<span>  </span>3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25645]: SGS: Service full : Call failed</p>
<p class="MsoNormal">Dec<span>  </span>3 09:59:35 usnjpar1askvm01 /usr/local/sbin/opensips[25648]: SGS: Service full : Call failed</p><p class="MsoNormal">~</p><p class="MsoNormal"><span>                                         </span><span>                     </span></p>
</div></div></span><br>-- <br>Rajib Deka<br>Software Engineer<br>Servion Global Solution<br>Chennai, India<br><br>Mobile No: + 91 80157 09130<br>