aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/bridging.h61
-rw-r--r--include/asterisk/dsp.h5
-rw-r--r--include/asterisk/frame.h66
-rw-r--r--include/asterisk/logger.h2
-rw-r--r--include/asterisk/netsock2.h75
-rw-r--r--include/asterisk/pbx.h2
-rw-r--r--include/asterisk/res_fax.h7
7 files changed, 190 insertions, 28 deletions
diff --git a/include/asterisk/bridging.h b/include/asterisk/bridging.h
index 58f61d6fd..849f88741 100644
--- a/include/asterisk/bridging.h
+++ b/include/asterisk/bridging.h
@@ -167,12 +167,48 @@ struct ast_bridge_channel {
AST_LIST_ENTRY(ast_bridge_channel) entry;
};
+enum ast_bridge_video_mode_type {
+ /*! Video is not allowed in the bridge */
+ AST_BRIDGE_VIDEO_MODE_NONE = 0,
+ /*! A single user is picked as the only distributed of video across the bridge */
+ AST_BRIDGE_VIDEO_MODE_SINGLE_SRC,
+ /*! A single user's video feed is distributed to all bridge channels, but
+ * that feed is automatically picked based on who is talking the most. */
+ AST_BRIDGE_VIDEO_MODE_TALKER_SRC,
+};
+
+/*! This is used for both SINGLE_SRC mode to set what channel
+ * should be the current single video feed */
+struct ast_bridge_video_single_src_data {
+ /*! Only accept video coming from this channel */
+ struct ast_channel *chan_vsrc;
+};
+
+/*! This is used for both SINGLE_SRC_TALKER mode to set what channel
+ * should be the current single video feed */
+struct ast_bridge_video_talker_src_data {
+ /*! Only accept video coming from this channel */
+ struct ast_channel *chan_vsrc;
+ int average_talking_energy;
+};
+
+struct ast_bridge_video_mode {
+ enum ast_bridge_video_mode_type mode;
+ /* Add data for all the video modes here. */
+ union {
+ struct ast_bridge_video_single_src_data single_src_data;
+ struct ast_bridge_video_talker_src_data talker_src_data;
+ } mode_data;
+};
+
/*!
* \brief Structure that contains information about a bridge
*/
struct ast_bridge {
/*! Number of channels participating in the bridge */
int num;
+ /*! The video mode this bridge is using */
+ struct ast_bridge_video_mode video_mode;
/*! The internal sample rate this bridge is mixed at when multiple channels are being mixed.
* If this value is 0, the bridge technology may auto adjust the internal mixing rate. */
unsigned int internal_sample_rate;
@@ -475,6 +511,31 @@ void ast_bridge_set_internal_sample_rate(struct ast_bridge *bridge, unsigned int
*/
void ast_bridge_set_mixing_interval(struct ast_bridge *bridge, unsigned int mixing_interval);
+/*!
+ * \brief Set a bridge to feed a single video source to all participants.
+ */
+void ast_bridge_set_single_src_video_mode(struct ast_bridge *bridge, struct ast_channel *video_src_chan);
+
+/*!
+ * \brief Set the bridge to pick the strongest talker supporting
+ * video as the single source video feed
+ */
+void ast_bridge_set_talker_src_video_mode(struct ast_bridge *bridge);
+
+/*!
+ * \brief Update information about talker energy for talker src video mode.
+ */
+void ast_bridge_update_talker_src_video_mode(struct ast_bridge *bridge, struct ast_channel *chan, int talker_energy, int is_keyfame);
+
+/*!
+ * \brief Determine if a channel is a video src for the bridge
+ */
+int ast_bridge_is_video_src(struct ast_bridge *bridge, struct ast_channel *chan);
+
+/*!
+ * \brief remove a channel as a source of video for the bridge.
+ */
+void ast_bridge_remove_video_src(struct ast_bridge *bridge, struct ast_channel *chan);
#if defined(__cplusplus) || defined(c_plusplus)
}
diff --git a/include/asterisk/dsp.h b/include/asterisk/dsp.h
index 79e4da695..333415200 100644
--- a/include/asterisk/dsp.h
+++ b/include/asterisk/dsp.h
@@ -109,6 +109,11 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
number of seconds of silence */
int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence);
+/*! \brief Return non-zero if this is silence. Updates "totalsilence" with the total
+ number of seconds of silence. Returns the average energy of the samples in the frame
+ in frames_energy variable. */
+int ast_dsp_silence_with_energy(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence, int *frames_energy);
+
/*!
* \brief Return non-zero if this is noise. Updates "totalnoise" with the total
* number of seconds of noise
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 8189c648c..6e8c17779 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -334,45 +334,51 @@ enum ast_control_transfer {
#define AST_OPTION_FLAG_WTF 6
/*! Verify touchtones by muting audio transmission
- (and reception) and verify the tone is still present */
+ * (and reception) and verify the tone is still present
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_TONE_VERIFY 1
-/*! Put a compatible channel into TDD (TTY for the hearing-impared) mode */
+/*! Put a compatible channel into TDD (TTY for the hearing-impared) mode
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_TDD 2
-/*! Relax the parameters for DTMF reception (mainly for radio use) */
+/*! Relax the parameters for DTMF reception (mainly for radio use)
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_RELAXDTMF 3
-/*! Set (or clear) Audio (Not-Clear) Mode */
+/*! Set (or clear) Audio (Not-Clear) Mode
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_AUDIO_MODE 4
/*! Set channel transmit gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
+ * Option data is a single signed char representing number of decibels (dB)
+ * to set gain to (on top of any gain specified in channel driver) */
#define AST_OPTION_TXGAIN 5
/*! Set channel receive gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
+ * Option data is a single signed char representing number of decibels (dB)
+ * to set gain to (on top of any gain specified in channel driver) */
#define AST_OPTION_RXGAIN 6
-/* set channel into "Operator Services" mode */
+/* set channel into "Operator Services" mode
+ * Option data is a struct oprmode
+ *
+ * \note This option should never be sent over the network */
#define AST_OPTION_OPRMODE 7
-/*! Explicitly enable or disable echo cancelation for the given channel */
+/*! Explicitly enable or disable echo cancelation for the given channel
+ * Option data is a single signed char value 0 or 1
+ *
+ * \note This option appears to be unused in the code. It is handled, but never
+ * set or queried. */
#define AST_OPTION_ECHOCAN 8
/*! \brief Handle channel write data
* If a channel needs to process the data from a func_channel write operation
* after func_channel_write executes, it can define the setoption callback
* and process this option. A pointer to an ast_chan_write_info_t will be passed.
- * */
+ *
+ * \note This option should never be passed over the network. */
#define AST_OPTION_CHANNEL_WRITE 9
/* !
@@ -381,28 +387,38 @@ enum ast_control_transfer {
*/
#define AST_OPTION_T38_STATE 10
-/*! Request that the channel driver deliver frames in a specific format */
+/*! Request that the channel driver deliver frames in a specific format
+ * Option data is a format_t */
#define AST_OPTION_FORMAT_READ 11
-/*! Request that the channel driver be prepared to accept frames in a specific format */
+/*! Request that the channel driver be prepared to accept frames in a specific format
+ * Option data is a format_t */
#define AST_OPTION_FORMAT_WRITE 12
-/*! Request that the channel driver make two channels of the same tech type compatible if possible */
+/*! Request that the channel driver make two channels of the same tech type compatible if possible
+ * Option data is an ast_channel
+ *
+ * \note This option should never be passed over the network */
#define AST_OPTION_MAKE_COMPATIBLE 13
-/*! Get or set the digit detection state of the channel */
+/*! Get or set the digit detection state of the channel
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_DIGIT_DETECT 14
-/*! Get or set the fax tone detection state of the channel */
+/*! Get or set the fax tone detection state of the channel
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_FAX_DETECT 15
-/*! Get the device name from the channel */
+/*! Get the device name from the channel (Read only)
+ * Option data is a character buffer of suitable length */
#define AST_OPTION_DEVICE_NAME 16
-/*! Get the CC agent type from the channel */
+/*! Get the CC agent type from the channel (Read only)
+ * Option data is a character buffer of suitable length */
#define AST_OPTION_CC_AGENT_TYPE 17
-/*! Get or set the security options on a channel */
+/*! Get or set the security options on a channel
+ * Option data is an integer value of 0 or 1 */
#define AST_OPTION_SECURE_SIGNALING 18
#define AST_OPTION_SECURE_MEDIA 19
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index 322214e73..a2a28809f 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -181,7 +181,7 @@ void ast_console_toggle_loglevel(int fd, int level, int state);
#endif
#define AST_LOG_DTMF __LOG_DTMF, _A_
-#define NUMLOGLEVELS 6
+#define NUMLOGLEVELS 7
/*!
* \brief Get the debug level for a module
diff --git a/include/asterisk/netsock2.h b/include/asterisk/netsock2.h
index c5c08cf73..afb1ea90f 100644
--- a/include/asterisk/netsock2.h
+++ b/include/asterisk/netsock2.h
@@ -152,8 +152,13 @@ int ast_sockaddr_cmp_addr(const struct ast_sockaddr *a, const struct ast_sockadd
#define AST_SOCKADDR_STR_ADDR (1 << 0)
#define AST_SOCKADDR_STR_PORT (1 << 1)
#define AST_SOCKADDR_STR_BRACKETS (1 << 2)
-#define AST_SOCKADDR_STR_HOST AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_BRACKETS
-#define AST_SOCKADDR_STR_DEFAULT AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_PORT
+#define AST_SOCKADDR_STR_REMOTE (1 << 3)
+#define AST_SOCKADDR_STR_HOST (AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_BRACKETS)
+#define AST_SOCKADDR_STR_DEFAULT (AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_PORT)
+#define AST_SOCKADDR_STR_ADDR_REMOTE (AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_REMOTE)
+#define AST_SOCKADDR_STR_HOST_REMOTE (AST_SOCKADDR_STR_HOST | AST_SOCKADDR_STR_REMOTE)
+#define AST_SOCKADDR_STR_DEFAULT_REMOTE (AST_SOCKADDR_STR_DEFAULT | AST_SOCKADDR_STR_REMOTE)
+#define AST_SOCKADDR_STR_FORMAT_MASK (AST_SOCKADDR_STR_ADDR | AST_SOCKADDR_STR_PORT | AST_SOCKADDR_STR_BRACKETS)
/*!
* \since 1.8
@@ -203,6 +208,23 @@ static inline char *ast_sockaddr_stringify(const struct ast_sockaddr *addr)
* \since 1.8
*
* \brief
+ * Wrapper around ast_sockaddr_stringify_fmt() with default format
+ *
+ * \note This address will be suitable for passing to a remote machine via the
+ * application layer. For example, the scope-id on a link-local IPv6 address
+ * will be stripped.
+ *
+ * \return same as ast_sockaddr_stringify_fmt()
+ */
+static inline char *ast_sockaddr_stringify_remote(const struct ast_sockaddr *addr)
+{
+ return ast_sockaddr_stringify_fmt(addr, AST_SOCKADDR_STR_DEFAULT_REMOTE);
+}
+
+/*!
+ * \since 1.8
+ *
+ * \brief
* Wrapper around ast_sockaddr_stringify_fmt() to return an address only
*
* \return same as ast_sockaddr_stringify_fmt()
@@ -216,6 +238,23 @@ static inline char *ast_sockaddr_stringify_addr(const struct ast_sockaddr *addr)
* \since 1.8
*
* \brief
+ * Wrapper around ast_sockaddr_stringify_fmt() to return an address only
+ *
+ * \note This address will be suitable for passing to a remote machine via the
+ * application layer. For example, the scope-id on a link-local IPv6 address
+ * will be stripped.
+ *
+ * \return same as ast_sockaddr_stringify_fmt()
+ */
+static inline char *ast_sockaddr_stringify_addr_remote(const struct ast_sockaddr *addr)
+{
+ return ast_sockaddr_stringify_fmt(addr, AST_SOCKADDR_STR_ADDR_REMOTE);
+}
+
+/*!
+ * \since 1.8
+ *
+ * \brief
* Wrapper around ast_sockaddr_stringify_fmt() to return an address only,
* suitable for a URL (with brackets for IPv6).
*
@@ -230,6 +269,24 @@ static inline char *ast_sockaddr_stringify_host(const struct ast_sockaddr *addr)
* \since 1.8
*
* \brief
+ * Wrapper around ast_sockaddr_stringify_fmt() to return an address only,
+ * suitable for a URL (with brackets for IPv6).
+ *
+ * \note This address will be suitable for passing to a remote machine via the
+ * application layer. For example, the scope-id on a link-local IPv6 address
+ * will be stripped.
+ *
+ * \return same as ast_sockaddr_stringify_fmt()
+ */
+static inline char *ast_sockaddr_stringify_host_remote(const struct ast_sockaddr *addr)
+{
+ return ast_sockaddr_stringify_fmt(addr, AST_SOCKADDR_STR_HOST_REMOTE);
+}
+
+/*!
+ * \since 1.8
+ *
+ * \brief
* Wrapper around ast_sockaddr_stringify_fmt() to return a port only
*
* \return same as ast_sockaddr_stringify_fmt()
@@ -413,6 +470,20 @@ int ast_sockaddr_is_ipv4_multicast(const struct ast_sockaddr *addr);
* \since 1.8
*
* \brief
+ * Determine if this is a link-local IPv6 address
+ *
+ * \warning You should rarely need this function. Only use if you know what
+ * you're doing.
+ *
+ * \retval 1 This is a link-local IPv6 address.
+ * \retval 0 This is link-local IPv6 address.
+ */
+int ast_sockaddr_is_ipv6_link_local(const struct ast_sockaddr *addr);
+
+/*!
+ * \since 1.8
+ *
+ * \brief
* Determine if this is an IPv6 address
*
* \warning You should rarely need this function. Only use if you know what
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index 429e60537..1489ee2d6 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -877,6 +877,8 @@ int ast_context_unlockmacro(const char *macrocontext);
/*!
* \brief Set the channel to next execute the specified dialplan location.
* \see ast_async_parseable_goto, ast_async_goto_if_exists
+ *
+ * \note Do _NOT_ hold any channel locks when calling this function.
*/
int ast_async_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
diff --git a/include/asterisk/res_fax.h b/include/asterisk/res_fax.h
index 9a52115f0..5d2c903ff 100644
--- a/include/asterisk/res_fax.h
+++ b/include/asterisk/res_fax.h
@@ -42,6 +42,8 @@ enum ast_fax_capabilities {
AST_FAX_TECH_T38 = (1 << 3),
/*! sending mulitple documents supported */
AST_FAX_TECH_MULTI_DOC = (1 << 4),
+ /*! T.38 - T.30 Gateway */
+ AST_FAX_TECH_GATEWAY = (1 << 5),
};
/*! \brief fax modem capabilities */
@@ -168,6 +170,8 @@ struct ast_fax_session_details {
struct ast_fax_t38_parameters our_t38_parameters;
/*! the other endpoint's T.38 session parameters, if any */
struct ast_fax_t38_parameters their_t38_parameters;
+ /*! the id of the t.38 gateway framehook for this channel */
+ int gateway_id;
};
struct ast_fax_tech;
@@ -204,6 +208,9 @@ struct ast_fax_session {
struct ast_smoother *smoother;
};
+/* if this overlaps with any AST_FRFLAG_* values, problems will occur */
+#define AST_FAX_FRFLAG_GATEWAY (1 << 13)
+
/*! \brief used to register a FAX technology module with res_fax */
struct ast_fax_tech {
/*! the type of fax session supported with this ast_fax_tech structure */