[Asterisk-Dev] zaptel driver reads

Liam Kenny liam at druidsoftware.com
Thu Jun 5 02:59:17 MST 2003


I noticed that doing a read on a zaptel driver file descriptor will
discard any bytes in the current zaptel buffer that were not consumed
by the read. i.e. If there are 200 bytes in the current read buffer, and
a user process invokes read asking for 150 bytes, then the remaining
50 bytes will be discarded by the driver and will never be received by
the user.

So for instance if a user process is reading a zaptel clear channel, it
should always set the channels bufsize (using ioctl) to equal the chunk
size it will use for reads on that channel.

Note:  I modified zt_read in zaptel.c so that it did not discard the extra
         bytes just to be sure I understood this behaviour correctly 

Since Im new to asterisk I wondered if anyone could tell me whether this is 
designed behaviour ? i.e. Is it a well known prerequisite to using the zaptel
driver that the bufsize should always be initialised. (Like zap_open does 
in zapata)


More information about the asterisk-dev mailing list