aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-07-11 14:13:24 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-07-11 14:13:24 +0000
commit9374cf84f9beb1adb4daa1a8cebe4cb6dc7f5c51 (patch)
treeaf38b6887e83d1d65311cc2b6933c2ea07c85c4b /res
parent959deafb08b36e7a7ee52493e048c751b646dc9b (diff)
write silence on the channel during t.38 negotiation
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327514 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_fax.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index 5202e6323..2b3fec194 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -2977,8 +2977,21 @@ static struct ast_frame *fax_gateway_framehook(struct ast_channel *chan, struct
/* 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;