]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core, mod_commands, mod_verto] small tweaks to cache stuff to allow clear from verto...
authorAnthony Minessale <anthm@signalwire.com>
Mon, 9 Nov 2020 03:49:30 +0000 (03:49 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:01:02 +0000 (22:01 +0300)
src/mod/applications/mod_commands/mod_commands.c
src/mod/endpoints/mod_verto/mod_verto.c
src/switch_xml.c

index b5f7f5ff8ed24a6e85fd961860c8717b373e6b9c..a86cea3538e0f0de332c4a4a9e1a49ce13aa687b 100644 (file)
@@ -6742,7 +6742,7 @@ SWITCH_STANDARD_API(xml_flush_function)
                argc = switch_split(mycmd, ' ', argv);
        }
 
-       if (argc == 3) {
+       if (argc > 1) {
                r = switch_xml_clear_user_cache(argv[0], argv[1], argv[2]);
        } else {
                r = switch_xml_clear_user_cache(NULL, NULL, NULL);
index d145dcaac0ab71b4be1bc085419bfe53978579eb..dc352bcb0c9e3d5d58a04cb6b106b5a10cbacf3b 100644 (file)
@@ -1118,6 +1118,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
                                switch_snprintf(message, mlen, "Authentication Failure");
                                jsock->uid = NULL;
                                login_fire_custom_event(jsock, params, 0, "Authentication Failure");
+                               switch_xml_clear_user_cache("id", id, domain);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"auth using %s\n",a1_hash ? "a1-hash" : "username & password");
                                r = SWITCH_TRUE;
index bd0e7c8c388102dcae27b90b35e650ace061ee75..6467758b7232d14be91c5de716022f1ab42b95f9 100644 (file)
@@ -2010,6 +2010,10 @@ SWITCH_DECLARE(uint32_t) switch_xml_clear_user_cache(const char *key, const char
 
        switch_mutex_lock(CACHE_MUTEX);
 
+       if (key && user_name && !domain_name) {
+               domain_name = switch_core_get_variable("domain");
+       }
+       
        if (key && user_name && domain_name) {
                switch_snprintf(mega_key, sizeof(mega_key), "%s%s%s", key, user_name, domain_name);