diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-08-22 17:42:37 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-08-22 17:42:37 +0000 |
commit | 8049bf94f70edd405b59b4a2ed5aa8119fd9d62b (patch) | |
tree | f05decc2638c641eabdbf3beaac550f0cdc5b9a0 /include | |
parent | ae7fb07092e8c2f24e9a8cddc497106f5b05ce75 (diff) |
Handle default body types for SIP event packages in res_pjsip_pubsub
Prior to this change, we would reject SUBSCRIBE requests that had no Accept
headers. Now event package handlers that handle the default type for the
event package indicate that they do so. Therefore, if we have a handler that
can handle the default type, we can allow SUBSCRIBEs for the handler's event
package that have no Accept headers.
(closes issue ASTERISK-22067)
reported by Mark Michelson
Review: https://reviewboard.asterisk.org/r/2774
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/res_pjsip_pubsub.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h index f6c6e4109..d985b9019 100644 --- a/include/asterisk/res_pjsip_pubsub.h +++ b/include/asterisk/res_pjsip_pubsub.h @@ -228,7 +228,21 @@ struct ast_sip_subscription_handler { const char *event_name; /*! The types of body this handler accepts */ const char *accept[AST_SIP_MAX_ACCEPT]; - + /*! + * \brief Indicates if this handler can be used as a default handler for an event type. + * + * Typically, a SUBSCRIBE request will contain one or more Accept headers that tell + * what format they expect the body of NOTIFY requests to use. However, every event + * package is required to define a default body format type to be used if a SUBSCRIBE + * request for the event contains no Accept header. + * + * If this value is non-zero, then this handler provides the default body format for + * the event package and can handle SUBSCRIBES with no Accept headers present. + * If this value is zero, then this handler provides an alternative body format + * from the default for the event package and cannot handle SUBSCRIBEs with no + * Accept header. + */ + unsigned int handles_default_accept; /*! * \brief Called when a subscription is to be destroyed * |