diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/_private.h | 1 | ||||
-rw-r--r-- | include/asterisk/dns.h | 66 | ||||
-rw-r--r-- | include/asterisk/module.h | 18 | ||||
-rw-r--r-- | include/asterisk/res_pjsip.h | 9 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_presence_xml.h | 9 |
5 files changed, 89 insertions, 14 deletions
diff --git a/include/asterisk/_private.h b/include/asterisk/_private.h index d49de1789..2966f8787 100644 --- a/include/asterisk/_private.h +++ b/include/asterisk/_private.h @@ -29,6 +29,7 @@ int ast_cli_perms_init(int reload); /*!< Provided by cli.c */ int dnsmgr_init(void); /*!< Provided by dnsmgr.c */ void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */ int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */ +int ast_dns_system_resolver_init(void); /*!< Provided by dns_system_resolver.c */ void threadstorage_init(void); /*!< Provided by threadstorage.c */ int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */ int astobj2_init(void); /*!< Provided by astobj2.c */ diff --git a/include/asterisk/dns.h b/include/asterisk/dns.h index 4899fa8b4..c193a22aa 100644 --- a/include/asterisk/dns.h +++ b/include/asterisk/dns.h @@ -24,17 +24,63 @@ #ifndef _ASTERISK_DNS_H #define _ASTERISK_DNS_H -/*! \brief Perform DNS lookup (used by DNS, enum and SRV lookups) - \param context - \param dname Domain name to lookup (host, SRV domain, TXT record name) - \param class Record Class (see "man res_search") - \param type Record type (see "man res_search") - \param callback Callback function for handling DNS result - \note Asterisk DNS is synchronus at this time. This means that if your DNS - services does not work, Asterisk may lock while waiting for response. -*/ +/*! \brief DNS search return values */ +enum ast_dns_search_result { + AST_DNS_SEARCH_FAILURE = -1, /*!< DNS search resulted in failure */ + AST_DNS_SEARCH_NO_RECORDS = 0, /*!< DNS search yielded no results */ + AST_DNS_SEARCH_SUCCESS = 1 /*!< DNS search yielded at least one discovered record */ +}; + +/*! + * \brief Perform DNS lookup (used by DNS, enum and SRV lookups) + * + * \param context Void pointer containing data to use in the callback function. + * \param dname Domain name to lookup (host, SRV domain, TXT record name). + * \param class Record Class (see "man res_search"). + * \param type Record type (see "man res_search"). + * \param answer The full DNS response. + * \param len The length of the full DNS response. + * \param callback Callback function for handling the discovered resource records from + * the DNS search. + * + * \retval -1 on search failure + * \retval 0 on no records found + * \retval 1 on success + * + * \note Asterisk DNS is synchronus at this time. This means that if your DNS + * service does not work, Asterisk may lock while waiting for a response. + */ int ast_search_dns(void *context, const char *dname, int class, int type, - int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer)); + int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer)); + +/*! + * \brief Extended version of the DNS search function. + * + * \details Performs a DNS lookup, (used by DNS, enum and SRV lookups), parses the + * results and notifies the observer with the response and discovered records + * via invoking the provided callbacks (used by ast_dns_system_resolver). + * + * \param context Void pointer containing data to use in the handler functions. + * \param dname Domain name to lookup (host, SRV domain, TXT record name). + * \param rr_class Record Class (see "man res_search"). + * \param rr_type Record type (see "man res_search"). + * \param response_handler Callback function for handling the DNS response. Invoked upon + * completion of the DNS search. + * \param record_handler Callback function for handling the discovered resource + * records from the DNS search. Invoked n times, where n is the + * number of records discovered while parsing the DNS + * response. + * + * \retval AST_DNS_SEARCH_FAILURE on search failure + * \retval AST_DNS_SEARCH_NO_RECORDS on no records found + * \retval AST_DNS_SEARCH_SUCCESS on success + * + * \note Asterisk DNS is synchronus at this time. This means that if your DNS + * service does not work, Asterisk may lock while waiting for a response. + */ +enum ast_dns_search_result ast_search_dns_ex(void *context, const char *dname, int rr_class, int rr_type, + int (*response_handler)(void *context, unsigned char *dns_response, int dns_response_len, int rcode), + int (*record_handler)(void *context, unsigned char *record, int record_len, int ttl)); /*! \brief Retrieve the configured nameservers of the system */ struct ao2_container *ast_dns_get_nameservers(void); diff --git a/include/asterisk/module.h b/include/asterisk/module.h index f42749146..59e6c7ed5 100644 --- a/include/asterisk/module.h +++ b/include/asterisk/module.h @@ -161,6 +161,24 @@ int ast_update_module_list(int (*modentry)(const char *module, const char *descr const char *like); /*! + * \brief Ask for a list of modules, descriptions, use counts and status. + * \param modentry A callback to an updater function + * \param like + * \param data Data passed into the callback for manipulation + * + * For each of the modules loaded, modentry will be executed with the resource, + * description, and usecount values of each particular module. + * + * \return the number of modules loaded + * \since 13.5.0 + */ +int ast_update_module_list_data(int (*modentry)(const char *module, const char *description, + int usecnt, const char *status, const char *like, + enum ast_module_support_level support_level, + void *data), + const char *like, void *data); + +/*! * \brief Check if module with the name given is loaded * \param name Module name, like "chan_sip.so" * \retval 1 if true diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index 9475d6d22..f199b8fef 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -2044,4 +2044,13 @@ unsigned int ast_sip_get_max_initial_qualify_time(void); const char *ast_sip_get_contact_status_label(const enum ast_sip_contact_status_type status); const char *ast_sip_get_contact_short_status_label(const enum ast_sip_contact_status_type status); +/*! + * \brief Set a request to use the next value in the list of resolved addresses. + * + * \param tdata the tx data from the original request + * \retval 0 No more addresses to try + * \retval 1 The request was successfully re-intialized + */ +int ast_sip_failover_request(pjsip_tx_data *tdata); + #endif /* _RES_PJSIP_H */ diff --git a/include/asterisk/res_pjsip_presence_xml.h b/include/asterisk/res_pjsip_presence_xml.h index add5f8918..deed0901e 100644 --- a/include/asterisk/res_pjsip_presence_xml.h +++ b/include/asterisk/res_pjsip_presence_xml.h @@ -17,14 +17,15 @@ */ /*! - * \brief The length of the XML prolog when printing - * presence or other XML in PJSIP. + * \brief Length of the XML prolog when printing presence or other XML in PJSIP. * * When calling any variant of pj_xml_print(), the documentation * claims that it will return -1 if the provided buffer is not * large enough. However, if the XML prolog is requested to be - * printed, then the length of the XML prolog is returned upon - * failure instead of -1. + * printed and the buffer is not large enough, then it will + * return -1 only if the buffer is not large enough to hold the + * XML prolog or return the length of the XML prolog on failure + * instead of -1. * * This constant is useful to check against when trying to determine * if printing XML succeeded or failed. |