<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Chandan,<br>
      <br>
      What is the actual rejection reply from OpenSIPS ? Is it something
      from script or something that OpenSIPS receives from upstream ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 15.08.2016 23:06, Chandan PR wrote:<br>
    </div>
    <blockquote
cite="mid:CADh=FygH3KzAdMsUq3FsLw-rZq3Ebwu+kjkr7P4LDD9aR05pVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Guys,
        <div><br>
        </div>
        <div>We are observing an issue where OpenSips is rejecting calls
          as Destination Full, even when the destination is not
          disabled...</div>
        <div><br>
        </div>
        <div>We are not sending too many calls for all the destinations
          to be full.</div>
        <div><br>
        </div>
        <div>The script is as below:</div>
        <div><br>
        </div>
        <div>
          <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 moz-do-not-send="true"
              href="mailto:team@opensips-solutions.com">team@opensips-solutions.com</a>&gt;</div>
          <div>#</div>
          <div># This script was generated via "make menuconfig", from</div>
          <div>#   the "Load Balancer" 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 moz-do-not-send="true"
              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 moz-do-not-send="true"
              href="http://192.168.21.111:5060">192.168.21.111:5060</a>
              # CUSTOMIZE ME</div>
          <div><br>
          </div>
          <div>disable_tcp=no</div>
          <div>listen=tcp:<a moz-do-not-send="true"
              href="http://192.168.21.111:5060">192.168.21.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="/usr/local/opensips/lib64/opensips/modules/"</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>#### SIGNALING module</div>
          <div>loadmodule "signaling.so"</div>
          <div><br>
          </div>
          <div>#### StateLess module</div>
          <div>loadmodule "sl.so"</div>
          <div><br>
          </div>
          <div>#### Transaction Module</div>
          <div>loadmodule "tm.so"</div>
          <div>modparam("tm", "fr_timer", 30)</div>
          <div>modparam("tm", "fr_inv_timer", 120)</div>
          <div>modparam("tm", "restart_fr_on_each_reply", 0)</div>
          <div>modparam("tm", "onreply_avp_mode", 1)</div>
          <div><br>
          </div>
          <div>#### Record Route Module</div>
          <div>loadmodule "rr.so"</div>
          <div>/* do not append from tag to the RR (no need for this
            script) */</div>
          <div>modparam("rr", "append_fromtag", 0)</div>
          <div><br>
          </div>
          <div>#### MAX ForWarD module</div>
          <div>loadmodule "maxfwd.so"</div>
          <div><br>
          </div>
          <div>#### SIP MSG OPerationS module</div>
          <div>loadmodule "sipmsgops.so"</div>
          <div><br>
          </div>
          <div>#### FIFO Management Interface</div>
          <div>loadmodule "mi_fifo.so"</div>
          <div>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")</div>
          <div>modparam("mi_fifo", "fifo_mode", 0666)</div>
          <div><br>
          </div>
          <div>#### URI module</div>
          <div>loadmodule "uri.so"</div>
          <div>modparam("uri", "use_uri_table", 0)</div>
          <div><br>
          </div>
          <div>#### MYSQL module</div>
          <div>loadmodule "db_mysql.so"</div>
          <div><br>
          </div>
          <div>#### AVPOPS module</div>
          <div>loadmodule "avpops.so"</div>
          <div><br>
          </div>
          <div>#### ACCounting module</div>
          <div>loadmodule "acc.so"</div>
          <div>/* what special events should be accounted ? */</div>
          <div>modparam("acc", "early_media", 0)</div>
          <div>modparam("acc", "report_cancels", 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
            "append_fromtag"</div>
          <div>   in "rr" module */</div>
          <div>modparam("acc", "detect_direction", 0)</div>
          <div>modparam("acc", "failed_transaction_flag", "ACC_FAILED")</div>
          <div>/* account triggers (flags) */</div>
          <div>modparam("acc", "log_flag", "ACC_DO")</div>
          <div>modparam("acc", "log_missed_flag", "ACC_MISSED")</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>#### DIALOG module</div>
          <div>loadmodule "dialog.so"</div>
          <div>modparam("dialog", "dlg_match_mode", 1)</div>
          <div>modparam("dialog", "default_timeout", 21600)  # 6 hours
            timeout</div>
          <div>modparam("dialog", "db_mode", 2)</div>
          <div>modparam("dialog", "db_url",</div>
          <div><span class="" style="white-space:pre">        </span>"mysql://opensips:opensipsrw@localhost/opensips")
            # CUSTOMIZE ME</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>#### LOAD BALANCER module</div>
          <div>loadmodule "load_balancer.so"</div>
          <div>modparam("load_balancer", "db_url",</div>
          <div><span class="" style="white-space:pre">        </span>"mysql://opensips:opensipsrw@localhost/opensips")
            # CUSTOMIZE ME</div>
          <div>modparam("load_balancer", "probing_method", "OPTIONS")</div>
          <div><br>
          </div>
          <div>modparam("load_balancer", "probing_interval", 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("3")) {</div>
          <div><span class="" style="white-space:pre">                </span>send_reply("483","looping");</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("Loose
            Route for $avp(iurl) over $avp(dest) $avp(calltype) \n");</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("CANCEL") ) {</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("INVITE")) {</div>
          <div>                send_reply("405","Method Not Allowed");</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("Sending call $fu $avp(iurl) $avp(calltype)
            \n");<span class="" style="white-space:pre">        </span></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("1","channel") ) {</div>
          <div><span class="" style="white-space:pre">        </span>    
            xlog("All Destinations are full. Sending 500! $fu
            $(hdr(P-Nuance-Initial-URL))");</div>
          <div>             send_reply("500","Service full");</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("Call
            sent over $avp(dest) $fu $(hdr(P-Nuance-Initial-URL))\n");</div>
          <div><span class="" style="white-space:pre">        </span>t_on_reply("test");</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("LB_failed");</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("OpenSIPS
            received a reply $avp(iurl) rs= $rs | fu= $fu | si= $si |
            Ri= $Ri ===");</div>
          <div>#}</div>
          <div><br>
          </div>
          <div>onreply_route[test] {</div>
          <div><span class="" style="white-space:pre">        </span>xlog("Reply
            $rs received from $si for the call $avp(iurl)");</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("Call
            $avp(iurl) sent over $avp(dest) failed with code
            $T_reply_code\n");</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("[56][0-9][0-9]")) {</div>
          <div><span class="" style="white-space:pre">        </span>#Comment
            the below line and put the above condition to probe for all
            500-699 errors</div>
          <div>        if ( t_check_status("503")) {</div>
          <div><span class="" style="white-space:pre">        </span>        #
            this is a case for failover</div>
          <div>                xlog("Marking $avp(dest) disabled as it
            failed for call $avp(iurl) with code $T_reply_code\n");</div>
          <div>                # mark failed destination as disabled </div>
          <div>                lb_disable();</div>
          <div>                # try to re-route to next available
            destination</div>
          <div>                #if ( !load_balance("1","channel") ) {</div>
          <div><span class="" style="white-space:pre">                </span>#    
             xlog("RETRY FAILED SENDING 500");<span class="" style="white-space:pre">        </span></div>
          <div>                #      send_reply("500","Service Full");</div>
          <div>                #      exit;</div>
          <div>                #}</div>
          <div>                #xlog("REPORT: re-routing call to $du
            \n");</div>
          <div>                #t_relay();</div>
          <div>        }</div>
          <div><span class="" style="white-space:pre">        </span>send_reply("$T_reply_code","Call
            Failed");</div>
          <div>}</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Please do let me know if any comments..</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Chandan</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>