mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
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/branches/1.4@104787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -462,6 +462,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);
|
||||
@@ -544,11 +548,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;
|
||||
@@ -612,6 +611,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);
|
||||
break;
|
||||
} else if (res > 1 && spec) {
|
||||
struct ast_channel *next;
|
||||
|
Reference in New Issue
Block a user