Limit calls globally per Asterisk process

Hello.
I know that ‘call-limit’ is deprecated in favour of GROUP_COUNT().

In examples over the net I saw that GROUP_COUNT() is used in each extension as a one of first actions.

What is the best way to limit calls amount not per each extension, but per Asterisk process globally? For example, I have 150 DIDs/extensions alltogether and I’d like my Asterisk to handle no more than 300 simultaneous calls. All of them are incoming, no dialing out.

Should I send all calls to some starting context where I will limit the amount of calls globally, and only then send them with GoTo to some other contexts?

Best regards.

in asterisk.conf
maxcalls = 300
but it’s the maximum number of concurrent calls. not just incoming

[quote=“elphssp”]in asterisk.conf
maxcalls = 300
but it’s the maximum number of concurrent calls. not just incoming[/quote]
Oh, thanks a lot.

I thought that it is that very option, which was deprecated.
In fact maxcalls and call-limit are different things. I have to look through the documentation more attentively.

This is what I need, thank you.

PS: incoming or not - does not matter in this case. I just need to limit concurrent calls.