From ae50f474b44b527f18911e8761e887b27049e34c Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 13 Jun 2012 16:27:29 -0500 Subject: [PATCH] Why limit the query to profile_name passed. All the underlying callbacks deal with the profile not matching the one passed and will do the right thing. --- src/mod/endpoints/mod_sofia/sofia_presence.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 25daa18f8c..fd7357ed82 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -538,16 +538,16 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) sql = switch_mprintf("select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" ",'%q',full_to,network_ip,network_port from sip_subscriptions " - "where hostname='%q' and profile_name='%q' and event='message-summary' " + "where hostname='%q' and event='message-summary' " "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%')", - stream.data, mod_sofia_globals.hostname, profile->name, user, host, host); + stream.data, mod_sofia_globals.hostname, user, host, host); } else if (sub_call_id) { sql = switch_mprintf("select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name,network_ip" ",'%q',full_to,network_ip,network_port from sip_subscriptions where " - "hostname='%q' and profile_name='%q' and event='message-summary' " + "hostname='%q' and event='message-summary' " "and sub_to_user='%q' and (sub_to_host='%q' or presence_hosts like '%%%q%%') and call_id='%q'", - stream.data, mod_sofia_globals.hostname, profile->name, user, host, host, sub_call_id); + stream.data, mod_sofia_globals.hostname, user, host, host, sub_call_id); } @@ -560,12 +560,12 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) if (for_everyone) { sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id " - "from sip_registrations where hostname='%q' and profile_name='%q' and mwi_user='%q' and mwi_host='%q'", - stream.data, mod_sofia_globals.hostname, profile->name, user, host); + "from sip_registrations where hostname='%q' and mwi_user='%q' and mwi_host='%q'", + stream.data, mod_sofia_globals.hostname, user, host); } else if (call_id) { sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id " - "from sip_registrations where hostname='%q' and profile_name='%q' and call_id='%q'", - stream.data, mod_sofia_globals.hostname, profile->name, call_id); + "from sip_registrations where hostname='%q' and call_id='%q'", + stream.data, mod_sofia_globals.hostname, call_id); } if (sql) {