diff options
author | Joshua Colp <jcolp@digium.com> | 2016-05-05 11:14:00 -0300 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-05-09 10:40:36 -0300 |
commit | d03e170ae7e9ac577a53a948548b1871d722a9f9 (patch) | |
tree | a279035a360af7c37bedd2e02cc88af5b71aec1d /include/asterisk | |
parent | 94cd351ec422287295c79658fb3d36f04b5966a5 (diff) |
res_pjsip_pubsub: Use common datastores container API.
This migrates res_pjsip_pubsub over to using the newly
introduce common datastores management API instead of using
its own implementations for both subscriptions and
publications.
As well the extension state data now provides a generic
datastores container instead of a subscription. This allows
the dialog-info+xml body generator to work for both
subscriptions and publications.
ASTERISK-25999 #close
Change-Id: I773f9e4f35092da0f653566736a8647e8cfebef1
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/res_pjsip_body_generator_types.h | 5 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_pubsub.h | 28 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip_body_generator_types.h b/include/asterisk/res_pjsip_body_generator_types.h index aab147238..f61534b10 100644 --- a/include/asterisk/res_pjsip_body_generator_types.h +++ b/include/asterisk/res_pjsip_body_generator_types.h @@ -21,6 +21,9 @@ #include "asterisk/pbx.h" +/*! \brief Forward declaration for ao2_container so full astobj2.h is not required */ +struct ao2_container; + /*! * \brief structure used for presence XML bodies * @@ -51,6 +54,8 @@ struct ast_sip_exten_state_data { char remote[PJSIP_MAX_URL_SIZE]; /*! Optional subscription */ struct ast_sip_subscription *sub; + /*! A datastores container to persist datastores */ + struct ao2_container *datastores; /*! Allocation pool */ pj_pool_t *pool; }; diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h index 4f9a7633a..cb51db31f 100644 --- a/include/asterisk/res_pjsip_pubsub.h +++ b/include/asterisk/res_pjsip_pubsub.h @@ -166,6 +166,20 @@ struct ast_datastore *ast_sip_publication_get_datastore(struct ast_sip_publicati void ast_sip_publication_remove_datastore(struct ast_sip_publication *publication, const char *name); /*! + * \brief Get the datastores container for a publication + * + * \param publication The publication to get the datastores container from + * + * \retval NULL datastores container not present + * \retval non-NULL datastores container + * + * \note The container is NOT returned with reference count bumped + * + * \since 14.0.0 + */ +struct ao2_container *ast_sip_publication_get_datastores(const struct ast_sip_publication *publication); + +/*! * \brief Opaque structure representing an RFC 3265 SIP subscription */ struct ast_sip_subscription; @@ -518,6 +532,20 @@ struct ast_datastore *ast_sip_subscription_get_datastore(struct ast_sip_subscrip void ast_sip_subscription_remove_datastore(struct ast_sip_subscription *subscription, const char *name); /*! + * \brief Get the datastores container for a subscription + * + * \param subscription The subscription to get the datastores container from + * + * \retval NULL datastores container not present + * \retval non-NULL datastores container + * + * \note The container is NOT returned with reference count bumped + * + * \since 14.0.0 + */ +struct ao2_container *ast_sip_subscription_get_datastores(const struct ast_sip_subscription *subscription); + +/*! * \brief Register a subscription handler * * \retval 0 Handler was registered successfully |