[asterisk-dev] Link reliability issues on DAHDI

Kevin P. Fleming kpfleming at digium.com
Thu Nov 13 14:09:57 CST 2008

Felipe Bergo wrote:

> Looking at the kernel module source, reads and writes return ELAST when
> (chan->eventinidx != chan->eventoutidx), which I interpret as "the event
> queue is not empty":
> (dahdi-base.c, rev. 5275, line 1914):
>     for (;;) {
>        spin_lock_irqsave(&chan->lock, flags);
>        if (chan->eventinidx != chan->eventoutidx) {
>           spin_unlock_irqrestore(&chan->lock, flags);
>           return -ELAST /* - chan->eventbuf[chan->eventoutidx]*/;
>        }

Ahh yes... for any channels that can provide events to you, you *must*
consume them, or the channel will end up broken. This is why chan_dahdi
uses the IOMUX ioctl method of waiting on the channel, so that it can be
notified whether the channel has data available or an event, and then it
reads and processes the event.

Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)

More information about the asterisk-dev mailing list