summaryrefslogtreecommitdiff
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 3f2ef5cb6..ccdbb6e7d 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -495,10 +495,10 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
}
ast_channel_unlock(chan);
} else if (!strcasecmp(data, "peer")) {
- struct ast_channel *p;
+ RAII_VAR(struct ast_channel *, p, NULL, ast_channel_cleanup);
ast_channel_lock(chan);
- p = ast_bridged_channel(chan);
+ p = ast_channel_bridge_peer(chan);
if (p || ast_channel_tech(chan)) /* dummy channel? if so, we hid the peer name in the language */
ast_copy_string(buf, (p ? ast_channel_name(p) : ""), len);
else {