[asterisk-commits] kmoore: branch group/bridge_construction r385523 - in /team/group/bridge_cons...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 12 16:16:43 CDT 2013
Author: kmoore
Date: Fri Apr 12 16:16:40 2013
New Revision: 385523
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385523
Log:
Expose channel snapshot manager blob generation
These functions are already used in one branch (jrose's parking branch)
and will soon be used in other branches as well.
........
Merged revisions 385522 from http://svn.asterisk.org/svn/asterisk/trunk
Modified:
team/group/bridge_construction/ (props changed)
team/group/bridge_construction/include/asterisk/manager.h
team/group/bridge_construction/main/manager_channels.c
Propchange: team/group/bridge_construction/
------------------------------------------------------------------------------
--- bridge_construction-integrated (original)
+++ bridge_construction-integrated Fri Apr 12 16:16:40 2013
@@ -1,1 +1,1 @@
-/trunk:1-385474
+/trunk:1-385522
Modified: team/group/bridge_construction/include/asterisk/manager.h
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/include/asterisk/manager.h?view=diff&rev=385523&r1=385522&r2=385523
==============================================================================
--- team/group/bridge_construction/include/asterisk/manager.h (original)
+++ team/group/bridge_construction/include/asterisk/manager.h Fri Apr 12 16:16:40 2013
@@ -316,6 +316,37 @@
*/
struct ast_datastore *astman_datastore_find(struct mansession *s, const struct ast_datastore_info *info, const char *uid);
+/*! \brief Struct representing a snapshot of channel state */
+struct ast_channel_snapshot;
+
+/*!
+ * \brief Generate the AMI message body from a channel snapshot
+ * \since 12
+ *
+ * \param snapshot the channel snapshot for which to generate an AMI message
+ * body
+ * \param suffix the suffix to append to the channel fields
+ *
+ * \retval NULL on error
+ * \retval ast_str* on success (must be ast_freed by caller)
+ */
+struct ast_str *ast_manager_build_channel_state_string_suffix(
+ const struct ast_channel_snapshot *snapshot,
+ const char *suffix);
+
+/*!
+ * \brief Generate the AMI message body from a channel snapshot
+ * \since 12
+ *
+ * \param snapshot the channel snapshot for which to generate an AMI message
+ * body
+ *
+ * \retval NULL on error
+ * \retval ast_str* on success (must be ast_freed by caller)
+ */
+struct ast_str *ast_manager_build_channel_state_string(
+ const struct ast_channel_snapshot *snapshot);
+
/*! \brief Struct containing info for an AMI event to send out. */
struct ast_manager_event_blob {
int event_flags; /*!< Flags the event should be raised with. */
Modified: team/group/bridge_construction/main/manager_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/main/manager_channels.c?view=diff&rev=385523&r1=385522&r2=385523
==============================================================================
--- team/group/bridge_construction/main/manager_channels.c (original)
+++ team/group/bridge_construction/main/manager_channels.c Fri Apr 12 16:16:40 2013
@@ -232,18 +232,7 @@
</managerEvent>
***/
-/*!
- * \brief Generate the AMI message body from a channel snapshot
- * \internal
- *
- * \param snapshot the channel snapshot for which to generate an AMI message
- * body
- * \param suffix the suffix to append to the channel fields
- *
- * \retval NULL on error
- * \retval ast_str* on success (must be ast_freed by caller)
- */
-static struct ast_str *manager_build_channel_state_string_suffix(
+struct ast_str *ast_manager_build_channel_state_string_suffix(
const struct ast_channel_snapshot *snapshot,
const char *suffix)
{
@@ -294,20 +283,10 @@
return out;
}
-/*!
- * \brief Generate the AMI message body from a channel snapshot
- * \internal
- *
- * \param snapshot the channel snapshot for which to generate an AMI message
- * body
- *
- * \retval NULL on error
- * \retval ast_str* on success (must be ast_freed by caller)
- */
-static struct ast_str *manager_build_channel_state_string(
+struct ast_str *ast_manager_build_channel_state_string(
const struct ast_channel_snapshot *snapshot)
{
- return manager_build_channel_state_string_suffix(snapshot, "");
+ return ast_manager_build_channel_state_string_suffix(snapshot, "");
}
/*! \brief Typedef for callbacks that get called on channel snapshot updates */
@@ -488,7 +467,7 @@
/* If we haven't already, build the channel event string */
if (!channel_event_string) {
channel_event_string =
- manager_build_channel_state_string(new_snapshot);
+ ast_manager_build_channel_state_string(new_snapshot);
if (!channel_event_string) {
return;
}
@@ -507,7 +486,7 @@
const char *value = ast_json_string_get(ast_json_object_get(obj->blob, "value"));
if (obj->snapshot) {
- channel_event_string = manager_build_channel_state_string(obj->snapshot);
+ channel_event_string = ast_manager_build_channel_state_string(obj->snapshot);
} else {
channel_event_string = ast_str_create(35);
ast_str_set(&channel_event_string, 0,
@@ -549,7 +528,7 @@
eventname = ast_json_string_get(ast_json_object_get(obj->blob, "eventname"));
body = ast_json_string_get(ast_json_object_get(obj->blob, "body"));
- channel_event_string = manager_build_channel_state_string(obj->snapshot);
+ channel_event_string = ast_manager_build_channel_state_string(obj->snapshot);
if (!channel_event_string) {
return;
@@ -589,7 +568,7 @@
return;
}
- channel_event_string = manager_build_channel_state_string(obj->snapshot);
+ channel_event_string = ast_manager_build_channel_state_string(obj->snapshot);
if (!channel_event_string) {
return;
@@ -656,13 +635,13 @@
/* Peer is required - otherwise, who are we dialing? */
ast_assert(peer != NULL);
- peer_event_string = manager_build_channel_state_string_suffix(peer, "Dest");
+ peer_event_string = ast_manager_build_channel_state_string_suffix(peer, "Dest");
if (!peer_event_string) {
return;
}
if (caller) {
- caller_event_string = manager_build_channel_state_string(caller);
+ caller_event_string = ast_manager_build_channel_state_string(caller);
if (!caller_event_string) {
return;
}
More information about the asterisk-commits
mailing list