Max Concurrent Calls with drouting and dialog modules

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Max Concurrent Calls with drouting and dialog modules

Ali Pey
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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Jeff Pyle
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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Jeff Pyle
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Ali Pey
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Bogdan-Andrei Iancu-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Ali Pey
Thank you Bogdan. That answers all my questions.

Regards,
Ali Pey


On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Jeff Pyle
Bogdan's answer was much better...  :)


- Jeff


On Wed, Aug 29, 2012 at 12:45 PM, Ali Pey <[hidden email]> wrote:
Thank you Bogdan. That answers all my questions.

Regards,
Ali Pey


On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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



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



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Ali Pey
Jeff,

Your answer was quite useful and thank you for taking the time to respond. From your response I learned that I need to reduce the number of calls in the failure route and I hadn't thought about that before. I'm sure more people will benefit from your response in the future facing similar question.

Regards,
Ali Pey


On Wed, Aug 29, 2012 at 1:01 PM, Jeff Pyle <[hidden email]> wrote:
Bogdan's answer was much better...  :)


- Jeff


On Wed, Aug 29, 2012 at 12:45 PM, Ali Pey <[hidden email]> wrote:
Thank you Bogdan. That answers all my questions.

Regards,
Ali Pey


On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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



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



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



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Ali Pey
In reply to this post by Bogdan-Andrei Iancu-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Vlad Paiu
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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


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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Concurrent Calls with drouting and dialog modules

Ali Pey
Great. Thank you Vlad.


On Thu, Aug 30, 2012 at 10:32 AM, Vlad Paiu <[hidden email]> wrote:
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




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


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

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


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

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



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