Hi Ali,

Yes, those AVPs are properly populated after use_next_gw().

Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com


On 08/30/2012 05:12 PM, Ali Pey wrote:
Hi Bogdan,

Does use_next_gw() in drouting module adjust the values for gw_id_avp and gw_attrs_avp parameters?

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.

Thanks,
Ali Pey


On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <[email protected] <mailto:[email protected]>> wrote:

    Hi Ali,

    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

    Regards,

    Bogdan-Andrei Iancu
    OpenSIPS Founder and Developer
    http://www.opensips-solutions.com


    On 08/29/2012 07:35 PM, Ali Pey wrote:
    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
    <[email protected] <mailto:[email protected]>> 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
        <[email protected] <mailto:[email protected]>> 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
            <[email protected] <mailto:[email protected]>> 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
                [email protected]
                <mailto:[email protected]>
                http://lists.opensips.org/cgi-bin/mailman/listinfo/users




        _______________________________________________
        Users mailing list
        [email protected] <mailto:[email protected]>
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users



    _______________________________________________
    Users mailing list
    [email protected]  <mailto:[email protected]>
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users

    _______________________________________________
    Users mailing list
    [email protected] <mailto:[email protected]>
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to