mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Merge "sdp: Add support for setting connection address and clean up state."
This commit is contained in:
@@ -395,20 +395,20 @@ struct ast_sdp_a_line *ast_sdp_get_a(const struct ast_sdp *sdp, int index);
|
||||
int ast_sdp_add_m(struct ast_sdp *sdp, struct ast_sdp_m_line *m_line);
|
||||
|
||||
/*!
|
||||
* \brief Add a Media Description to an SDP
|
||||
* \brief Add an RTP Media Description to an SDP
|
||||
*
|
||||
* \param sdp SDP
|
||||
* \param sdp_state SDP state information
|
||||
* \param options SDP Options
|
||||
* \param rtp ast_rtp_instance
|
||||
* \param stream stream
|
||||
* \param stream_index stream
|
||||
*
|
||||
* \retval 0 Success
|
||||
* \retval non-0 Failure
|
||||
*
|
||||
* \since 15
|
||||
*/
|
||||
int ast_sdp_add_m_from_stream(struct ast_sdp *sdp, const struct ast_sdp_options *options,
|
||||
struct ast_rtp_instance *rtp, const struct ast_stream *stream);
|
||||
int ast_sdp_add_m_from_rtp_stream(struct ast_sdp *sdp, const struct ast_sdp_state *sdp_state,
|
||||
const struct ast_sdp_options *options, int stream_index);
|
||||
|
||||
/*!
|
||||
* \brief Get the count of Media Descriptions on an SDP
|
||||
|
||||
@@ -268,26 +268,6 @@ void ast_sdp_options_set_g726_non_standard(struct ast_sdp_options *options,
|
||||
*/
|
||||
unsigned int ast_sdp_options_get_g726_non_standard(struct ast_sdp_options *options);
|
||||
|
||||
/*!
|
||||
* \since 15.0.0
|
||||
* \brief Set SDP Options locally_held
|
||||
*
|
||||
* \param options SDP Options
|
||||
* \param locally_held
|
||||
*/
|
||||
void ast_sdp_options_set_locally_held(struct ast_sdp_options *options,
|
||||
unsigned int locally_held);
|
||||
|
||||
/*!
|
||||
* \since 15.0.0
|
||||
* \brief Get SDP Options locally_held
|
||||
*
|
||||
* \param options SDP Options
|
||||
*
|
||||
* \returns locally_held
|
||||
*/
|
||||
unsigned int ast_sdp_options_get_locally_held(struct ast_sdp_options *options);
|
||||
|
||||
/*!
|
||||
* \since 15.0.0
|
||||
* \brief Set SDP Options tos_audio
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "asterisk/sdp_options.h"
|
||||
|
||||
struct ast_sdp_state;
|
||||
struct ast_sockaddr;
|
||||
|
||||
/*!
|
||||
* \brief Allocate a new SDP state
|
||||
@@ -50,6 +51,26 @@ void ast_sdp_state_free(struct ast_sdp_state *sdp_state);
|
||||
struct ast_rtp_instance *ast_sdp_state_get_rtp_instance(const struct ast_sdp_state *sdp_state,
|
||||
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.
|
||||
*
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user