From 59f6654e960656c95ca5ff01fc4871a36a9c3fba Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 10 Mar 2011 22:02:45 -0600 Subject: [PATCH] send another presence event on calls that were cancelled from LOSE_RACE to fix winnable race in Broadsoft SCA --- src/mod/endpoints/mod_sofia/sofia_presence.c | 2 +- src/switch_channel.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 91808a7f50..a9a762e00e 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2004,7 +2004,7 @@ static void sync_sla(sofia_profile_t *profile, const char *to_user, const char * 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 hostname='%q' and ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q')", + "where call_info_state is not null and hostname='%q' and ((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q')", mod_sofia_globals.hostname, to_user, to_host, to_user, to_host); diff --git a/src/switch_channel.c b/src/switch_channel.c index bc9b76e90b..f737dc53c6 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -2539,6 +2539,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan if (hangup_cause == SWITCH_CAUSE_LOSE_RACE) { + switch_channel_presence(channel, "unknown", "cancelled", NULL); switch_channel_set_variable(channel, "presence_call_info", NULL); }