[asterisk-dev] Documentation about asterisk API

Simone Ricci simone.ricci at cwnet.it
Fri Jan 5 08:19:25 MST 2007


Hi,
is there any place where I may find some documentation on the asterisk
API (despite doxygen)?
In the meantime, a quick question. If I wish to generate a silent frame
and send it to a channel, is this acceptable:

int old_write_format;
struct ast_channel *chan;

chan = ast_bridged_channel(ast);

short buf[160] = { 0, };
struct ast_frame cng_empty_frame = {
	.frametype = AST_FRAME_VOICE,
	.subclass = AST_FORMAT_SLINEAR,
	.data = buf,
	.samples = 160,
	.datalen = sizeof(buf),
};

old_write_format = chan->writeformat;
ast_set_write_format(chan, AST_FORMAT_SLINEAR);
ast_write(chan, &cng_empty_frame);
ast_set_write_format(chan, old_write_format);


TIA,
Simone.


More information about the asterisk-dev mailing list