summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/channel.h20
-rw-r--r--include/asterisk/config.h11
-rw-r--r--include/asterisk/config_options.h24
-rw-r--r--include/asterisk/res_pjsip.h22
-rw-r--r--include/asterisk/res_pjsip_session.h21
-rw-r--r--include/asterisk/rtp_engine.h52
6 files changed, 150 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index cb2e0e6a4..f0fe5b212 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -2030,6 +2030,26 @@ struct ast_frame *ast_read_stream(struct ast_channel *chan);
struct ast_frame *ast_read_noaudio(struct ast_channel *chan);
/*!
+ * \brief Reads a frame, but does not filter to just the default streams,
+ * returning AST_FRAME_NULL frame if audio.
+ *
+ * \param chan channel to read a frame from
+ *
+ * \return Returns a frame, or NULL on error. If it returns NULL, you
+ * best just stop reading frames and assume the channel has been
+ * disconnected.
+ *
+ * \note This function will not perform any filtering and will return
+ * media frames from all streams on the channel. To determine which
+ * stream a frame originated from the stream_num on it can be
+ * examined.
+ *
+ * \note Audio is replaced with AST_FRAME_NULL to avoid
+ * transcode when the resulting audio is not necessary.
+ */
+struct ast_frame *ast_read_stream_noaudio(struct ast_channel *chan);
+
+/*!
* \brief Write a frame to a channel
* This function writes the given frame to the indicated channel.
* \param chan destination channel of the frame
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index f57966b0b..1addfa317 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -1086,6 +1086,11 @@ enum ast_parse_flags {
PARSE_UINT16 = 0x0005,
#endif
+ /* Returns an int processed by ast_app_parse_timelen.
+ * The first argument is an enum ast_timelen value (required).
+ */
+ PARSE_TIMELEN = 0x0006,
+
/* Returns a struct ast_sockaddr, with optional default value
* (passed by reference) and port handling (accept, ignore,
* require, forbid). The format is 'ipaddress[:port]'. IPv6 address
@@ -1152,6 +1157,12 @@ enum ast_parse_flags {
* returns 1, b unchanged
* ast_parse_arg("12", PARSE_UINT32|PARSE_IN_RANGE|PARSE_RANGE_DEFAULTS, &a, 1, 10);
* returns 1, a = 10
+ * ast_parse_arg("223", PARSE_TIMELEN|PARSE_IN_RANGE, &a, TIMELEN_SECONDS, -1000, 1000);
+ * returns 0, a = 1000
+ * ast_parse_arg("223", PARSE_TIMELEN|PARSE_IN_RANGE, &a, TIMELEN_SECONDS, -1000, 250000);
+ * returns 0, a = 223000
+ * ast_parse_arg("223", PARSE_TIMELEN|PARSE_IN_RANGE|PARSE_DEFAULT, &a, TIMELEN_SECONDS, 9999, -1000, 250000);
+ * returns 0, a = 9999
* ast_parse_arg("www.foo.biz:44", PARSE_INADDR, &sa);
* returns 0, sa contains address and port
* ast_parse_arg("www.foo.biz", PARSE_INADDR|PARSE_PORT_REQUIRE, &sa);
diff --git a/include/asterisk/config_options.h b/include/asterisk/config_options.h
index f2a457eb5..f4c3db188 100644
--- a/include/asterisk/config_options.h
+++ b/include/asterisk/config_options.h
@@ -468,6 +468,30 @@ enum aco_option_type {
*/
OPT_YESNO_T,
+ /*! \brief Type for default option handler for time length signed integers
+ *
+ * \note aco_option_register flags:
+ * See flags available for use with the PARSE_TIMELEN type for the ast_parse_arg function
+ * aco_option_register varargs:
+ * FLDSET macro with the field of type int
+ * The remaining varargs for should be arguments compatible with the varargs for the
+ * ast_parse_arg function with the PARSE_TIMELEN type and the flags passed in the
+ * aco_option_register flags parameter.
+ *
+ * \note In most situations, it is preferable to not pass the PARSE_DEFAULT flag. If a config
+ * contains an invalid value, it is better to let the config loading fail with warnings so that
+ * the problem is fixed by the administrator.
+ *
+ * Example:
+ * struct test_item {
+ * int timelen;
+ * };
+ * {code}
+ * aco_option_register(&cfg_info, "timelen", ACO_EXACT, my_types, "3", OPT_TIMELEN_T, PARSE_IN_RANGE, FLDSET(struct test_item, intopt), TIMELEN_MILLISECONDS, -10, 10);
+ * {endcode}
+ */
+ OPT_TIMELEN_T,
+
};
/*! \brief A callback function for handling a particular option
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h
index 2cd27d37f..cf366cbab 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -688,6 +688,10 @@ struct ast_sip_endpoint_media_configuration {
unsigned int max_audio_streams;
/*! Maximum number of video streams to offer/accept */
unsigned int max_video_streams;
+ /*! Use BUNDLE */
+ unsigned int bundle;
+ /*! Enable webrtc settings and defaults */
+ unsigned int webrtc;
};
/*!
@@ -2059,6 +2063,24 @@ int ast_sip_append_body(pjsip_tx_data *tdata, const char *body_text);
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size);
/*!
+ * \brief Create and copy a pj_str_t into a standard character buffer.
+ *
+ * pj_str_t is not NULL-terminated. Any place that expects a NULL-
+ * terminated string needs to have the pj_str_t copied into a separate
+ * buffer.
+ *
+ * Copies the pj_str_t contents into a newly allocated buffer pointed to
+ * by dest. NULL-terminates the buffer.
+ *
+ * \note Caller is responsible for freeing the allocated memory.
+ *
+ * \param dest [out] The destination buffer
+ * \param src The pj_str_t to copy
+ * \retval Number of characters copied or negative value on error
+ */
+int ast_copy_pj_str2(char **dest, const pj_str_t *src);
+
+/*!
* \brief Get the looked-up endpoint on an out-of dialog request or response
*
* The function may ONLY be called on out-of-dialog requests or responses. For
diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h
index e298e1f32..eae11af43 100644
--- a/include/asterisk/res_pjsip_session.h
+++ b/include/asterisk/res_pjsip_session.h
@@ -99,6 +99,14 @@ struct ast_sip_session_media {
ast_sip_session_media_write_cb write_callback;
/*! \brief The stream number to place into any resulting frames */
int stream_num;
+ /*! \brief Media identifier for this stream (may be shared across multiple streams) */
+ char *mid;
+ /*! \brief The bundle group the stream belongs to */
+ int bundle_group;
+ /*! \brief Whether this stream is currently bundled or not */
+ unsigned int bundled;
+ /*! \brief RTP/Media streams association identifier */
+ char *msid;
};
/*!
@@ -833,6 +841,19 @@ int ast_sip_session_media_add_read_callback(struct ast_sip_session *session, str
int ast_sip_session_media_set_write_callback(struct ast_sip_session *session, struct ast_sip_session_media *session_media,
ast_sip_session_media_write_cb callback);
+/*!
+ * \brief Retrieve the underlying media session that is acting as transport for a media session
+ * \since 15.0.0
+ *
+ * \param session The session
+ * \param session_media The media session to retrieve the transport for
+ *
+ * \note This operates on the pending media state
+ *
+ * \note This function is guaranteed to return non-NULL
+ */
+struct ast_sip_session_media *ast_sip_session_media_get_transport(struct ast_sip_session *session, struct ast_sip_session_media *session_media);
+
/*! \brief Determines whether the res_pjsip_session module is loaded */
#define CHECK_PJSIP_SESSION_MODULE_LOADED() \
do { \
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 36f499b50..d030bdb19 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -603,6 +603,12 @@ struct ast_rtp_engine {
unsigned int (*ssrc_get)(struct ast_rtp_instance *instance);
/*! Callback to retrieve RTCP SDES CNAME */
const char *(*cname_get)(struct ast_rtp_instance *instance);
+ /*! Callback to bundle an RTP instance to another */
+ int (*bundle)(struct ast_rtp_instance *child, struct ast_rtp_instance *parent);
+ /*! Callback to set remote SSRC information */
+ void (*set_remote_ssrc)(struct ast_rtp_instance *instance, unsigned int ssrc);
+ /*! Callback to set the stream identifier */
+ void (*set_stream_num)(struct ast_rtp_instance *instance, int stream_num);
/*! Callback to pointer for optional ICE support */
struct ast_rtp_engine_ice *ice;
/*! Callback to pointer for optional DTLS SRTP support */
@@ -1512,6 +1518,20 @@ void ast_rtp_codecs_payload_formats(struct ast_rtp_codecs *codecs, struct ast_fo
int ast_rtp_codecs_payload_code(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code);
/*!
+ * \brief Set a payload code for use with a specific Asterisk format
+ *
+ * \param codecs Codecs structure to manipulate
+ * \param code The payload code
+ * \param format Asterisk format
+ *
+ * \retval 0 Payload was set to the given format
+ * \retval -1 Payload was in use or could not be set
+ *
+ * \since 15.0.0
+ */
+int ast_rtp_codecs_payload_set_rx(struct ast_rtp_codecs *codecs, int code, struct ast_format *format);
+
+/*!
* \brief Retrieve a tx mapped payload type based on whether it is an Asterisk format and the code
* \since 14.0.0
*
@@ -2271,6 +2291,8 @@ int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level);
*
* \retval 0 Success
* \retval non-zero Failure
+ *
+ * \note If no remote policy is provided any existing SRTP policies are left and the new local policy is added
*/
int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy* remote_policy, struct ast_srtp_policy *local_policy, int rtcp);
@@ -2416,6 +2438,36 @@ unsigned int ast_rtp_instance_get_ssrc(struct ast_rtp_instance *rtp);
*/
const char *ast_rtp_instance_get_cname(struct ast_rtp_instance *rtp);
+/*!
+ * \brief Request that an RTP instance be bundled with another
+ * \since 15.0.0
+ *
+ * \param child The child RTP instance
+ * \param parent The parent RTP instance the child should be bundled with
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_rtp_instance_bundle(struct ast_rtp_instance *child, struct ast_rtp_instance *parent);
+
+/*!
+ * \brief Set the remote SSRC for an RTP instance
+ * \since 15.0.0
+ *
+ * \param rtp The RTP instance
+ * \param ssrc The remote SSRC
+ */
+void ast_rtp_instance_set_remote_ssrc(struct ast_rtp_instance *rtp, unsigned int ssrc);
+
+/*!
+ * \brief Set the stream number for an RTP instance
+ * \since 15.0.0
+ *
+ * \param rtp The RTP instance
+ * \param stream_num The stream identifier number
+ */
+void ast_rtp_instance_set_stream_num(struct ast_rtp_instance *instance, int stream_num);
+
/*! \addtogroup StasisTopicsAndMessages
* @{
*/