aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-30 03:16:53 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-30 03:16:53 +0000
commitdd5cbe502332ab46445c0c71e265d84966bd657c (patch)
tree6979f4fc238de98eef4574d4db0ffe073bd4a940 /channel.c
parent2bad44c90fd5c43e8ac0e1b0d9ae009111def609 (diff)
free write frames when spy queues provide frames that don't need to be dup'd
properly lock and trigger spies when detaching them en masse git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7223 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channel.c b/channel.c
index 585ed90f6..e86afb25e 100644
--- a/channel.c
+++ b/channel.c
@@ -1016,8 +1016,13 @@ void ast_channel_spy_stop_by_type(struct ast_channel *chan, const char *type)
return;
AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
- if ((spy->type == type) && (spy->status == CHANSPY_RUNNING))
+ ast_mutex_lock(&spy->lock);
+ if ((spy->type == type) && (spy->status == CHANSPY_RUNNING)) {
spy->status = CHANSPY_DONE;
+ if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
+ ast_cond_signal(&spy->trigger);
+ }
+ ast_mutex_unlock(&spy->lock);
}
}
@@ -3912,8 +3917,10 @@ struct ast_frame *ast_channel_spy_read_frame(struct ast_channel_spy *spy, unsign
if (need_dup)
result = ast_frdup(read_frame);
- else
+ else {
result = read_frame;
+ ast_frfree(write_frame);
+ }
} else {
if (need_dup) {
result = ast_frdup(read_frame);