[Freeswitch-users] freetdm api - ftdm_channel_read()

Juraj Fabo juraj.fabo at gmail.com
Wed Jul 27 21:21:06 MSD 2011


Hi

I'm prototyping an application which uses libfreetdm above the sangoma
isdn stack and sangoma a104d card.
I would like to ask for help about proper reading of voice from the
particular channel.

According to return value of sangoma_get_rx_queue_sz() the default rx
queue size is 10.
I did tests when application skipped several reads on given channel,
then called ftdm_channel_read() w/ zero timeout  in a loop while the
return value of read was successfull - it was really 10 frames which
were then possible to read.

How can an application do this reading of a channel by the means of
the freetdm api in more nice way?
I did not find a better way yet, than to read it in the loop.
Any way to explicitly read the number of available frames?

Actually, why the ftdm_channel_read() does not read them ALL at once
and sets the number of read bytes via *datalen output parameter?
(assuming provided *data buffer is large enough)
In my tests, always 160 bytes were returned in one particular read.

thank you

juraj



More information about the FreeSWITCH-users mailing list