I had a need to limit the number of calls sent out on a specific trunk, and wanted a generic way to do it. I have been using this on Asterisk 1.6.1.x, but it may be supported on other versions. At the core it uses GROUP and GROUP_COUNT functions. Hopefully this will be of use to someone else.