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: https://origsvn.digium.com/svn/asterisk/trunk@104788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2008-02-27 21:02:08 +00:00
parent 10d9d1e5a1
commit 9080a65bec

View File

@@ -500,6 +500,10 @@ redo:
if (!strncmp(this->name, "Zap/pseudo", 10)) { if (!strncmp(this->name, "Zap/pseudo", 10)) {
ast_channel_unlock(this); ast_channel_unlock(this);
goto redo; goto redo;
} else if (this == chan) {
last = this;
ast_channel_unlock(this);
goto redo;
} }
return setup_chanspy_ds(this, chanspy_ds); 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; break;
} }
if (peer == chan) {
ast_channel_unlock(peer);
continue;
}
if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) { if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) {
ast_channel_unlock(peer); ast_channel_unlock(peer);
continue; continue;
@@ -714,6 +713,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
num_spyed_upon++; num_spyed_upon++;
if (res == -1) { if (res == -1) {
chanspy_ds_free(peer_chanspy_ds);
goto exit; goto exit;
} else if (res == -2) { } else if (res == -2) {
res = 0; res = 0;