summaryrefslogtreecommitdiff
path: root/res/res_pjsip_exten_state.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-08-22 17:42:37 +0000
committerMark Michelson <mmichelson@digium.com>2013-08-22 17:42:37 +0000
commit8049bf94f70edd405b59b4a2ed5aa8119fd9d62b (patch)
treef05decc2638c641eabdbf3beaac550f0cdc5b9a0 /res/res_pjsip_exten_state.c
parentae7fb07092e8c2f24e9a8cddc497106f5b05ce75 (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 'res/res_pjsip_exten_state.c')
-rw-r--r--res/res_pjsip_exten_state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip_exten_state.c b/res/res_pjsip_exten_state.c
index 483d78b4b..0144e1cbb 100644
--- a/res/res_pjsip_exten_state.c
+++ b/res/res_pjsip_exten_state.c
@@ -515,6 +515,8 @@ static void subscription_terminated(struct ast_sip_subscription *sub,
send_notify(exten_state_sub, NULL, PJSIP_EVSUB_STATE_TERMINATED);
}
+#define DEFAULT_PRESENCE_BODY "application/pidf+xml"
+
/*!
* \internal
* \brief Create and register a subscription handler.
@@ -534,6 +536,9 @@ static struct ast_sip_subscription_handler *create_and_register_handler(
handler->event_name = event_name;
handler->accept[0] = accept;
+ if (!strcmp(accept, DEFAULT_PRESENCE_BODY)) {
+ handler->handles_default_accept = 1;
+ }
handler->subscription_shutdown = subscription_shutdown;
handler->new_subscribe = new_subscribe;