[asterisk-commits] kmoore: trunk r384261 - in /trunk: apps/ include/asterisk/ main/ pbx/ tests/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 28 10:45:22 CDT 2013
Author: kmoore
Date: Thu Mar 28 10:45:18 2013
New Revision: 384261
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384261
Log:
Break the world. Stasis message type accessors should now all be named correctly.
Modified:
trunk/apps/app_voicemail.c
trunk/include/asterisk/channel.h
trunk/include/asterisk/stasis.h
trunk/main/app.c
trunk/main/channel.c
trunk/main/manager_channels.c
trunk/main/pbx.c
trunk/main/stasis.c
trunk/main/stasis_cache.c
trunk/pbx/pbx_realtime.c
trunk/tests/test_stasis.c
Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Mar 28 10:45:18 2013
@@ -12627,7 +12627,7 @@
{
struct stasis_subscription_change *change;
/* Only looking for subscription change notices here */
- if (stasis_message_type(msg) != stasis_subscription_change()) {
+ if (stasis_message_type(msg) != stasis_subscription_change_type()) {
return;
}
@@ -12656,7 +12656,7 @@
mwi_sub_sub = stasis_subscribe(stasis_mwi_topic_all(), mwi_event_cb, NULL);
if (mwi_sub_sub) {
- struct ao2_container *cached = stasis_cache_dump(stasis_mwi_topic_cached(), stasis_subscription_change());
+ struct ao2_container *cached = stasis_cache_dump(stasis_mwi_topic_cached(), stasis_subscription_change_type());
if (cached) {
ao2_callback(cached, OBJ_MULTIPLE | OBJ_NODATA, dump_cache, NULL);
}
Modified: trunk/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/channel.h?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/include/asterisk/channel.h (original)
+++ trunk/include/asterisk/channel.h Thu Mar 28 10:45:18 2013
@@ -4186,7 +4186,7 @@
*
* \retval Message type for \ref ast_channel_snapshot.
*/
-struct stasis_message_type *ast_channel_snapshot(void);
+struct stasis_message_type *ast_channel_snapshot_type(void);
/*!
* \since 12
@@ -4237,7 +4237,7 @@
*
* \retval Message type for \ref ast_channel_blob messages.
*/
-struct stasis_message_type *ast_channel_blob(void);
+struct stasis_message_type *ast_channel_blob_type(void);
/*!
* \since 12
@@ -4247,7 +4247,7 @@
* \return Type field value from the blob.
* \return \c NULL on error.
*/
-const char *ast_channel_blob_type(struct ast_channel_blob *obj);
+const char *ast_channel_blob_json_type(struct ast_channel_blob *obj);
/*!
* \since 12
Modified: trunk/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/stasis.h?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/include/asterisk/stasis.h (original)
+++ trunk/include/asterisk/stasis.h Thu Mar 28 10:45:18 2013
@@ -377,7 +377,7 @@
* \return The stasis_message_type for subscription change notices
* \since 12
*/
-struct stasis_message_type *stasis_subscription_change(void);
+struct stasis_message_type *stasis_subscription_change_type(void);
/*! @} */
@@ -413,7 +413,7 @@
* \return Message type for cache update messages.
* \since 12
*/
-struct stasis_message_type *stasis_cache_update(void);
+struct stasis_message_type *stasis_cache_update_type(void);
/*!
* \brief Cache update message
Modified: trunk/main/app.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/app.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Thu Mar 28 10:45:18 2013
@@ -2719,7 +2719,7 @@
if (stasis_mwi_state_type() == stasis_message_type(message)) {
struct stasis_mwi_state *mwi_state = stasis_message_data(message);
return mwi_state->uniqueid;
- } else if (stasis_subscription_change() == stasis_message_type(message)) {
+ } else if (stasis_subscription_change_type() == stasis_message_type(message)) {
struct stasis_subscription_change *change = stasis_message_data(message);
return change->uniqueid;
}
Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Thu Mar 28 10:45:18 2013
@@ -153,13 +153,13 @@
static struct ao2_container *channels;
/*! \brief Message type for channel snapshot events */
-static struct stasis_message_type *__channel_snapshot;
-
-static struct stasis_message_type *__channel_blob;
-
-struct stasis_topic *__channel_topic_all;
-
-struct stasis_caching_topic *__channel_topic_all_cached;
+static struct stasis_message_type *channel_snapshot_type;
+
+static struct stasis_message_type *channel_blob_type;
+
+struct stasis_topic *channel_topic_all;
+
+struct stasis_caching_topic *channel_topic_all_cached;
/*! \brief map AST_CAUSE's to readable string representations
*
@@ -234,7 +234,7 @@
return;
}
- message = stasis_message_create(ast_channel_snapshot(), snapshot);
+ message = stasis_message_create(ast_channel_snapshot_type(), snapshot);
if (!message) {
return;
}
@@ -291,7 +291,7 @@
obj->blob = ast_json_ref(blob);
- msg = stasis_message_create(ast_channel_blob(), obj);
+ msg = stasis_message_create(ast_channel_blob_type(), obj);
if (!msg) {
return NULL;
}
@@ -300,7 +300,7 @@
return msg;
}
-const char *ast_channel_blob_type(struct ast_channel_blob *obj)
+const char *ast_channel_blob_json_type(struct ast_channel_blob *obj)
{
if (obj == NULL) {
return NULL;
@@ -329,7 +329,7 @@
{
RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
- message = stasis_cache_clear_create(ast_channel_snapshot(), ast_channel_uniqueid(chan));
+ message = stasis_cache_clear_create(ast_channel_snapshot_type(), ast_channel_uniqueid(chan));
stasis_publish(ast_channel_topic(chan), message);
}
@@ -8701,13 +8701,13 @@
static void channels_shutdown(void)
{
free_channelvars();
- ao2_cleanup(__channel_snapshot);
- __channel_snapshot = NULL;
- ao2_cleanup(__channel_blob);
- __channel_blob = NULL;
- ao2_cleanup(__channel_topic_all);
- __channel_topic_all = NULL;
- __channel_topic_all_cached = stasis_caching_unsubscribe(__channel_topic_all_cached);
+ ao2_cleanup(channel_snapshot_type);
+ channel_snapshot_type = NULL;
+ ao2_cleanup(channel_blob_type);
+ channel_blob_type = NULL;
+ ao2_cleanup(channel_topic_all);
+ channel_topic_all = NULL;
+ channel_topic_all_cached = stasis_caching_unsubscribe(channel_topic_all_cached);
ast_data_unregister(NULL);
ast_cli_unregister_multiple(cli_channel, ARRAY_LEN(cli_channel));
if (channels) {
@@ -8720,7 +8720,7 @@
static const char *channel_snapshot_get_id(struct stasis_message *message)
{
struct ast_channel_snapshot *snapshot;
- if (ast_channel_snapshot() != stasis_message_type(message)) {
+ if (ast_channel_snapshot_type() != stasis_message_type(message)) {
return NULL;
}
snapshot = stasis_message_data(message);
@@ -8735,11 +8735,11 @@
ao2_container_register("channels", channels, prnt_channel_key);
}
- __channel_snapshot = stasis_message_type_create("ast_channel_snapshot");
- __channel_blob = stasis_message_type_create("ast_channel_blob");
-
- __channel_topic_all = stasis_topic_create("ast_channel_topic_all");
- __channel_topic_all_cached = stasis_caching_topic_create(__channel_topic_all, channel_snapshot_get_id);
+ channel_snapshot_type = stasis_message_type_create("ast_channel_snapshot");
+ channel_blob_type = stasis_message_type_create("ast_channel_blob");
+
+ channel_topic_all = stasis_topic_create("ast_channel_topic_all");
+ channel_topic_all_cached = stasis_caching_topic_create(channel_topic_all, channel_snapshot_get_id);
ast_cli_register_multiple(cli_channel, ARRAY_LEN(cli_channel));
@@ -11379,24 +11379,24 @@
return snapshot;
}
-struct stasis_message_type *ast_channel_blob(void)
-{
- return __channel_blob;
-}
-
-struct stasis_message_type *ast_channel_snapshot(void)
-{
- return __channel_snapshot;
+struct stasis_message_type *ast_channel_blob_type(void)
+{
+ return channel_blob_type;
+}
+
+struct stasis_message_type *ast_channel_snapshot_type(void)
+{
+ return channel_snapshot_type;
}
struct stasis_topic *ast_channel_topic_all(void)
{
- return __channel_topic_all;
+ return channel_topic_all;
}
struct stasis_caching_topic *ast_channel_topic_all_cached(void)
{
- return __channel_topic_all_cached;
+ return channel_topic_all_cached;
}
/* DO NOT PUT ADDITIONAL FUNCTIONS BELOW THIS BOUNDARY
Modified: trunk/main/manager_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_channels.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/manager_channels.c (original)
+++ trunk/main/manager_channels.c Thu Mar 28 10:45:18 2013
@@ -441,7 +441,7 @@
update = stasis_message_data(message);
- if (ast_channel_snapshot() != update->type) {
+ if (ast_channel_snapshot_type() != update->type) {
return;
}
@@ -593,11 +593,11 @@
{
struct ast_channel_blob *obj = stasis_message_data(message);
- if (strcmp("varset", ast_channel_blob_type(obj)) == 0) {
+ if (strcmp("varset", ast_channel_blob_json_type(obj)) == 0) {
channel_varset(obj);
- } else if (strcmp("userevent", ast_channel_blob_type(obj)) == 0) {
+ } else if (strcmp("userevent", ast_channel_blob_json_type(obj)) == 0) {
channel_userevent(obj);
- } else if (strcmp("hangup_request", ast_channel_blob_type(obj)) == 0) {
+ } else if (strcmp("hangup_request", ast_channel_blob_json_type(obj)) == 0) {
channel_hangup_request(obj);
}
}
@@ -627,12 +627,12 @@
}
ret |= stasis_message_router_add(channel_state_router,
- stasis_cache_update(),
+ stasis_cache_update_type(),
channel_snapshot_update,
NULL);
ret |= stasis_message_router_add(channel_state_router,
- ast_channel_blob(),
+ ast_channel_blob_type(),
channel_blob_cb,
NULL);
Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Thu Mar 28 10:45:18 2013
@@ -4708,7 +4708,7 @@
*/
ast_string_field_set(snapshot, appl, app->name);
ast_string_field_set(snapshot, data, passdata);
- msg = stasis_message_create(ast_channel_snapshot(), snapshot);
+ msg = stasis_message_create(ast_channel_snapshot_type(), snapshot);
if (msg) {
stasis_publish(ast_channel_topic(c), msg);
}
Modified: trunk/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/stasis.c (original)
+++ trunk/main/stasis.c Thu Mar 28 10:45:18 2013
@@ -217,7 +217,7 @@
int stasis_subscription_final_message(struct stasis_subscription *sub, struct stasis_message *msg)
{
struct stasis_subscription_change *change;
- if (stasis_message_type(msg) != stasis_subscription_change()) {
+ if (stasis_message_type(msg) != stasis_subscription_change_type()) {
return 0;
}
@@ -413,7 +413,7 @@
return change;
}
-struct stasis_message_type *stasis_subscription_change(void)
+struct stasis_message_type *stasis_subscription_change_type(void)
{
return __subscription_change_message_type;
}
@@ -429,7 +429,7 @@
return;
}
- msg = stasis_message_create(stasis_subscription_change(), change);
+ msg = stasis_message_create(stasis_subscription_change_type(), change);
if (!msg) {
return;
Modified: trunk/main/stasis_cache.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_cache.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/main/stasis_cache.c (original)
+++ trunk/main/stasis_cache.c Thu Mar 28 10:45:18 2013
@@ -250,7 +250,7 @@
static struct stasis_message_type *__cache_update;
-struct stasis_message_type *stasis_cache_update(void)
+struct stasis_message_type *stasis_cache_update_type(void)
{
ast_assert(__cache_update != NULL);
return __cache_update;
@@ -340,7 +340,7 @@
update->type = stasis_message_type(new_snapshot);
}
- msg = stasis_message_create(stasis_cache_update(), update);
+ msg = stasis_message_create(stasis_cache_update_type(), update);
if (!msg) {
return NULL;
}
Modified: trunk/pbx/pbx_realtime.c
URL: http://svnview.digium.com/svn/asterisk/trunk/pbx/pbx_realtime.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/pbx/pbx_realtime.c (original)
+++ trunk/pbx/pbx_realtime.c Thu Mar 28 10:45:18 2013
@@ -363,7 +363,7 @@
*/
ast_string_field_set(snapshot, appl, app);
ast_string_field_set(snapshot, data, !ast_strlen_zero(appdata) ? appdata : "(NULL)");
- msg = stasis_message_create(ast_channel_snapshot(), snapshot);
+ msg = stasis_message_create(ast_channel_snapshot_type(), snapshot);
if (msg) {
stasis_publish(ast_channel_topic(chan), msg);
}
Modified: trunk/tests/test_stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_stasis.c?view=diff&rev=384261&r1=384260&r2=384261
==============================================================================
--- trunk/tests/test_stasis.c (original)
+++ trunk/tests/test_stasis.c Thu Mar 28 10:45:18 2013
@@ -161,7 +161,7 @@
RAII_VAR(struct consumer *, consumer_needs_cleanup, NULL, ao2_cleanup);
SCOPED_MUTEX(lock, &consumer->lock);
- if (!consumer->ignore_subscriptions || stasis_message_type(message) != stasis_subscription_change()) {
+ if (!consumer->ignore_subscriptions || stasis_message_type(message) != stasis_subscription_change_type()) {
++consumer->messages_rxed_len;
consumer->messages_rxed = ast_realloc(consumer->messages_rxed, sizeof(*consumer->messages_rxed) * consumer->messages_rxed_len);
@@ -282,8 +282,8 @@
ast_test_validate(test, 1 == complete);
ast_test_validate(test, 2 == consumer->messages_rxed_len);
- ast_test_validate(test, stasis_subscription_change() == stasis_message_type(consumer->messages_rxed[0]));
- ast_test_validate(test, stasis_subscription_change() == stasis_message_type(consumer->messages_rxed[1]));
+ ast_test_validate(test, stasis_subscription_change_type() == stasis_message_type(consumer->messages_rxed[0]));
+ ast_test_validate(test, stasis_subscription_change_type() == stasis_message_type(consumer->messages_rxed[1]));
change = stasis_message_data(consumer->messages_rxed[0]);
ast_test_validate(test, topic == change->topic);
@@ -606,7 +606,7 @@
cache_dump = NULL;
/* Check for new snapshot messages */
- ast_test_validate(test, stasis_cache_update() == stasis_message_type(consumer->messages_rxed[0]));
+ ast_test_validate(test, stasis_cache_update_type() == stasis_message_type(consumer->messages_rxed[0]));
actual_update = stasis_message_data(consumer->messages_rxed[0]);
ast_test_validate(test, topic == actual_update->topic);
ast_test_validate(test, NULL == actual_update->old_snapshot);
@@ -615,7 +615,7 @@
/* stasis_cache_get returned a ref, so unref test_message1_1 */
ao2_ref(test_message1_1, -1);
- ast_test_validate(test, stasis_cache_update() == stasis_message_type(consumer->messages_rxed[1]));
+ ast_test_validate(test, stasis_cache_update_type() == stasis_message_type(consumer->messages_rxed[1]));
actual_update = stasis_message_data(consumer->messages_rxed[1]);
ast_test_validate(test, topic == actual_update->topic);
ast_test_validate(test, NULL == actual_update->old_snapshot);
@@ -667,7 +667,7 @@
cache_dump = NULL;
/* Dump the cache to ensure that it has no subscription change items in it since those aren't cached */
- cache_dump = stasis_cache_dump(caching_topic, stasis_subscription_change());
+ cache_dump = stasis_cache_dump(caching_topic, stasis_subscription_change_type());
ast_test_validate(test, 0 == ao2_container_count(cache_dump));
ao2_ref(cache_dump, -1);
cache_dump = NULL;
More information about the asterisk-commits
mailing list