Throttle outbound calls automatically?

Hi all,

Let me describe my setup first:

I have a custom script (that I didn’t write) that is dropping outbound calls into the asterisk/outbound folder. Asterisk then automatically picks up these calls and makes the outbound call utilizing my SIP trunk. My SIP trunk allows for up to 4 simultaneous outbound calls at a time. I have the ‘maximum channels’ set to 4 out the trunk configuration page in the GUI.

My problem is that when I drop more than 4 call files into the outbound folder, asterisk picks them all up and dials the first 4 and fails on the remainder, presumably because the maximum channels limit is reached. I would have assumed that asterisk would QUEUE those calls, but it is not doing that.

If I make the channels unlimited, then I tries to make ALL the calls at once and i run out of bandwidth on my SIP trunk because I only have enough bandwidth for 4 calls at a time. Then all the audio on the calls gets real choppy.

Is there a way to make asterisk queue those calls and ‘release’ them as the channels become availalbe? I’m trying to avoid having the script altered to ‘throttle’ the call files being dropped in at a maximum of four at a time because I didn’t write the script and that’s going to cost me money that I don’t have right now. Plus, every time I increase my trunk bandwidth, I’d have to have the change made again.

Thanks in advance for your advice/help.