aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-12 13:59:15 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-12 13:59:15 +0000
commit6f8508e0dc91d74f9c126759b28d711eeffca2ac (patch)
tree9345a8b61da436462f1b95c568b836a0e4174e6a /channel.c
parent34e6118176bb9e9f3244bddef34632a779baafac (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-xchannel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channel.c b/channel.c
index b7c4ff355..83659c073 100755
--- a/channel.c
+++ b/channel.c
@@ -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)