summaryrefslogtreecommitdiff
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-03-07 11:22:18 +0000
committerJoshua Colp <jcolp@digium.com>2017-03-07 12:08:51 +0000
commit3ed05badb9f6ce3c3a3848b56c0747334624e0c3 (patch)
tree91a2893ebefae4fa7b5ccc93d68e9a108b375678 /include/asterisk/channel.h
parentc9296b23d1574332ccbc83f3fc7ba492cfc34cfe (diff)
core: Add stream topology changing primitives with tests.
This change adds a few things to facilitate stream topology changing: 1. Control frame types have been added for use by the channel driver to notify the application that the channel wants to change the stream topology or that a stream topology change has been accepted. They are also used by the indicate interface to the channel that the application uses to indicate it wants to do the same. 2. Legacy behavior has been adopted in ast_read() such that if a channel requests a stream topology change it is denied automatically and the current stream topology is preserved if the application is not capable of handling streams. Tests have also been written which confirm the multistream and non-multistream behavior. ASTERISK-26839 Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r--include/asterisk/channel.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 3ae1e2fd4..9a3a967e2 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -4850,4 +4850,41 @@ struct ast_stream *ast_channel_get_default_stream(struct ast_channel *chan, enum
*/
int ast_channel_is_multistream(struct ast_channel *chan);
+/*!
+ * \brief Request that the stream topology of a channel change
+ *
+ * \param chan The channel to change
+ * \param topology The new stream topology
+ *
+ * \pre chan is locked
+ *
+ * \retval 0 request has been accepted to be attempted
+ * \retval -1 request could not be attempted
+ *
+ * \note This function initiates an asynchronous request to change the stream topology. It is not
+ * guaranteed that the topology will change and until an AST_CONTROL_STREAM_TOPOLOGY_CHANGED
+ * frame is received from the channel the current handler of the channel must tolerate the
+ * stream topology as it currently exists.
+ *
+ * \note This interface is provided for applications and resources to request that the topology change.
+ * It is not for use by the channel driver itself.
+ */
+int ast_channel_request_stream_topology_change(struct ast_channel *chan, struct ast_stream_topology *topology);
+
+/*!
+ * \brief Provide notice to a channel that the stream topology has changed
+ *
+ * \param chan The channel to provide notice to
+ * \param topology The new stream topology
+ *
+ * \pre chan is locked
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ *
+ * \note This interface is provided for applications and resources to accept a topology change.
+ * It is not for use by the channel driver itself.
+ */
+int ast_channel_stream_topology_changed(struct ast_channel *chan, struct ast_stream_topology *topology);
+
#endif /* _ASTERISK_CHANNEL_H */