summaryrefslogtreecommitdiff
path: root/main/channel_internal_api.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-03-08 16:25:58 +0000
committerDavid M. Lee <dlee@digium.com>2013-03-08 16:25:58 +0000
commitc0e2ed1fe9f61f5b6d6c7de06c388e8d5a11563f (patch)
tree8cfcfef7027619c498a7459e1f4dce11bcced7c9 /main/channel_internal_api.c
parentc6b06e40dc859125cf76bec4632bd76de42256bd (diff)
Ensure dummy channels get a stasis topic.
Fixes test failure introduced in r382685. (issue ASTERISK-20887) (issue ASTERISK-20959) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel_internal_api.c')
-rw-r--r--main/channel_internal_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c
index 8cc2e6c62..d646d8485 100644
--- a/main/channel_internal_api.c
+++ b/main/channel_internal_api.c
@@ -1391,8 +1391,14 @@ struct stasis_topic *ast_channel_topic(struct ast_channel *chan)
void ast_channel_internal_setup_topics(struct ast_channel *chan)
{
+ const char *topic_name = chan->uniqueid;
ast_assert(chan->topic == NULL);
ast_assert(chan->forwarder == NULL);
- chan->topic = stasis_topic_create(chan->uniqueid);
+
+ if (ast_strlen_zero(topic_name)) {
+ topic_name = "<dummy-channel>";
+ }
+
+ chan->topic = stasis_topic_create(topic_name);
chan->forwarder = stasis_forward_all(chan->topic, ast_channel_topic_all());
}