[asterisk-users] Codec choice

Steve Edwards asterisk.org at sedwards.com
Fri Aug 20 19:37:00 CDT 2010


On Fri, 20 Aug 2010, Sherwood McGowan wrote:

> 1. Set up a Global Variable that will store that kit's current number of calls
> 2. Check that variable when a call starts (but before you dial out)
> 3. If the number of calls is <49 (since the current call will make
> 50), use codec A via the CHANNEL() function, otherwise use codec B
> using the same function.
> 4. Increment the variable
> 5. place call
> 6., upon hangup, decrement the variable

Not really paying close attention to what you're trying to do, but...

The GROUP() and GROUP_COUNT() functions automagically take care of the 
increment and decrement cruft in a "race condition free" sort of way.

Both methods still leave a small "window of opportunity" in comparing the 
count with the threshold.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list