]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make Polycom subscription type override check more explicit.
authorRussell Bryant <russell@russellbryant.com>
Mon, 22 Jun 2009 16:00:00 +0000 (16:00 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 22 Jun 2009 16:00:00 +0000 (16:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202414 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index cb65b2c66514b42c09c51ba69fed19f4d265be02..a1e6279319ef5c4b8014c8d1eb85625949707955 100644 (file)
@@ -15821,16 +15821,20 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                make_our_tag(p->tag, sizeof(p->tag));
 
        if (!strcmp(event, "presence") || !strcmp(event, "dialog")) { /* Presence, RFC 3842 */
+               unsigned int pidf_xml;
+
                if (authpeer)   /* No need for authpeer here */
                        ASTOBJ_UNREF(authpeer, sip_destroy_peer);
 
                /* Header from Xten Eye-beam Accept: multipart/related, application/rlmi+xml, application/pidf+xml, application/xpidf+xml */
-               /* Polycom phones only handle xpidf+xml, even if they say they can
-                  handle pidf+xml as well
-               */
-               if (strstr(p->useragent, "Polycom")) {
+
+               pidf_xml = strstr(accept, "application/pidf+xml") ? 1 : 0;
+
+               /* Older versions of Polycom firmware will claim pidf+xml, but really
+                * they only support xpidf+xml. */
+               if (pidf_xml && strstr(p->useragent, "Polycom")) {
                        p->subscribed = XPIDF_XML;
-               } else if (strstr(accept, "application/pidf+xml")) {
+               } else if (pidf_xml) {
                        p->subscribed = PIDF_XML;         /* RFC 3863 format */
                } else if (strstr(accept, "application/dialog-info+xml")) {
                        p->subscribed = DIALOG_INFO_XML;