aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 21:02:08 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 21:02:08 +0000
commit002278a62cb1d57af7f03fb5117900876fa54fe3 (patch)
tree19aa16c7ab8167261a92972baa0a2364dd3448c5
parent2a017cb36c72f477dbe4268781c26d123518db74 (diff)
Merged revisions 104787 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104787 | file | 2008-02-27 16:56:23 -0400 (Wed, 27 Feb 2008) | 2 lines Don't loop around infinitely trying to spy on our own channel, and don't forget to free/detach the datastore upon hangup of the spy. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104788 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_chanspy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 70365996e..e0377d35f 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -500,6 +500,10 @@ redo:
if (!strncmp(this->name, "Zap/pseudo", 10)) {
ast_channel_unlock(this);
goto redo;
+ } else if (this == chan) {
+ last = this;
+ ast_channel_unlock(this);
+ goto redo;
}
return setup_chanspy_ds(this, chanspy_ds);
@@ -616,11 +620,6 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
break;
}
- if (peer == chan) {
- ast_channel_unlock(peer);
- continue;
- }
-
if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) {
ast_channel_unlock(peer);
continue;
@@ -714,6 +713,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
num_spyed_upon++;
if (res == -1) {
+ chanspy_ds_free(peer_chanspy_ds);
goto exit;
} else if (res == -2) {
res = 0;