[asterisk-dev] Sync problem

Muhammad Ali enigma.ali at gmail.com
Wed Aug 4 02:17:55 CDT 2010


Hi,

I am reading and writing to grouped zap channels using  "*
open("/dev/zap/channel")*" interface. The scenario is as depicted in the
diagram below;

[asterisk box 1] ========E1=======[asterisk box 2]

block size at both the transmit and receive ends is 2039. Both sides have
same grouping of channels.
Buffer policy : immediate

The problem i am having is, the transmitter *write* operation is not in sync
with receiver *read* operation.
Meaning to say, when i write from "end 1" the receiver might already in
process of read operation. so my transmitted data might reach the "end 2"
when half or some part of the buffer has already been read.

So suppose i am sending 1000 bytes of data, over 15 channels grouped
together, and my receiver starts getting data when 75 % buffer has been
read, i am left with 25% buffer but that is unable to receive the whole 1000
bytes .

The point where i think things are going wrong is, when am not transmitting
anything (not executing *write)* i get 0xFF on the receive side, even when
the channels are in "*clear*" state. Can this be controller/ disabled ( i am
assuming buffer policy set to "*when full*" might help but want to make
sure)?

Secondly, when i try the *ioctl *for ZT_IOMUX for ZT_IOMUX_READ it always
returns as soon as its called which means it does not wait for my write to
happen (maybe this is because of 0xFF always on the line).

So how can i sense if there is actual write on the wire and not 0xFF so i
may wait for actual data to start before depleting my buffers.

BR.

-- 
ALi...
(علی)
http://m-ali.deviantart.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100804/f34f3edd/attachment.htm 


More information about the asterisk-dev mailing list