summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-02-13 10:50:47 -0700
committerGeorge Joseph <gjoseph@digium.com>2017-02-14 14:09:37 -0700
commitbf2f091bbb2b099d6ca87e5fdd76efe45a209eb7 (patch)
tree3ebbbb4a3a9235f221bb0df50587e9873905b5f9 /main/channel.c
parent6c4657e28ebf9cbe6d952750142d9631ff600657 (diff)
stream: Add stream topology to channel
Adds topology set and get to channel. ASTERISK-26790 Change-Id: Ic379ea82a9486fc79dbd8c4d95c29fa3b46424f4
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c9
1 files changed, 9 insertions, 0 deletions
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.