From 0b5292525cce32e9944b02b17748c4c7ec89ede3 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 26 Apr 2016 16:10:26 -0500 Subject: res_pjsip_exten_state: Check if body generator is available. When starting the extension state publishers, check if the requested message body generator is available. If not available give error message and skip starting that publisher. * res_pjsip_pubsub.c: Create new API if type/subtype generator registered. * res_pjsip_exten_state.c: Use new body generator API for validation. ASTERISK-25922 Change-Id: I4ad69200666e3cc909d4619e3c81042d7f9db25c --- include/asterisk/res_pjsip_pubsub.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/asterisk/res_pjsip_pubsub.h') diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h index 84d86fb9e..72a3053f2 100644 --- a/include/asterisk/res_pjsip_pubsub.h +++ b/include/asterisk/res_pjsip_pubsub.h @@ -648,6 +648,19 @@ struct ast_sip_pubsub_body_supplement { int ast_sip_pubsub_generate_body_content(const char *content_type, const char *content_subtype, struct ast_sip_body_data *data, struct ast_str **str); +/*! + * \brief Is a body generator registered for the given type/subtype. + * \since 14.0.0 + * + * \param type The content type of the body + * \param subtype The content subtype of the body + * + * \note In "plain/text", "plain" is the type and "text" is the subtype. + * + * \retval non-zero if a generator is registered. + */ +int ast_sip_pubsub_is_body_generator_registered(const char *type, const char *subtype); + /*! * \since 13.0.0 * \brief Register a body generator with the pubsub core. -- cgit v1.2.3