[asterisk-commits] kmoore: branch kmoore/stasis-bridge_events r385303 - in /team/kmoore/stasis-b...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 11 08:57:46 CDT 2013
Author: kmoore
Date: Thu Apr 11 08:57:43 2013
New Revision: 385303
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385303
Log:
Address lots of minor items in review feedback
Modified:
team/kmoore/stasis-bridge_events/apps/app_stasis.c
team/kmoore/stasis-bridge_events/include/asterisk/stasis_bridging.h
team/kmoore/stasis-bridge_events/main/manager_bridging.c
team/kmoore/stasis-bridge_events/main/stasis_bridging.c
Modified: team/kmoore/stasis-bridge_events/apps/app_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/apps/app_stasis.c?view=diff&rev=385303&r1=385302&r2=385303
==============================================================================
--- team/kmoore/stasis-bridge_events/apps/app_stasis.c (original)
+++ team/kmoore/stasis-bridge_events/apps/app_stasis.c Thu Apr 11 08:57:43 2013
@@ -283,13 +283,12 @@
static int app_add_channel(struct app* app, const struct ast_channel *chan)
{
- RAII_VAR(char *, ao2_bridge_id, NULL, ao2_cleanup);
char *uniqueid;
ast_assert(chan != NULL);
ast_assert(app != NULL);
uniqueid = ast_strdupa(ast_channel_uniqueid(chan));
- if (!ast_str_container_add(app->channels, uniqueid)) {
+ if (ast_str_container_add(app->channels, uniqueid)) {
return -1;
}
Modified: team/kmoore/stasis-bridge_events/include/asterisk/stasis_bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/include/asterisk/stasis_bridging.h?view=diff&rev=385303&r1=385302&r2=385303
==============================================================================
--- team/kmoore/stasis-bridge_events/include/asterisk/stasis_bridging.h (original)
+++ team/kmoore/stasis-bridge_events/include/asterisk/stasis_bridging.h Thu Apr 11 08:57:43 2013
@@ -59,9 +59,9 @@
* \brief Generate a snapshot of the bridge state. This is an ao2 object, so
* ao2_cleanup() to deallocate.
*
- * \param chan The bridge from which to generate a snapshot
+ * \param bridge The bridge from which to generate a snapshot
*
- * \retval pointer on success (must be ast_freed)
+ * \retval AO2 refcounted snapshot on success
* \retval NULL on error
*/
struct ast_bridge_snapshot *ast_bridge_snapshot_create(struct ast_bridge *bridge);
@@ -99,7 +99,7 @@
* \brief A caching topic which caches \ref ast_bridge_snapshot messages from
* ast_bridge_events_all(void).
*
- * \retval Topic for all bridge events.
+ * \retval Caching topic for all bridge events.
*/
struct stasis_caching_topic *ast_bridge_topic_all_cached(void);
@@ -126,12 +126,12 @@
/*!
* \since 12
- * \brief Publish a bridge merger
+ * \brief Publish a bridge merge
*
- * \param bridge1 The bridge to which channels are being added
- * \param bridge2 The bridge from which channels are being removed
+ * \param to The bridge to which channels are being added
+ * \param from The bridge from which channels are being removed
*/
-void ast_bridge_publish_merge(struct ast_bridge *bridge1, struct ast_bridge *bridge2);
+void ast_bridge_publish_merge(struct ast_bridge *to, struct ast_bridge *from);
/*!
* \brief Dispose of the stasis bridging topics and message types
Modified: team/kmoore/stasis-bridge_events/main/manager_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/main/manager_bridging.c?view=diff&rev=385303&r1=385302&r2=385303
==============================================================================
--- team/kmoore/stasis-bridge_events/main/manager_bridging.c (original)
+++ team/kmoore/stasis-bridge_events/main/manager_bridging.c Thu Apr 11 08:57:43 2013
@@ -473,7 +473,9 @@
return -1;
}
- if (!bridge_uniqueid) {
+ if (!ast_strlen_zero(bridge_uniqueid)) {
+ astman_send_error(s, m, "BridgeUniqueid must be provided");
+ return -1;
}
if (!ast_strlen_zero(id)) {
@@ -482,7 +484,7 @@
msg = stasis_cache_get(ast_bridge_topic_all_cached(), ast_bridge_snapshot_type(), bridge_uniqueid);
if (!msg) {
- astman_send_error(s, m, "BridgeUniqueid not found");
+ astman_send_error(s, m, "Specified BridgeUniqueid not found");
return -1;
}
Modified: team/kmoore/stasis-bridge_events/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/main/stasis_bridging.c?view=diff&rev=385303&r1=385302&r2=385303
==============================================================================
--- team/kmoore/stasis-bridge_events/main/stasis_bridging.c (original)
+++ team/kmoore/stasis-bridge_events/main/stasis_bridging.c Thu Apr 11 08:57:43 2013
@@ -135,12 +135,12 @@
if (!snapshot) {
return;
}
-
+
msg = stasis_message_create(ast_bridge_snapshot_type(), snapshot);
if (!msg) {
return;
}
-
+
stasis_publish(ast_bridge_topic(bridge), msg);
}
@@ -159,7 +159,7 @@
msg->from = NULL;
}
-static struct ast_bridge_merge_message *bridge_merge_message_create(struct ast_bridge *bridge1, struct ast_bridge *bridge2)
+static struct ast_bridge_merge_message *bridge_merge_message_create(struct ast_bridge *to, struct ast_bridge *from)
{
RAII_VAR(struct ast_bridge_merge_message *, msg, NULL, ao2_cleanup);
@@ -168,12 +168,12 @@
return NULL;
}
- msg->to = ast_bridge_snapshot_create(bridge1);
+ msg->to = ast_bridge_snapshot_create(to);
if (!msg->to) {
return NULL;
}
- msg->from = ast_bridge_snapshot_create(bridge2);
+ msg->from = ast_bridge_snapshot_create(from);
if (!msg->from) {
return NULL;
}
@@ -182,15 +182,15 @@
return msg;
}
-void ast_bridge_publish_merge(struct ast_bridge *bridge1, struct ast_bridge *bridge2)
+void ast_bridge_publish_merge(struct ast_bridge *to, struct ast_bridge *from)
{
RAII_VAR(struct ast_bridge_merge_message *, merge_msg, NULL, ao2_cleanup);
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
- ast_assert(bridge1 != NULL);
- ast_assert(bridge2 != NULL);
-
- merge_msg = bridge_merge_message_create(bridge1, bridge2);
+ ast_assert(to != NULL);
+ ast_assert(from != NULL);
+
+ merge_msg = bridge_merge_message_create(to, from);
if (!merge_msg) {
return;
}
More information about the asterisk-commits
mailing list