[asterisk-users] Dispatching calls question

Steve Edwards asterisk.org at sedwards.com
Wed Aug 20 16:01:21 CDT 2014


On Wed, 20 Aug 2014, Jerry Geis wrote:

> I have a question about dispatching calls...
> If I try to dispatch a call on line 1 using the AMI
> and I check in my table to see if line 1 is available and it is....
> So I have done my checking now I dispatch my call 
> and at that same time a call comes in on line 1 and now its no longer available 
> for me to make a call, I connect on AMI and my call fails....
> 
> How do I prevent this from happening? Sure I can start at 23 instead of 1 and work down
> instead of up  but eventually the same thing may happen.

If you're using something like MySQL, use 'get_lock/release_lock.'

If you're using some other database, see what locking features you have 
available.

-- 
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