[OpenSIPS-Users] Max Concurrent Calls with drouting and dialog modules

Jeff Pyle jpyle at fidelityvoice.com
Wed Aug 29 18:27:42 CEST 2012


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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120829/08fc15a1/attachment-0001.htm>


More information about the Users mailing list