[asterisk-users] Controlling max simultaneous calls for a group/.call files

Matt Riddell lists at venturevoip.com
Sun Jul 17 16:38:17 CDT 2011


On 16/07/11 12:29 AM, Michelle Dupuis wrote:
> We are building an app that will initiate outbound calls using .call
> files, and each call can be a different duration (eg: 1min to 5min).
> These calls will go through an Asterisk service with other calls/apps
> running.
> I need to control the MAX number of channels in use so I don't overload
> this server. What is the best way to ensure I stay within an arbitrary
> limit (eg: 10 simultaneous call files in process at once)?
> The call files will be written to the spool directory by a bash file, so
> ideally the bash file should have visibility into the number of .call
> files in process.

Use the Asterisk manager instead.

Or do something like:

asterisk -rx'core show channels'|grep "active channels"|cut -d' ' -f1

and either store the output in a variable or pipe it to a file.

The other alternative would be to do "core show channels concise"|grep 
accountcode (where accountcode is what you originated the call with) and 
then do a "wc -l" on the output to count the lines.

That's the cue for someone to explain some cleaner way to do it with a 
single bash command :-)

-- 
Cheers,

Matt Riddell
_______________________________________________

http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/exchange.php (Full ITSP Solution)
http://www.venturevoip.com/cc.php (Call Centre Solutions)



More information about the asterisk-users mailing list