]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Here try this
authorBrian West <brian@freeswitch.org>
Fri, 25 Mar 2011 02:29:45 +0000 (21:29 -0500)
committerBrian West <brian@freeswitch.org>
Fri, 25 Mar 2011 02:29:55 +0000 (21:29 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 93e0588b11feaf6ceffa12fde1b0eb14c6ded120..9a52d79a93db8a53c8182cb05aa878b2b73ec124 100644 (file)
@@ -3497,12 +3497,12 @@ static void select_from_profile(sofia_profile_t *profile,
 
        if (exclude_contact) {
                sql = switch_mprintf("select contact, profile_name, '%q' "
-                                                        "from sip_registrations where sip_user='%q' and (sip_host='%q' or presence_hosts like '%%%q%%') "
-                                                        "and contact not like '%%%s%%'", (concat != NULL) ? concat : "", user, domain, domain, exclude_contact);
+                                                        "from sip_registrations where (sip_user='%q' or sip_username='%q') and (sip_host='%q' or presence_hosts like '%%%q%%') "
+                                                        "and contact not like '%%%s%%'", (concat != NULL) ? concat : "", user, user, domain, domain, exclude_contact);
        } else {
                sql = switch_mprintf("select contact, profile_name, '%q' "
-                                                        "from sip_registrations where sip_user='%q' and (sip_host='%q' or presence_hosts like '%%%q%%')",
-                                                        (concat != NULL) ? concat : "", user, domain, domain);
+                                                        "from sip_registrations where (sip_user='%q' or sip_username='%q') and (sip_host='%q' or presence_hosts like '%%%q%%')",
+                                                        (concat != NULL) ? concat : "", user, user, domain, domain);
        }
 
        switch_assert(sql);