aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-06 23:19:59 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-06 23:19:59 +0000
commit8984a1c13b41a70b3e1360a62fe31ccbdcfbac61 (patch)
treed68a2bdbfa1042fda7aed217f4d4fc9e29ab0864
parent0d94072d51da1a282230584ea308718feb2c3d4a (diff)
Merged revisions 58121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r58121 | murf | 2007-03-06 16:10:14 -0700 (Tue, 06 Mar 2007) | 9 lines Merged revisions 58115 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r58115 | murf | 2007-03-06 15:52:52 -0700 (Tue, 06 Mar 2007) | 1 line Fix for 9220: Eyebeam cannot renew subscriptions for presence info. Reason: re-SUBSCRIBE requests don't include Accept headers, which the rfc says are optional (to put it tersely), (it uses MAY), and luckily, the sip_pvt struct has the format info stored, so we simply leave it if the format is set, and the accept header null. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@58122 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8b44deb95..3b040363f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -15015,9 +15015,25 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
p->subscribed = CPIM_PIDF_XML; /* RFC 3863 format */
} else if (strstr(accept, "application/xpidf+xml")) {
p->subscribed = XPIDF_XML; /* Early pre-RFC 3863 format with MSN additions (Microsoft Messenger) */
+ } else if (ast_strlen_zero(accept)) {
+ if (p->subscribed == NONE) { /* if the subscribed field is not already set, and there is no accept header... */
+ transmit_response(p, "489 Bad Event", req);
+
+ ast_log(LOG_WARNING,"SUBSCRIBE failure: no Accept header: pvt: stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
+ p->stateid, p->laststate, p->dialogver, p->subscribecontext, p->subscribeuri);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ return 0;
+ }
+ /* if p->subscribed is non-zero, then accept is not obligatory; according to rfc 3265 section 3.1.3, at least.
+ so, we'll just let it ride, keeping the value from a previous subscription, and not abort the subscription */
} else {
/* Can't find a format for events that we know about */
- transmit_response(p, "489 Bad Event", req);
+ char mybuf[200];
+ snprintf(mybuf,sizeof(mybuf),"489 Bad Event (format %s)", accept);
+ transmit_response(p, mybuf, req);
+
+ ast_log(LOG_WARNING,"SUBSCRIBE failure: unrecognized format: '%s' pvt: subscribed: %d, stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
+ accept, (int)p->subscribed, p->stateid, p->laststate, p->dialogver, p->subscribecontext, p->subscribeuri);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return 0;
}