mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 07:48:14 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user