Hi Bogdan,<div><br></div><div>Does <span style="background-color:rgb(255,255,255);font-family:Helvetica,Arial">use_next_gw() in drouting module adjust</span> the values for gw_id_avp and gw_attrs_avp parameters?</div><div>
<br></div><div>I need to use this function if the max concurrent call limit has reached for the current gw, then evaluate the number of concurrent calls on the next gateway until there is no other gateways.</div><div><br>
</div><div>Thanks,</div><div>Ali Pey</div><div><br></div><div><br><div class="gmail_quote">On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
<tt>Hi Ali,<br>
<br>
For profiling, use the GW ID - as value for the profile - (you can
instruct DR to return the GW ID in an AVP) ; now, about the limit,
use the "attrs" from GWs to keep it<br>
<br>
Regards,<br>
</tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre><div><div class="h5">
<br>
On 08/29/2012 07:35 PM, Ali Pey wrote:
<blockquote type="cite">Hi Jeff,
<div><br>
</div>
<div>Thank you for the reply but unfortunately this doesn't answer
my questions. I need to bind this to the drouting module, so
when I call do_routing, I need a parameter for
set_dialog_profile for whatever gateway do_routing() picks. That
was my first and second questions.</div>
<div><br>
</div>
<div>Also in your case, where do you set $var(dlgsize_out)? where
do you get it from? How would you change it? I don't want to
have to change my script or restart opensips to change this.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Ali Pey</div>
<div><br>
</div>
<div><br>
<div class="gmail_quote">On Wed, Aug 29, 2012 at 12:27 PM, Jeff
Pyle <span dir="ltr"><<a href="mailto:jpyle@fidelityvoice.com" target="_blank">jpyle@fidelityvoice.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Ali,</div>
<div><br>
</div>
<div>Oops, I had some inconsistent rewrites. So much for
improved readability. Consider this instead:</div>
<div><br>
</div>
<div>
<div><font face="courier new, monospace" size="1">
# Check to see if we're at maximum capacity for this
gateway</font></div>
<div>
<div><font face="courier new, monospace" size="1">
if !(get_profile_size("outbound",
"$avp(s:dlgid_out)", "$var(dlgsize_out)")) {</font></div>
<div><font face="courier new, monospace" size="1">
xlog("L_INFO", "Couldn't get dialog size,
continuing route-out\n");</font></div>
<div><font face="courier new, monospace" size="1">
} else {</font></div>
</div>
<div><font face="courier new, monospace" size="1">
if (is_avp_set("$avp(s:gw_maxcalls)")
&& $var(dlgsize_out) >=
$avp(s:gw_maxcalls)) {</font></div>
<div><font face="courier new, monospace" size="1">
# We're full, so cycle around to the
next gateway...</font></div>
<div><font face="courier new, monospace" size="1">
}</font></div>
<div><font face="courier new, monospace" size="1">
}</font></div>
</div>
<div><br>
</div>
<div>That should make more sense.</div>
<span><font color="#888888">
<div><br>
</div>
<div><br>
</div>
<div>- Jeff</div>
</font></span>
<div>
<div>
<div><br>
</div>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Aug 29, 2012 at 12:24
PM, Jeff Pyle <span dir="ltr"><<a href="mailto:jpyle@fidelityvoice.com" target="_blank">jpyle@fidelityvoice.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Hi Ali,</div>
<div><br>
</div>
<div>I have the same application. A little before
the <font face="courier new, monospace">t_relay()</font>
to the gateway, I have:</div>
<div>
<div><br>
</div>
<div><font face="courier new, monospace" size="1">
# Check to see if we're at maximum
capacity</font></div>
<div><font face="courier new, monospace" size="1">
if !(get_profile_size("outbound",
"$avp(s:dlgid_out)", "$var(dlgsize_out)")) {</font></div>
<div><font face="courier new, monospace" size="1">
xlog("L_INFO", "Couldn't get
dialog size, continuing route-out\n");</font></div>
<div><font face="courier new, monospace" size="1">
} else {</font></div>
<div><font face="courier new, monospace" size="1">
if
(is_avp_set("$avp(s:gw_maxcalls)") &&
$var(dlgsize_out) >= $avp(s:car_maxcalls))
{</font></div>
<div><font face="courier new, monospace" size="1">
# Move on to the next
carrier...</font></div>
<div><font face="courier new, monospace" size="1">
</font></div>
<div><font face="courier new, monospace" size="1">
}</font></div>
<div><font face="courier new, monospace" size="1">
}</font></div>
</div>
<div><font face="courier new, monospace" size="1">
# Continue towards t_relay() for this
gateway...</font></div>
<div><br>
</div>
<div>This verifies our counts to make sure we have
room. If I'm at that value (or over) I cycle
around and select the next gateway. If all is
well I run <font face="courier new, monospace">set_dlg_profile("outbound",
"</font><span>$avp(s:dlgid_out)</span><font face="courier new, monospace">")</font>. Since
you're using drouting, perhaps you'll use another
variable here in place of <span style="font-family:'courier new',monospace">$avp(s:dlgid_out)</span>.</div>
<div><br>
</div>
<div>I implement serial forking for my gateways. In
the selected failure_route I run <font face="courier new, monospace">unset_dlg_profile("outbound",
"$avp(s:dlgid_out)")</font>. If I'm in this
section I know the call has failed, so I want to
remove its count from the profile.</div>
<div><br>
</div>
<div>This configure is old enough to be pre-drouting
but the concepts are still the same.</div>
<div><br>
</div>
<div>Is that helpful?</div>
<div><br>
</div>
<div><br>
</div>
<div>- Jeff</div>
<div><br>
</div>
<br>
<br>
<div class="gmail_quote">
<div>
<div>On Wed, Aug 29, 2012 at 11:53 AM, Ali Pey <span dir="ltr"><<a href="mailto:alipey@gmail.com" target="_blank">alipey@gmail.com</a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>
Hi All,
<div><br>
</div>
<div>I would like to limit number of
concurrent calls to a gateway in
dr_gateways table (drouting module).</div>
<div><br>
</div>
<div>I have looked at the tutorial on the
opensips webiste (<a href="http://www.opensips.org/Resources/DocsTutConcurrentCalls" target="_blank">http://www.opensips.org/Resources/DocsTutConcurrentCalls</a>)
and this is not the same. </div>
<div><br>
</div>
<div>I do create a dialog and then I do
do_routing(). At this point I don't know:</div>
<div><br>
</div>
<div>1- What parameters to pass
to set_dlg_profile() to increase the
number of calls for whatever particular
gateway do_routing happened to select?</div>
<div><br>
</div>
<div>2- How to use get_profile_size() to see
if the gateway has reached it's maximum
number of channels?</div>
<div><br>
</div>
<div>3- Where would be the best place to
record and read the max number of channels
available for each gateway? some place
that I wouldn't need to do a db quey but I
would be able to make changes while
opensips is running similar to the
drouting module parameters itself.</div>
<div><br>
</div>
<div><br>
</div>
<div>Any help/suggestion would be
appreciated.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Ali Pey</div>
<div><br>
</div>
<br>
</div>
</div>
_______________________________________________<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" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
</blockquote>
</div>
<br>
</div>
</div>
<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" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</div></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>