[asterisk-commits] mnicholson: trunk r327514 - /trunk/res/res_fax.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 11 09:13:28 CDT 2011
Author: mnicholson
Date: Mon Jul 11 09:13:24 2011
New Revision: 327514
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=327514
Log:
write silence on the channel during t.38 negotiation
Modified:
trunk/res/res_fax.c
Modified: trunk/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_fax.c?view=diff&rev=327514&r1=327513&r2=327514
==============================================================================
--- trunk/res/res_fax.c (original)
+++ trunk/res/res_fax.c Mon Jul 11 09:13:24 2011
@@ -2977,8 +2977,21 @@
/* force silence on the line if T.38 negotiation might be taking place */
if (!ast_tvzero(gateway->ced_timeout_start) || (gateway->t38_state != T38_STATE_UNAVAILABLE && gateway->t38_state != T38_STATE_REJECTED)) {
- /* XXX may need to return a silence frame here */
- return &ast_null_frame;
+ if (f->frametype == AST_FRAME_VOICE && f->subclass.format.id == AST_FORMAT_SLINEAR) {
+ short silence_buf[f->samples];
+ struct ast_frame silence_frame = {
+ .frametype = AST_FRAME_VOICE,
+ .data.ptr = silence_buf,
+ .samples = f->samples,
+ .datalen = sizeof(silence_buf),
+ };
+ ast_format_set(&silence_frame.subclass.format, AST_FORMAT_SLINEAR, 0);
+ memset(silence_buf, 0, sizeof(silence_buf));
+
+ return ast_frisolate(&silence_frame);
+ } else {
+ return &ast_null_frame;
+ }
}
return f;
More information about the asterisk-commits
mailing list