]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_sofia: Add a quick fix for basic Polycom presence support. A more sane solution...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 21 Aug 2010 03:40:37 +0000 (23:40 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 21 Aug 2010 03:40:37 +0000 (23:40 -0400)
src/mod/endpoints/mod_sofia/sofia_presence.c

index f68c8df1916b493911de23c8134d65e43a6d4a23..1ff420d9bf5f3c0f09e84425c5d943082f8bf826 100644 (file)
@@ -1064,11 +1064,17 @@ static char *gen_pidf(char *user_agent, char *id, char *url, char *open, char *r
        if (switch_stristr("polycom", user_agent)) {
                *ct = "application/xpidf+xml";
 
-               /* of course!, lets make a big deal over dashes. Now the stupidity is complete. */
+               /* If unknown/none prpid is provided, just show the user as online. */
                if (!prpid) {
-                       prpid = "unknown";
+                       prpid = "online";
+               }
+
+               /* FS currently send prpid closed on register, this force it to online */
+               if (!strncasecmp(status, "Registered", 10) && !strcasecmp(prpid, "closed")) {
+                       prpid = "online";
                }
 
+               /* of course!, lets make a big deal over dashes. Now the stupidity is complete. */
                if (!strcmp(prpid, "on-the-phone")) {
                        prpid = "onthephone";
                }