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
This commit is contained in:
David M. Lee
2013-03-08 16:25:58 +00:00
parent c6b06e40dc
commit c0e2ed1fe9
3 changed files with 13 additions and 1 deletions

View File

@@ -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());
}