[asterisk-commits] dlee: trunk r382721 - in /trunk/main: channel.c channel_internal_api.c stasis.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 8 10:26:02 CST 2013
Author: dlee
Date: Fri Mar 8 10:25:58 2013
New Revision: 382721
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382721
Log:
Ensure dummy channels get a stasis topic.
Fixes test failure introduced in r382685.
Modified:
trunk/main/channel.c
trunk/main/channel_internal_api.c
trunk/main/stasis.c
Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=382721&r1=382720&r2=382721
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Fri Mar 8 10:25:58 2013
@@ -1282,6 +1282,8 @@
#ifdef HAVE_EPOLL
ast_channel_epfd_set(tmp, -1);
#endif
+
+ ast_channel_internal_setup_topics(tmp);
headp = ast_channel_varshead(tmp);
AST_LIST_HEAD_INIT_NOLOCK(headp);
Modified: trunk/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel_internal_api.c?view=diff&rev=382721&r1=382720&r2=382721
==============================================================================
--- trunk/main/channel_internal_api.c (original)
+++ trunk/main/channel_internal_api.c Fri Mar 8 10:25:58 2013
@@ -1391,8 +1391,14 @@
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());
}
Modified: trunk/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis.c?view=diff&rev=382721&r1=382720&r2=382721
==============================================================================
--- trunk/main/stasis.c (original)
+++ trunk/main/stasis.c Fri Mar 8 10:25:58 2013
@@ -337,6 +337,10 @@
struct stasis_subscription **subscribers = NULL;
size_t num_subscribers, i;
+ ast_assert(topic != NULL);
+ ast_assert(publisher_topic != NULL);
+ ast_assert(message != NULL);
+
/* Copy the subscribers, so we don't have to hold the mutex for long */
{
SCOPED_AO2LOCK(lock, topic);
More information about the asterisk-commits
mailing list