[asterisk-dev] channel formats and ast_set_read/write_format

Klaus Darilion klaus.mailinglists at pernau.at
Tue Mar 31 10:51:19 CDT 2009


Hi!

I failed to find out the differences in struct ast_channel between:

int nativeformats;                /*!< Kinds of data this channel can
natively handle */
int readformat;                   /*!< Requested read format */
int writeformat;                  /*!< Requested write format */
struct ast_trans_pvt *writetrans; /*!< Write translation path */
struct ast_trans_pvt *readtrans;  /*!< Read translation path */
int rawreadformat;                /*!< Raw read format */
int rawwriteformat;               /*!< Raw write format */

and the proper usage of ast_set_read/write_format.

Can somebody please describe the meaning of these channel members for a 
channel driver?

Who should write to these channel members - the core or the channel
driver? What does "read" mean - the channel reads from the core or the
core reads from the channel?

What's the difference between readformat and rawreadformat?

E.g. a channel driver receives RTP packets with G.729 and forwards them
to the core. Further, the channel driver wants to receive the voice
frames in format alaw. Which channel members have to be set by the
channel driver? Does the channel driver have to set the channel members
directly or is this done with the ast_set_read/write_format() functions?
What is the role of nativeformats in this case?

thanks
klaus




More information about the asterisk-dev mailing list