]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4066 --resolve pidf and its many varieties FTW
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 12 Apr 2012 14:35:02 +0000 (09:35 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 12 Apr 2012 14:35:09 +0000 (09:35 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index a736a5d64caf5c4fdb854a38c0fa112a9ce7bc3e..e7a25933537b1550bb57c1f2e7fe456fcb87b10a 100644 (file)
@@ -3880,16 +3880,24 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
                                open_closed = basic->txt;
                        }
 
-                       if ((person = switch_xml_child(xml, "dm:person")) && (note = switch_xml_child(person, "dm:note"))) {
-                               note_txt = note->txt;
+                       if ((person = switch_xml_child(xml, "dm:person"))) {
+                               if ((note = switch_xml_child(person, "dm:note"))) {
+                                       note_txt = note->txt;
+                               } else if ((note = switch_xml_child(person, "rpid:note"))) {
+                                       note_txt = note->txt;
+                               }
+                               if ((act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) {
+                                       if ((rpid = strchr(act->child->name, ':'))) {
+                                               rpid++;
+                                       } else {
+                                               rpid = act->child->name;
+                                       }
+                               }
+                               if (zstr(note_txt)) note_txt = rpid;
                        }
 
-                       if (person && (act = switch_xml_child(person, "rpid:activities")) && act->child && act->child->name) {
-                               if ((rpid = strchr(act->child->name, ':'))) {
-                                       rpid++;
-                               } else {
-                                       rpid = act->child->name;
-                               }
+                       if (!strcasecmp(open_closed, "closed")) {
+                               rpid = note_txt = "Unregistered";
                        }
 
                        if (sofia_test_pflag(profile, PFLAG_MULTIREG) && !open) {