From bf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Mon, 13 Feb 2017 10:50:47 -0700 Subject: stream: Add stream topology to channel Adds topology set and get to channel. ASTERISK-26790 Change-Id: Ic379ea82a9486fc79dbd8c4d95c29fa3b46424f4 --- main/channel.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main/channel.c') diff --git a/main/channel.c b/main/channel.c index 234919336..fa92508ac 100644 --- a/main/channel.c +++ b/main/channel.c @@ -73,6 +73,7 @@ #include "asterisk/test.h" #include "asterisk/stasis_channels.h" #include "asterisk/max_forwards.h" +#include "asterisk/stream.h" /*** DOCUMENTATION ***/ @@ -806,6 +807,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char struct ast_timer *timer; struct timeval now; const struct ast_channel_tech *channel_tech; + struct ast_stream_topology *topology; /* If shutting down, don't allocate any new channels */ if (ast_shutting_down()) { @@ -886,6 +888,11 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char return ast_channel_unref(tmp); } + if (!(topology = ast_stream_topology_create())) { + return ast_channel_unref(tmp); + } + ast_channel_internal_set_stream_topology(tmp, topology); + /* Always watch the alertpipe */ ast_channel_set_fd(tmp, AST_ALERT_FD, ast_channel_internal_alert_readfd(tmp)); /* And timing pipe */ @@ -7074,6 +7081,8 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann ast_channel_tech(clonechan)->type, ast_channel_name(clonechan)); } + ast_channel_internal_swap_stream_topology(original, clonechan); + /* * Now, at this point, the "clone" channel is totally F'd up. * We mark it as a zombie so nothing tries to touch it. -- cgit v1.2.3