]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak presence
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Aug 2010 00:51:10 +0000 (19:51 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Aug 2010 15:05:38 +0000 (10:05 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index c6c0ccaa2377d38fcc64c61708c3c5bb804fc7f0..0c938b9dedfb870ad254f443391d66a5c0f81476 100644 (file)
@@ -1348,17 +1348,23 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
                                astate = "confirmed";
                        }
 
-                       if (!strcasecmp(astate, "ringing")) {
-                               if (!strcasecmp(direction, "recipient")) {
-                                       astate = "early";
-                               } else {
-                                       astate = "confirmed";
-                               }
-                       }
                        if (is_dialog) {
+                               if (!strcasecmp(astate, "ringing")) {
+                                       if (!strcasecmp(direction, "recipient")) {
+                                               astate = "early";
+                                       } else {
+                                               astate = "confirmed";
+                                       }
+                               }
+
                                stream.write_function(&stream, "<dialog id=\"%s\" direction=\"%s\">\n", uuid, direction);
                                stream.write_function(&stream, "<state>%s</state>\n", astate);
+                       } else {
+                               if (!strcasecmp(astate, "ringing")) {
+                                       astate = "confirmed";
+                               }
                        }
+
                        if (!strcasecmp(astate, "early") || !strcasecmp(astate, "confirmed")) {
 
                                clean_to_user = switch_mprintf("%s", sub_to_user ? sub_to_user : to_user);