summaryrefslogtreecommitdiff
path: root/include/asterisk/sdp_state.h
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-03-27 20:32:45 +0000
committerJoshua Colp <jcolp@digium.com>2017-03-30 18:26:10 +0000
commitf3290d6b664bd2b6ed840b7501666e26b341acb1 (patch)
tree7a796814363551c54ee07364265102b9a7b47243 /include/asterisk/sdp_state.h
parent3bdf876b045653c427df0a7a771e90dd15fa1527 (diff)
sdp: Add support for setting connection address and clean up state.
This change cleans up state management for media streams by moving RTP instances into their own session structure and adding additional details that are not relevant to the core (such as connection address). These can live either in the local capabilities or joint capabilities. The ability to set explicit connection address information for the purposes of direct media and NAT has also been added at the global and stream specific level. ASTERISK-26900 Change-Id: If7e5307239a9534420732de11c451a2705b6b681
Diffstat (limited to 'include/asterisk/sdp_state.h')
-rw-r--r--include/asterisk/sdp_state.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/include/asterisk/sdp_state.h b/include/asterisk/sdp_state.h
index e2f13eb61..a186d7eef 100644
--- a/include/asterisk/sdp_state.h
+++ b/include/asterisk/sdp_state.h
@@ -23,6 +23,7 @@
#include "asterisk/sdp_options.h"
struct ast_sdp_state;
+struct ast_sockaddr;
/*!
* \brief Allocate a new SDP state
@@ -51,6 +52,26 @@ struct ast_rtp_instance *ast_sdp_state_get_rtp_instance(const struct ast_sdp_sta
int stream_index);
/*!
+ * \brief Get the global connection address on the SDP state.
+ */
+const struct ast_sockaddr *ast_sdp_state_get_connection_address(const struct ast_sdp_state *sdp_state);
+
+/*!
+ * \brief Get the connection address for a particular stream.
+ *
+ * \param sdp_state
+ * \param stream_index The particular stream to get the connection address of
+ * \param address[out] A place to store the address in
+ *
+ * \retval 0 Success
+ *
+ * \note
+ * Stream numbers correspond to the streams in the topology of the associated channel
+ */
+int ast_sdp_state_get_stream_connection_address(const struct ast_sdp_state *sdp_state,
+ int stream_index, struct ast_sockaddr *address);
+
+/*!
* \brief Get the joint negotiated streams based on local and remote capabilities.
*
* If this is called prior to receiving a remote SDP, then this will just mirror
@@ -149,4 +170,69 @@ int ast_sdp_state_set_remote_sdp_from_impl(struct ast_sdp_state *sdp_state, void
*/
int ast_sdp_state_reset(struct ast_sdp_state *sdp_state);
+/*!
+ * \brief Update the local stream topology on the SDP state.
+ *
+ * \param sdp_state
+ * \param streams The new stream topology.
+ *
+ * \retval 0 Success
+ *
+ * \since 15
+ */
+int ast_sdp_state_update_local_topology(struct ast_sdp_state *sdp_state, struct ast_stream_topology *streams);
+
+/*!
+ * \brief Set the local address (IP address) to use for connection addresses
+ *
+ * \param sdp_state
+ * \param address The local address
+ *
+ * \note
+ * Passing NULL as an address will unset the explicit local connection address.
+ *
+ * \since 15
+ */
+void ast_sdp_state_set_local_address(struct ast_sdp_state *sdp_state, struct ast_sockaddr *address);
+
+/*!
+ * \brief Set the connection address (IP address and port) to use for a specific stream
+ *
+ * \param sdp_state
+ * \param stream_index The stream to set the connection address for
+ * \param address The connection address
+ *
+ * \retval 0 Success
+ *
+ * \note
+ * Passing NULL as an address will unset the explicit local connection address.
+ *
+ * \since 15
+ */
+int ast_sdp_state_set_connection_address(struct ast_sdp_state *sdp_state, int stream_index,
+ struct ast_sockaddr *address);
+
+/*!
+ * \since 15.0.0
+ * \brief Set a stream to be held or unheld
+ *
+ * \param sdp_state
+ * \param stream_index The stream to set the held value for
+ * \param locally_held
+ */
+void ast_sdp_state_set_locally_held(struct ast_sdp_state *sdp_state,
+ int stream_index, unsigned int locally_held);
+
+/*!
+ * \since 15.0.0
+ * \brief Get whether a stream is held or not
+ *
+ * \param sdp_state
+ * \param stream_index The stream to get the held state for
+ *
+ * \returns locally_held
+ */
+unsigned int ast_sdp_state_get_locally_held(const struct ast_sdp_state *sdp_state,
+ int stream_index);
+
#endif /* _ASTERISK_SDP_STATE_H */