<div dir="ltr">Hi Guys,<div><br></div><div>Opendsips Version : 1.9.x</div><div><br></div><div>We have configured the load balancer with 8 ports.</div><div><br></div><div>When the calls are ongoing, the lb_list shows the load balancer is running full.</div><div><br></div><div><div>root@Dev-Chandan-Opensips-LB:/usr/local/opensips/sbin# ./opensipsctl fifo lb_list</div><div>Destination:: sip:<a href="http://192.168.248.62:5060">192.168.248.62:5060</a> id=152 group=1 enabled=yes auto-re=on</div><div><span class="" style="white-space:pre">        </span>Resource:: channel max=4 load=4</div><div>Destination:: sip:<a href="http://192.168.248.64:5060">192.168.248.64:5060</a> id=153 group=1 enabled=yes auto-re=on</div><div><span class="" style="white-space:pre">        </span>Resource:: channel max=4 load=4</div><div><br></div><div>When I check the dialog_list, I see some older dialogs which are yet to be cleared.</div><div><br></div><div>root@Dev-Chandan-Opensips-LB:/usr/local/opensips/sbin# ./opensipsctl fifo dlg_list | grep &quot;callid&quot;</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610041471339775929_ZTLT_931</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610151471339775929_ZTLT_937</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610221471339775929_ZTLT_942</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610081471339775929_ZTLT_933</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610181471339775929_ZTLT_939</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610191471339775929_ZTLT_940</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610131471339775929_ZTLT_936</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610031471339775929_ZTLT_930</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610061471339775929_ZTLT_932</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610161471339775929_ZTLT_938</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610271471339775929_ZTLT_945</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610371471339775929_ZTLT_951</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610101471339775929_ZTLT_934</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610311471339775929_ZTLT_947</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610211471339775929_ZTLT_941</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610241471339775929_ZTLT_943</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610341471339775929_ZTLT_949</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610011471339775929_ZTLT_929</div><div><span class="" style="white-space:pre">        </span>callid:: 14713396610111471339775929_ZTLT_935</div><div>root@Dev-Chandan-Opensips-LB:/usr/local/opensips/sbin# ./opensipsctl fifo dlg_list | grep &quot;callid&quot; | wc -l</div><div>13</div><div>root@Dev-Chandan-Opensips-LB:/usr/local/opensips/sbin# </div></div><div><br></div><div><b>Even when the lb_list shows the load as 0, I see some dialogs present and getting cleared after around 10-12 seconds.</b></div><div><br></div><div>What would be the impact of this delay in clearing the dialogs? Can this lead to lot many calls rejected with &quot;Destination Full&quot; (We are experiencing this issue in our production, where a huge number of calls rejected)?</div><div><br></div><div>Is there any way to reduce this delay or clear the dialogs immediately?</div><div><br></div><div><b><u>Dialog Module Settings:</u></b></div><div><div style="">#### DIALOG module</div><div style="">loadmodule &quot;dialog.so&quot;</div><div style="">modparam(&quot;dialog&quot;, &quot;dlg_match_mode&quot;, 1)</div><div style="">modparam(&quot;dialog&quot;, &quot;default_timeout&quot;, 21600)  # 6 hours timeout</div><div style="">modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 2)</div><div style="">modparam(&quot;dialog&quot;, &quot;db_url&quot;,</div><div style=""><span class="" style="white-space:pre">        </span>&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;) #</div></div><div style=""><br></div><div style=""><br></div><div style=""><b><u>Load Balancer Script:</u></b></div><div style=""><div>#</div><div># $Id: opensips_loadbalancer.m4 9723 2013-02-01 15:10:50Z bogdan_iancu $</div><div>#</div><div># OpenSIPS loadbalancer script</div><div>#     by OpenSIPS Solutions &lt;<a href="mailto:team@opensips-solutions.com">team@opensips-solutions.com</a>&gt;</div><div>#</div><div># This script was generated via &quot;make menuconfig&quot;, from</div><div>#   the &quot;Load Balancer&quot; scenario.</div><div># You can enable / disable more features / functionalities by</div><div>#   re-generating the scenario with different options.</div><div>#</div><div># Please refer to the Core CookBook at:</div><div>#      <a href="http://www.opensips.org/Resources/DocsCookbooks">http://www.opensips.org/Resources/DocsCookbooks</a></div><div># for a explanation of possible statements, functions and parameters.</div><div>#</div><div><br></div><div><br></div><div>####### Global Parameters #########</div><div><br></div><div>debug=3</div><div>log_stderror=no</div><div>log_facility=LOG_LOCAL1</div><div><br></div><div>fork=yes</div><div>children=4</div><div><br></div><div>/* uncomment the following lines to enable debugging */</div><div>#debug=6</div><div>#fork=no</div><div>#log_stderror=yes</div><div><br></div><div>/* uncomment the next line to enable the auto temporary blacklisting of </div><div>   not available destinations (default disabled) */</div><div>#disable_dns_blacklist=no</div><div><br></div><div>/* uncomment the next line to enable IPv6 lookup after IPv4 dns </div><div>   lookup failures (default disabled) */</div><div>#dns_try_ipv6=yes</div><div><br></div><div>/* comment the next line to enable the auto discovery of local aliases</div><div>   based on revers DNS on IPs */</div><div>auto_aliases=no</div><div><br></div><div><br></div><div>listen=udp:<a href="http://192.168.248.111:5060">192.168.248.111:5060</a>   # CUSTOMIZE ME</div><div><br></div><div>disable_tcp=no</div><div>listen=tcp:<a href="http://192.168.248.111:5060">192.168.248.111:5060</a>   # CUSTOMIZE ME </div><div><br></div><div>disable_tls=yes</div><div><br></div><div><br></div><div><br></div><div><br></div><div>####### Modules Section ########</div><div><br></div><div>#set module path</div><div>mpath=&quot;/usr/local/opensips/lib64/opensips/modules/&quot;</div><div><br></div><div><br></div><div><br></div><div>#### SIGNALING module</div><div>loadmodule &quot;signaling.so&quot;</div><div><br></div><div>#### StateLess module</div><div>loadmodule &quot;sl.so&quot;</div><div><br></div><div>#### Transaction Module</div><div>loadmodule &quot;tm.so&quot;</div><div>modparam(&quot;tm&quot;, &quot;fr_timer&quot;, 30)</div><div>modparam(&quot;tm&quot;, &quot;fr_inv_timer&quot;, 120)</div><div>modparam(&quot;tm&quot;, &quot;restart_fr_on_each_reply&quot;, 0)</div><div>modparam(&quot;tm&quot;, &quot;onreply_avp_mode&quot;, 1)</div><div><br></div><div>#### Record Route Module</div><div>loadmodule &quot;rr.so&quot;</div><div>/* do not append from tag to the RR (no need for this script) */</div><div>modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)</div><div><br></div><div>#### MAX ForWarD module</div><div>loadmodule &quot;maxfwd.so&quot;</div><div><br></div><div>#### SIP MSG OPerationS module</div><div>loadmodule &quot;sipmsgops.so&quot;</div><div><br></div><div>#### FIFO Management Interface</div><div>loadmodule &quot;mi_fifo.so&quot;</div><div>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/opensips_fifo&quot;)</div><div>modparam(&quot;mi_fifo&quot;, &quot;fifo_mode&quot;, 0666)</div><div><br></div><div>#### URI module</div><div>loadmodule &quot;uri.so&quot;</div><div>modparam(&quot;uri&quot;, &quot;use_uri_table&quot;, 0)</div><div><br></div><div>#### MYSQL module</div><div>loadmodule &quot;db_mysql.so&quot;</div><div><br></div><div>#### AVPOPS module</div><div>loadmodule &quot;avpops.so&quot;</div><div><br></div><div>#### ACCounting module</div><div>loadmodule &quot;acc.so&quot;</div><div>/* what special events should be accounted ? */</div><div>modparam(&quot;acc&quot;, &quot;early_media&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 0)</div><div>/* by default we do not adjust the direct of the sequential requests.</div><div>   if you enable this parameter, be sure the enable &quot;append_fromtag&quot;</div><div>   in &quot;rr&quot; module */</div><div>modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, &quot;ACC_FAILED&quot;)</div><div>/* account triggers (flags) */</div><div>modparam(&quot;acc&quot;, &quot;log_flag&quot;, &quot;ACC_DO&quot;)</div><div>modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, &quot;ACC_MISSED&quot;)</div><div><br></div><div><br></div><div>#### DIALOG module</div><div>loadmodule &quot;dialog.so&quot;</div><div>modparam(&quot;dialog&quot;, &quot;dlg_match_mode&quot;, 1)</div><div>modparam(&quot;dialog&quot;, &quot;default_timeout&quot;, 21600)  # 6 hours timeout</div><div>modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 2)</div><div>modparam(&quot;dialog&quot;, &quot;db_url&quot;,</div><div><span class="" style="white-space:pre">        </span>&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;) # CUSTOMIZE ME</div><div><br></div><div><br></div><div>#### LOAD BALANCER module</div><div>loadmodule &quot;load_balancer.so&quot;</div><div>modparam(&quot;load_balancer&quot;, &quot;db_url&quot;,</div><div><span class="" style="white-space:pre">        </span>&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;) # CUSTOMIZE ME</div><div>modparam(&quot;load_balancer&quot;, &quot;probing_method&quot;, &quot;OPTIONS&quot;)</div><div><br></div><div>modparam(&quot;load_balancer&quot;, &quot;probing_interval&quot;, 15)</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>####### Routing Logic ########</div><div><br></div><div><br></div><div># main request routing logic</div><div>route{</div><div><span class="" style="white-space:pre">        </span>if (!mf_process_maxfwd_header(&quot;3&quot;)) {</div><div><span class="" style="white-space:pre">                </span>send_reply(&quot;483&quot;,&quot;looping&quot;);</div><div><span class="" style="white-space:pre">                </span>exit;</div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>if ( has_totag() ) {</div><div><span class="" style="white-space:pre">                </span># sequential request -&gt; obey Route indication</div><div><span class="" style="white-space:pre">                </span>xlog(&quot;Loose Route for $avp(iurl) over $avp(dest) $avp(calltype) \n&quot;);</div><div><span class="" style="white-space:pre">                </span>loose_route();</div><div>                t_relay();</div><div>                exit;</div><div>        }</div><div><br></div><div>        # handle cancel and re-transmissions</div><div><span class="" style="white-space:pre">        </span>if ( is_method(&quot;CANCEL&quot;) ) {</div><div><span class="" style="white-space:pre">                </span>if ( t_check_trans() )</div><div><span class="" style="white-space:pre">                        </span>t_relay();</div><div><span class="" style="white-space:pre">                </span>exit;</div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div>        # from now on we have only the initial requests</div><div>        if (!is_method(&quot;INVITE&quot;)) {</div><div>                send_reply(&quot;405&quot;,&quot;Method Not Allowed&quot;);</div><div>                exit;</div><div>        }</div><div><br></div><div>        # initial request</div><div><span class="" style="white-space:pre">        </span>record_route();</div><div><span class="" style="white-space:pre">        </span>$avp(iurl) = $(hdr(P-Nuance-Initial-URL));</div><div><span class="" style="white-space:pre">        </span>$avp(calltype) = $(hdr(P-Nuance-Call-Type));</div><div>        xlog(&quot;Sending call $fu $avp(iurl) $avp(calltype) \n&quot;);<span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>xlog(&quot;Current Dialogs count $DLG_count \n&quot;);</div><div><span class="" style="white-space:pre">        </span># LB function returns negative if no suitable destination (for requested resources) is found,</div><div>        # or if all destinations are full</div><div>        if ( !load_balance(&quot;1&quot;,&quot;channel&quot;) ) {</div><div><span class="" style="white-space:pre">        </span>     xlog(&quot;All Destinations are full. Sending 500! $fu $(hdr(P-Nuance-Initial-URL)) CURRENT DIALOGS $DLG_count \n&quot;);</div><div>             send_reply(&quot;500&quot;,&quot;Service full&quot;);</div><div>             exit;</div><div>        }</div><div><span class="" style="white-space:pre">        </span>$avp(dest) = $du;</div><div><span class="" style="white-space:pre">        </span>xlog(&quot;Call sent over $avp(dest) $fu $(hdr(P-Nuance-Initial-URL))\n&quot;);</div><div><span class="" style="white-space:pre">        </span>t_on_reply(&quot;test&quot;);</div><div>        # arm a failure route for be able to catch a failure event and to do </div><div>        # failover to the next available destination</div><div>        t_on_failure(&quot;LB_failed&quot;);</div><div><br></div><div>        # send it out</div><div><span class="" style="white-space:pre">        </span>if (!t_relay()) {</div><div><span class="" style="white-space:pre">                </span>sl_reply_error();</div><div><span class="" style="white-space:pre">        </span>}</div><div><br></div><div>}</div><div><br></div><div>#onreply_route {</div><div>#<span class="" style="white-space:pre">        </span>xlog(&quot;OpenSIPS received a reply $avp(iurl) rs= $rs | fu= $fu | si= $si | Ri= $Ri ===&quot;);</div><div>#}</div><div><br></div><div>onreply_route[test] {</div><div><span class="" style="white-space:pre">        </span>xlog(&quot;Reply $rs received from $si for the call $avp(iurl)&quot;);</div><div>}</div><div><br></div><div>failure_route[LB_failed]</div><div>{</div><div>        # skip if call was canceled </div><div><span class="" style="white-space:pre">        </span>if (t_was_cancelled()) {</div><div><span class="" style="white-space:pre">                </span>exit;</div><div><span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">        </span>xlog(&quot;Call $avp(iurl) sent over $avp(dest) failed with code $T_reply_code\n&quot;);</div><div>        </div><div><span class="" style="white-space:pre">        </span># Checking only for Destination Failure</div><div><span class="" style="white-space:pre">        </span># If the destination is failed, disable it and reroute the call</div><div>        #if ( t_check_status(&quot;[56][0-9][0-9]&quot;)) {</div><div>        if ( t_check_status(&quot;503&quot;)) {</div><div><span class="" style="white-space:pre">        </span>        # this is a case for failover</div><div>                xlog(&quot;Marking $avp(dest) disabled as it failed for call $avp(iurl) with code $T_reply_code\n&quot;);</div><div>                #xlog(&quot;call $avp(iurl) failed with code $T_reply_code from $avp(dest)\n&quot;);</div><div><span class="" style="white-space:pre">                </span># mark failed destination as disabled </div><div>                lb_disable();</div><div>                # try to re-route to next available destination</div><div>                #if ( !load_balance(&quot;1&quot;,&quot;channel&quot;) ) {</div><div><span class="" style="white-space:pre">                </span>#      xlog(&quot;RETRY FAILED SENDING 500&quot;);<span class="" style="white-space:pre">        </span></div><div>                #      send_reply(&quot;500&quot;,&quot;Service Full&quot;);</div><div>                #      exit;</div><div>                #}</div><div>                #xlog(&quot;REPORT: re-routing call to $du \n&quot;);</div><div>                #t_relay();</div><div>        }</div><div><span class="" style="white-space:pre">        </span>send_reply(&quot;$T_reply_code&quot;,&quot;Call Failed&quot;);</div><div>}</div><div><br></div></div><div><br></div><div>Regards,</div><div>Chandan</div></div>