]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10784: [freeswitch-core] Make Users lists compatible with all forms of xml #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 13 Nov 2017 19:32:23 +0000 (13:32 -0600)
committerMuteesa Fred <muteesafred@hotmail.com>
Tue, 24 Jul 2018 07:21:33 +0000 (07:21 +0000)
src/switch_xml.c

index 4ef0e9ec6cbe33223333bf741da4caa9abccc03a..1dc8166ecaf70bf812cd9110f737b0f19a74db7a 100644 (file)
@@ -1853,6 +1853,12 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(const char *use
                                }
                        }
                }
+       } else {
+               if ((users = switch_xml_child(domain, "users"))) {
+                       status = find_user_in_tag(users, NULL, user_name, "id", NULL, user);
+               } else {
+                       status = find_user_in_tag(domain, NULL, user_name, "id", NULL, user);
+               }
        }
 
        return status;
@@ -2145,7 +2151,11 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
        }
 
        if (status != SWITCH_STATUS_SUCCESS) {
-               status = find_user_in_tag(*domain, ip, user_name, key, params, user);
+               if ((users = switch_xml_child(*domain, "users"))) {
+                       status = find_user_in_tag(users, ip, user_name, key, params, user);
+               } else {
+                       status = find_user_in_tag(*domain, ip, user_name, key, params, user);
+               }
        }
 
   end: