diff options
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/alertpipe.h | 3 | ||||
-rw-r--r-- | include/asterisk/autoconfig.h.in | 3 | ||||
-rw-r--r-- | include/asterisk/http_websocket.h | 9 | ||||
-rw-r--r-- | include/asterisk/options.h | 5 | ||||
-rw-r--r-- | include/asterisk/sorcery.h | 24 | ||||
-rw-r--r-- | include/asterisk/vector.h | 23 |
6 files changed, 65 insertions, 2 deletions
diff --git a/include/asterisk/alertpipe.h b/include/asterisk/alertpipe.h index 5ff854ce8..09c335829 100644 --- a/include/asterisk/alertpipe.h +++ b/include/asterisk/alertpipe.h @@ -65,7 +65,8 @@ ast_alert_status_t ast_alertpipe_read(int alert_pipe[2]); * * \param p a two-element array containing the alert pipe's file descriptors * - * \return see write(2) + * \retval 0 Success + * \retval 1 Failure */ ssize_t ast_alertpipe_write(int alert_pipe[2]); diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index cfa260b21..4700d4092 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -121,6 +121,9 @@ attribute. */ #undef HAVE_ATTRIBUTE_warn_unused_result +/* Define to 1 if you have the Beanstalk Job Queue library. */ +#undef HAVE_BEANSTALK + /* Define to 1 if you have the Debug symbol decoding library. */ #undef HAVE_BFD diff --git a/include/asterisk/http_websocket.h b/include/asterisk/http_websocket.h index cd49dbe48..2180ef46b 100644 --- a/include/asterisk/http_websocket.h +++ b/include/asterisk/http_websocket.h @@ -345,6 +345,15 @@ AST_OPTIONAL_API(int, ast_websocket_fd, (struct ast_websocket *session), { errno AST_OPTIONAL_API(struct ast_sockaddr *, ast_websocket_remote_address, (struct ast_websocket *session), {return NULL;}); /*! + * \brief Get the local address for a WebSocket connection session. + * + * \retval ast_sockaddr Local address + * + * \since 13.19.0 + */ +AST_OPTIONAL_API(struct ast_sockaddr *, ast_websocket_local_address, (struct ast_websocket *session), {return NULL;}); + +/*! * \brief Get whether the WebSocket session is using a secure transport or not. * * \retval 0 if unsecure diff --git a/include/asterisk/options.h b/include/asterisk/options.h index 0a20f10a8..878748d16 100644 --- a/include/asterisk/options.h +++ b/include/asterisk/options.h @@ -66,6 +66,8 @@ enum ast_option_flags { AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13), /*! Display timestamp in CLI verbose output */ AST_OPT_FLAG_TIMESTAMP = (1 << 14), + /*! Cache media frames for performance */ + AST_OPT_FLAG_CACHE_MEDIA_FRAMES = (1 << 15), /*! Reconnect */ AST_OPT_FLAG_RECONNECT = (1 << 16), /*! Transmit Silence during Record() and DTMF Generation */ @@ -99,7 +101,7 @@ enum ast_option_flags { }; /*! These are the options that set by default when Asterisk starts */ -#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN +#define AST_DEFAULT_OPTIONS (AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_CACHE_MEDIA_FRAMES) #define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES) #define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK) @@ -116,6 +118,7 @@ enum ast_option_flags { #define ast_opt_stdexten_macro ast_test_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO) #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE) #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES) +#define ast_opt_cache_media_frames ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_MEDIA_FRAMES) #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP) #define ast_opt_reconnect ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT) #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) diff --git a/include/asterisk/sorcery.h b/include/asterisk/sorcery.h index bfb2c39ad..bafca5fb6 100644 --- a/include/asterisk/sorcery.h +++ b/include/asterisk/sorcery.h @@ -298,6 +298,14 @@ struct ast_sorcery_wizard { /*! \brief Callback for retrieving multiple objects using a regex on their id */ void (*retrieve_regex)(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex); + /*! \brief Optional callback for retrieving multiple objects by matching their id with a prefix */ + void (*retrieve_prefix)(const struct ast_sorcery *sorcery, + void *data, + const char *type, + struct ao2_container *objects, + const char *prefix, + const size_t prefix_len); + /*! \brief Optional callback for retrieving an object using fields */ void *(*retrieve_fields)(const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields); @@ -1241,6 +1249,22 @@ void *ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const ch struct ao2_container *ast_sorcery_retrieve_by_regex(const struct ast_sorcery *sorcery, const char *type, const char *regex); /*! + * \brief Retrieve multiple objects whose id begins with the specified prefix + * \since 13.19.0 + * + * \param sorcery Pointer to a sorcery structure + * \param type Type of object to retrieve + * \param prefix Object id prefix + * \param prefix_len The length of prefix in bytes + * + * \retval non-NULL if error occurs + * \retval NULL success + * + * \note The prefix is matched in a case sensitive manner. + */ +struct ao2_container *ast_sorcery_retrieve_by_prefix(const struct ast_sorcery *sorcery, const char *type, const char *prefix, const size_t prefix_len); + +/*! * \brief Update an object * * \param sorcery Pointer to a sorcery structure diff --git a/include/asterisk/vector.h b/include/asterisk/vector.h index 68ce13065..8bd1cefef 100644 --- a/include/asterisk/vector.h +++ b/include/asterisk/vector.h @@ -51,6 +51,9 @@ /*! \brief Integer vector definition */ AST_VECTOR(ast_vector_int, int); +/*! \brief String vector definition */ +AST_VECTOR(ast_vector_string, char *); + /*! * \brief Define a vector structure with a read/write lock * @@ -91,6 +94,26 @@ AST_VECTOR(ast_vector_int, int); }) /*! + * \brief Steal the elements from a vector and reinitialize. + * + * \param vec Vector to operate on. + * + * This allows you to use vector.h to construct a list and use the + * data as a bare array. + * + * \note The stolen array must eventually be released using ast_free. + * + * \warning AST_VECTOR_SIZE and AST_VECTOR_MAX_SIZE are both reset + * to 0. If either are needed they must be saved to a local + * variable before stealing the elements. + */ +#define AST_VECTOR_STEAL_ELEMENTS(vec) ({ \ + typeof((vec)->elems) __elems = (vec)->elems; \ + AST_VECTOR_INIT((vec), 0); \ + (__elems); \ +}) + +/*! * \brief Initialize a vector with a read/write lock * * If \a size is 0, then no space will be allocated until the vector is |