]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
reduce events on many to many sla
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 2 May 2012 05:04:23 +0000 (00:04 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 2 May 2012 05:04:23 +0000 (00:04 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 72cca73d71598c6967a25e2dc30da13f3432648c..8dc58d1320bdd5957df4eb6804d7d7ef092ba607 100644 (file)
@@ -1168,6 +1168,11 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                                }
 #endif
 
+                               if (hup && dh.hits > 0) {
+                                       goto done;
+                               }
+
+
                                if (zstr(call_id) && (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status)))) {
                                        goto done;
                                }
@@ -1284,10 +1289,10 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                        }
 
 
-                       if (hup) { 
+                       if (hup && dh.hits < 1) { 
                                /* so many phones get confused when whe hangup we have to reprobe to get them all to reset to absolute states so the lights stay correct */
                                switch_event_t *s_event;
-                               
+
                                if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
                                        switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
                                        switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "login", profile->name);
@@ -1299,6 +1304,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                                }
                        }
                        
+               
                        if (!zstr((char *) helper.stream.data)) {
                                char *this_sql = (char *) helper.stream.data;
                                char *next = NULL;