diff options
author | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-12 13:59:15 +0000 |
---|---|---|
committer | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-12 13:59:15 +0000 |
commit | 6f8508e0dc91d74f9c126759b28d711eeffca2ac (patch) | |
tree | 9345a8b61da436462f1b95c568b836a0e4174e6a /channel.c | |
parent | 34e6118176bb9e9f3244bddef34632a779baafac (diff) |
mer feb 12 14:56:57 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@612 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-x | channel.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -376,6 +376,7 @@ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int lock) int ast_queue_hangup(struct ast_channel *chan, int lock) { struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP }; + chan->_softhangup |= AST_SOFTHANGUP_DEV; return ast_queue_frame(chan, &f, lock); } @@ -1145,7 +1146,7 @@ static int do_senddigit(struct ast_channel *chan, char digit) int ast_write(struct ast_channel *chan, struct ast_frame *fr) { int res = -1; - struct ast_frame *f; + struct ast_frame *f = NULL; /* Stop if we're a zombie or need a soft hangup */ if (chan->zombie || ast_check_hangup(chan)) return -1; @@ -1180,7 +1181,7 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr) default: if (chan->pvt->write) { if (chan->pvt->writetrans) { - f = ast_translate(chan->pvt->writetrans, fr, 1); + f = ast_translate(chan->pvt->writetrans, fr, 0); } else f = fr; if (f) @@ -1189,6 +1190,8 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr) res = 0; } } + if (f && (f != fr)) + ast_frfree(f); chan->blocking = 0; /* Consider a write failure to force a soft hangup */ if (res < 0) |