[asterisk-commits] kmoore: branch kmoore/stasis-bridge_events r384812 - in /team/kmoore/stasis-b...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 5 10:23:41 CDT 2013
Author: kmoore
Date: Fri Apr 5 10:23:38 2013
New Revision: 384812
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384812
Log:
tweak BridgeMerge documentation and move the string container to strings.c/h
Modified:
team/kmoore/stasis-bridge_events/include/asterisk/astobj2.h
team/kmoore/stasis-bridge_events/include/asterisk/strings.h
team/kmoore/stasis-bridge_events/main/astobj2.c
team/kmoore/stasis-bridge_events/main/manager_bridging.c
team/kmoore/stasis-bridge_events/main/stasis_bridging.c
team/kmoore/stasis-bridge_events/main/strings.c
Modified: team/kmoore/stasis-bridge_events/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/include/asterisk/astobj2.h?view=diff&rev=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/include/asterisk/astobj2.h (original)
+++ team/kmoore/stasis-bridge_events/include/asterisk/astobj2.h Fri Apr 5 10:23:38 2013
@@ -1884,12 +1884,4 @@
#endif
void ao2_iterator_cleanup(struct ao2_iterator *iter);
-/*!
- * \since 12
- * \brief Allocates a hash container for bare strings
- * \retval AO2 container for strings
- * \retval NULL if allocation failed
- */
-struct ao2_container *ao2_str_container_alloc(int buckets);
-
#endif /* _ASTERISK_ASTOBJ2_H */
Modified: team/kmoore/stasis-bridge_events/include/asterisk/strings.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/include/asterisk/strings.h?view=diff&rev=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/include/asterisk/strings.h (original)
+++ team/kmoore/stasis-bridge_events/include/asterisk/strings.h Fri Apr 5 10:23:38 2013
@@ -1013,4 +1013,12 @@
return abs(hash);
}
+/*!
+ * \since 12
+ * \brief Allocates a hash container for bare strings
+ * \retval AO2 container for strings
+ * \retval NULL if allocation failed
+ */
+struct ao2_container *ast_str_container_alloc(int buckets);
+
#endif /* _ASTERISK_STRINGS_H */
Modified: team/kmoore/stasis-bridge_events/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/main/astobj2.c?view=diff&rev=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/main/astobj2.c (original)
+++ team/kmoore/stasis-bridge_events/main/astobj2.c Fri Apr 5 10:23:38 2013
@@ -5780,17 +5780,3 @@
return 0;
}
-static int str_hash(const void *obj, const int flags)
-{
- return ast_str_hash(obj);
-}
-
-static int str_cmp(void *lhs, void *rhs, int flags)
-{
- return strcmp(lhs, rhs) ? 0 : CMP_MATCH;
-}
-
-struct ao2_container *ao2_str_container_alloc(int buckets)
-{
- return ao2_container_alloc(buckets, str_hash, str_cmp);
-}
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=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/main/manager_bridging.c (original)
+++ team/kmoore/stasis-bridge_events/main/manager_bridging.c Fri Apr 5 10:23:38 2013
@@ -98,23 +98,6 @@
<enum name="single"/>
<enum name="talker"/>
</enumlist>
- </parameter>
- </syntax>
- </managerEventInstance>
- </managerEvent>
- <managerEvent language="en_US" name="BridgeMerge">
- <managerEventInstance class="EVENT_FLAG_BRIDGE">
- <synopsis>Raised when two bridges are merged.</synopsis>
- <syntax>
- <parameter name="BridgeUniqueidTo">
- </parameter>
- <parameter name="BridgeTypeTo">
- <para>The type of bridge</para>
- </parameter>
- <parameter name="BridgeUniqueidFrom">
- </parameter>
- <parameter name="BridgeTypeFrom">
- <para>The type of bridge</para>
</parameter>
</syntax>
</managerEventInstance>
@@ -345,9 +328,23 @@
ast_assert(merge_msg->to != NULL);
ast_assert(merge_msg->from != NULL);
- to_text = manager_build_bridge_state_string(merge_msg->to, "To");
+ to_text = manager_build_bridge_state_string(merge_msg->to, "");
from_text = manager_build_bridge_state_string(merge_msg->from, "From");
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when two bridges are merged.</synopsis>
+ <syntax>
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='BridgeCreate']/managerEventInstance/syntax/parameter)" />
+ <parameter name="BridgeUniqueidFrom">
+ <para>The uniqueid of the bridge being dissolved in the merge</para>
+ </parameter>
+ <parameter name="BridgeTypeFrom">
+ <para>The type of bridge that is being dissolved in the merge</para>
+ </parameter>
+ </syntax>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_BRIDGE, "BridgeMerge",
"%s"
"%s",
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=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/main/stasis_bridging.c (original)
+++ team/kmoore/stasis-bridge_events/main/stasis_bridging.c Fri Apr 5 10:23:38 2013
@@ -69,7 +69,7 @@
return NULL;
}
- snapshot->channels = ao2_str_container_alloc(SNAPSHOT_CHANNELS_BUCKETS);
+ snapshot->channels = ast_str_container_alloc(SNAPSHOT_CHANNELS_BUCKETS);
if (!snapshot->channels) {
return NULL;
}
Modified: team/kmoore/stasis-bridge_events/main/strings.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/main/strings.c?view=diff&rev=384812&r1=384811&r2=384812
==============================================================================
--- team/kmoore/stasis-bridge_events/main/strings.c (original)
+++ team/kmoore/stasis-bridge_events/main/strings.c Fri Apr 5 10:23:38 2013
@@ -160,3 +160,17 @@
return (*buf)->__AST_STR_STR;
}
+static int str_hash(const void *obj, const int flags)
+{
+ return ast_str_hash(obj);
+}
+
+static int str_cmp(void *lhs, void *rhs, int flags)
+{
+ return strcmp(lhs, rhs) ? 0 : CMP_MATCH;
+}
+
+struct ao2_container *ast_str_container_alloc(int buckets)
+{
+ return ao2_container_alloc(buckets, str_hash, str_cmp);
+}
More information about the asterisk-commits
mailing list