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

Carlos Antunes cmantunes at gmail.com
Tue Sep 13 09:23:49 MST 2005


Unless I'm missing something too, the inability to lock an available channel 
appears to invalidate any potential use of ChanIsAvail.

It would be nice to be able to tell ChanIsAvail to lock an available channel 
until Dial is used or the dialplan logic ends.

On 9/13/05, hugolivude <hugolivude at gmail.com> wrote:
> 
> 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
> > 
> 
> 
> _______________________________________________
> 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
> 
> 


-- 
"We hold [...] that all men are created equal; that they are
endowed [...] with certain inalienable rights; that among
these are life, liberty, and the pursuit of happiness"
-- Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050913/5b3b55c2/attachment.htm


More information about the asterisk-dev mailing list