<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 style="font-family:'courier new',monospace">$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">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>_______________________________________________<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>