<div dir="ltr">Thanks for the response Jon.<br>Let me have a look at it.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 24, 2020 at 7:42 PM Jon Abrams <<a href="mailto:ffshoh@gmail.com">ffshoh@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Chandan,<br>
<br>
There may be something else purpose built for this, but you can use<br>
the dialog profiles to track and limit the port usage:<br>
<br>
    set_dlg_profile("outcarrier","$avp(out_carrier_id)");<br>
<br>
    if ($avp(out_max_call_limit) > 0)<br>
    {<br>
        set_dlg_profile("profile","$avp(out_qos_profile_id)");<br>
        if (get_profile_size("profile","$avp(out_qos_profile_id)","$var(out_gw_count)"))<br>
        {<br>
            if ($var(out_gw_count)>$avp(out_max_call_limit))<br>
            {<br>
                xlog("LIMIT: Call $ci - Max call limit hit by<br>
$avp(src_addr) on QosProfile $avp(out_qos_profile_id) to gw<br>
$avp(out_gw_id)\n");<br>
                return(-1);<br>
            }<br>
        }<br>
    }<br>
<br>
On Fri, Jul 24, 2020 at 8:55 AM Chandan PR <<a href="mailto:chandan.pr@webshar.org" target="_blank">chandan.pr@webshar.org</a>> wrote:<br>
><br>
> Hello Everyone,<br>
><br>
> Currently, we are using Open Sips Load balancer in Call Driven load balancing.<br>
><br>
> Our scenario is as below:<br>
><br>
> D - Total Destinations configured at OpenSips<br>
> P - No of Ports/Sessions Each Destination can handle concurrently<br>
> C - Total Capacity = D*P<br>
><br>
> We have a Call Loader which loads calls to OpenSips at C and as when the result comes further calls get loaded.<br>
> For some reason, if any destination is not in the right state and sends error responses without accepting calls, this introduces a drain scenario.<br>
> In the drain scenario where all new calls are given to the faulty destination as it has more availability.<br>
><br>
> We are currently handling this by<br>
><br>
> Running the loader at 80% of C<br>
> Disabling the destination in Opensips if 75% of the calls fail for the particular destination (Attached loadbalancer.cfg file).<br>
><br>
><br>
> But even in this case, it is possible that may call error out as the destination is free and calls are loaded.<br>
><br>
> We would like to avoid this scenario to the max possible extent by limiting the number of calls we send to this particular destination.<br>
><br>
> Couple of options I see are as below:<br>
><br>
> Wait for a brief period before sending the response to loader when the error happens<br>
> Make OpenSips aware of the destination capacity and adjust ports accordingly<br>
><br>
> Write a custom script to poll destination capacity and use MI functions to adjust accordingly<br>
> Or is there any possibility to integrate similar to FreeSwitch driven routing<br>
><br>
> Are there any other possibilities of adjusting the OpenSips capacity dynamically or make it limit the calls sent to the particular destination?<br>
><br>
> --<br>
><br>
> Regards,<br>
> Chandan Ravishankar<br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br>
</div><div>Regards,</div><div><a href="https://about.me/chandanpr" target="_blank">Chandan Ravishankar</a></div></div></div>