From 0651b01abf9b5fb30a6e825cd0820ddfcc3fa343 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Tue, 13 Sep 2011 10:40:33 -0500 Subject: [PATCH] correct sofia_count_reg_function behavior reported from user list --- src/mod/endpoints/mod_sofia/mod_sofia.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 147dc279be..8ef3b92663 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -3616,12 +3616,12 @@ SWITCH_STANDARD_API(sofia_count_reg_function) if (zstr(user)) { sql = switch_mprintf("select count(*) " "from sip_registrations where (sip_host='%q' or presence_hosts like '%%%q%%')", - (concat != NULL) ? concat : "", domain, domain); + domain, domain); } else { sql = switch_mprintf("select count(*) " - "from sip_registrations where (sip_user='%q' or dir_user='%q') and (sip_host='%q' or presence_hosts like '%%%q%%')", - (concat != NULL) ? concat : "", user, user, domain, domain); + "from sip_registrations where sip_user='%q' and (sip_host='%q' or presence_hosts like '%%%q%%')", + user, domain, domain); } switch_assert(sql); sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sql2str_callback, &cb);