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
This commit is contained in:
Mark Michelson
2013-08-22 17:42:37 +00:00
parent ae7fb07092
commit 8049bf94f7
4 changed files with 39 additions and 12 deletions

View File

@@ -64,6 +64,7 @@ static int mwi_refresh_subscription(struct ast_sip_subscription *sub);
static struct ast_sip_subscription_handler mwi_handler = {
.event_name = "message-summary",
.accept = { "application/simple-message-summary", },
.handles_default_accept = 1,
.subscription_shutdown = mwi_subscription_shutdown,
.new_subscribe = mwi_new_subscribe,
.resubscribe = mwi_resubscribe,