[Asterisk-Dev] Is the ChanIsAvail command thread safe?

hugolivude hugolivude at gmail.com
Tue Sep 13 09:13:02 MST 2005


Thanks Kevin. It doesn't seem that it would be very useful to use 
ChanIsAvail in a dial plan to determine which line to use because a line 
that tests as AVAILABLE could get snatched by another user before it can get 
used. Am I right or have I missed something?

Thanks,
Hugh 

On 9/13/05, Kevin P. Fleming <kpfleming at digium.com> wrote:
> 
> hugolivude wrote:
> > Curious whether the ChanIsAvail command is thread safe. By that I mean, 
> if I
> > use ChanIsAvail to determine which channel to use, can I be sure that it
> > will still be available when I go to Dial it on the next line? It occurs 
> to
> > me that there's a possibility the channel could get used by a competing
> > thread AFTER my thread has determined it is available and BEFORE my 
> thread
> > gets a chance to Dial.
> 
> This has nothing to do with 'thread safety' at all, please don't mis-use
> terminology.
> 
> The simple answer to your question is no. ChanIsAvail only tells you
> whether the channel is available, it does not make any attempt to 'lock'
> it for your use.
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050913/f33f2ea7/attachment.htm


More information about the asterisk-dev mailing list