From fd177cdf332a02d84e7ff514afe3883cc5371548 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 3 Oct 2012 09:29:50 -0500 Subject: [PATCH] FS-4676 going over the traces the only thing I can guess is that you may have some race condition on the speed of your box or something regarding the db, Try this patch that may help --- src/mod/endpoints/mod_sofia/sofia_presence.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 10d741bca4..d7d7a49cf7 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3138,9 +3138,6 @@ static int broadsoft_sla_notify_callback(void *pArg, int argc, char **argv, char switch_snprintf(key, sizeof(key), "%s%s", user, host); data = switch_core_hash_find(sh->hash, key); - - data = switch_core_hash_find(sh->hash, key); - if (data) { tmp = switch_core_sprintf(sh->pool, "%s,;appearance-index=*;appearance-state=idle", data, host); } else { @@ -3354,7 +3351,7 @@ static int sync_sla(sofia_profile_t *profile, const char *to_user, const char *t switch_core_hash_init(&sh->hash, sh->pool); sql = switch_mprintf("select sip_from_user,sip_from_host,call_info,call_info_state,uuid from sip_dialogs " - "where call_info_state is not null and call_info_state != '' and hostname='%q' and profile_name='%q' " + "where call_info_state is not null and call_info_state != '' and call_info_state != 'idle' and hostname='%q' and profile_name='%q' " "and ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') " "and profile_name='%q'", mod_sofia_globals.hostname, profile->name, to_user, to_host, to_user, to_host, profile->name);