[OpenSIPS-Users] Max Concurrent Calls with drouting and dialog modules
Ali Pey
alipey at gmail.com
Wed Aug 29 18:35:20 CEST 2012
Hi Jeff,
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.
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.
Regards,
Ali Pey
On Wed, Aug 29, 2012 at 12:27 PM, Jeff Pyle <jpyle at fidelityvoice.com> wrote:
> Ali,
>
> Oops, I had some inconsistent rewrites. So much for improved readability.
> Consider this instead:
>
> # Check to see if we're at maximum capacity for this gateway
> if !(get_profile_size("outbound", "$avp(s:dlgid_out)",
> "$var(dlgsize_out)")) {
> xlog("L_INFO", "Couldn't get dialog size, continuing
> route-out\n");
> } else {
> if (is_avp_set("$avp(s:gw_maxcalls)") && $var(dlgsize_out)
> >= $avp(s:gw_maxcalls)) {
> # We're full, so cycle around to the next
> gateway...
> }
> }
>
> That should make more sense.
>
>
> - Jeff
>
>
>
>
> On Wed, Aug 29, 2012 at 12:24 PM, Jeff Pyle <jpyle at fidelityvoice.com>wrote:
>
>> Hi Ali,
>>
>> I have the same application. A little before the t_relay() to the
>> gateway, I have:
>>
>> # Check to see if we're at maximum capacity
>> if !(get_profile_size("outbound", "$avp(s:dlgid_out)",
>> "$var(dlgsize_out)")) {
>> xlog("L_INFO", "Couldn't get dialog size, continuing
>> route-out\n");
>> } else {
>> if (is_avp_set("$avp(s:gw_maxcalls)") &&
>> $var(dlgsize_out) >= $avp(s:car_maxcalls)) {
>> # Move on to the next carrier...
>>
>> }
>> }
>> # Continue towards t_relay() for this gateway...
>>
>> 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 set_dlg_profile("outbound",
>> "$avp(s:dlgid_out)"). Since you're using drouting, perhaps you'll use
>> another variable here in place of $avp(s:dlgid_out).
>>
>> I implement serial forking for my gateways. In the selected
>> failure_route I run unset_dlg_profile("outbound", "$avp(s:dlgid_out)").
>> If I'm in this section I know the call has failed, so I want to remove its
>> count from the profile.
>>
>> This configure is old enough to be pre-drouting but the concepts are
>> still the same.
>>
>> Is that helpful?
>>
>>
>> - Jeff
>>
>>
>>
>> On Wed, Aug 29, 2012 at 11:53 AM, Ali Pey <alipey at gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I would like to limit number of concurrent calls to a gateway in
>>> dr_gateways table (drouting module).
>>>
>>> I have looked at the tutorial on the opensips webiste (
>>> http://www.opensips.org/Resources/DocsTutConcurrentCalls) and this is
>>> not the same.
>>>
>>> I do create a dialog and then I do do_routing(). At this point I don't
>>> know:
>>>
>>> 1- What parameters to pass to set_dlg_profile() to increase the number
>>> of calls for whatever particular gateway do_routing happened to select?
>>>
>>> 2- How to use get_profile_size() to see if the gateway has reached it's
>>> maximum number of channels?
>>>
>>> 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.
>>>
>>>
>>> Any help/suggestion would be appreciated.
>>>
>>> Thanks,
>>> Ali Pey
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120829/51b7d79a/attachment.htm>
More information about the Users
mailing list