diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/astdb.h | 10 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_session.h | 2 | ||||
-rw-r--r-- | include/asterisk/utils.h | 40 |
3 files changed, 52 insertions, 0 deletions
diff --git a/include/asterisk/astdb.h b/include/asterisk/astdb.h index 8a870ae83..383864baf 100644 --- a/include/asterisk/astdb.h +++ b/include/asterisk/astdb.h @@ -83,6 +83,16 @@ int ast_db_deltree(const char *family, const char *keytree); */ struct ast_db_entry *ast_db_gettree(const char *family, const char *keytree); +/*! + * \brief Get a list of values with the given key prefix + * + * \param family The family to search under + * \param key_prefix The key prefix to search under + * + * \retval NULL An error occurred + */ +struct ast_db_entry *ast_db_gettree_by_prefix(const char *family, const char *key_prefix); + /*! \brief Free structure created by ast_db_gettree() */ void ast_db_freetree(struct ast_db_entry *entry); diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h index de6589abd..6d506a35b 100644 --- a/include/asterisk/res_pjsip_session.h +++ b/include/asterisk/res_pjsip_session.h @@ -211,6 +211,8 @@ struct ast_sip_session { unsigned int ended_while_deferred:1; /*! DTMF mode to use with this session, from endpoint but can change */ enum ast_sip_dtmf_mode dtmf; + /*! Initial incoming INVITE Request-URI. NULL otherwise. */ + pjsip_uri *request_uri; }; typedef int (*ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata); diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 0a12b1d8a..c6c34074e 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -1141,4 +1141,44 @@ int ast_compare_versions(const char *version1, const char *version2); */ int ast_check_ipv6(void); +enum ast_fd_flag_operation { + AST_FD_FLAG_SET, + AST_FD_FLAG_CLEAR, +}; + +/* + * \brief Set flags on the given file descriptor + * \since 13.19 + * + * If getting or setting flags of the given file descriptor fails, logs an + * error message. + * + * \param fd File descriptor to set flags on + * \param flags The flag(s) to set + * + * \return -1 on error + * \return 0 if successful + */ +#define ast_fd_set_flags(fd, flags) \ + __ast_fd_set_flags((fd), (flags), AST_FD_FLAG_SET, __FILE__, __LINE__, __PRETTY_FUNCTION__) + +/* + * \brief Clear flags on the given file descriptor + * \since 13.19 + * + * If getting or setting flags of the given file descriptor fails, logs an + * error message. + * + * \param fd File descriptor to clear flags on + * \param flags The flag(s) to clear + * + * \return -1 on error + * \return 0 if successful + */ +#define ast_fd_clear_flags(fd, flags) \ + __ast_fd_set_flags((fd), (flags), AST_FD_FLAG_CLEAR, __FILE__, __LINE__, __PRETTY_FUNCTION__) + +int __ast_fd_set_flags(int fd, int flags, enum ast_fd_flag_operation op, + const char *file, int lineno, const char *function); + #endif /* _ASTERISK_UTILS_H */ |