]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] add param to have verto send pass over xml_curl
authorAnthony Minessale <anthm@signalwire.com>
Sun, 5 Apr 2020 20:15:12 +0000 (20:15 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:21 +0000 (22:00 +0300)
src/mod/endpoints/mod_verto/mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.h

index b92693870ac7e190abc36de85b0045464816f103..4d02fee4f8d5c32028d44f816b06cd24e208e6ca 100644 (file)
@@ -984,6 +984,10 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
                        }
                }
 
+               if (jsock->profile->send_passwd || verto_globals.send_passwd) {
+                       switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, "user_supplied_pass", passwd);
+               }
+               
                switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, "action", "jsonrpc-authenticate");
 
                if (switch_xml_locate_user_merged("id", id, domain, NULL, &x_user, req_params) != SWITCH_STATUS_SUCCESS && !jsock->profile->blind_reg) {
@@ -4953,6 +4957,8 @@ static switch_status_t parse_config(const char *cf)
                                        profile->userauth = switch_core_strdup(profile->pool, val);
                                } else if (!strcasecmp(var, "root-password") && !zstr(val)) {
                                        profile->root_passwd = switch_core_strdup(profile->pool, val);
+                               } else if (!strcasecmp(var, "send-auth-password") && !zstr(val)) {
+                                       profile->send_passwd = switch_true(val);
                                } else if (!strcasecmp(var, "context") && !zstr(val)) {
                                        profile->context = switch_core_strdup(profile->pool, val);
                                } else if (!strcasecmp(var, "dialplan") && !zstr(val)) {
@@ -5148,6 +5154,8 @@ static switch_status_t parse_config(const char *cf)
                                }
                        } else if (!strcasecmp(var, "enable-presence") && val) {
                                verto_globals.enable_presence = switch_true(val);
+                       } else if (!strcasecmp(var, "send-auth-password") && !zstr(val)) {
+                               verto_globals.send_passwd = switch_true(val);
                        } else if (!strcasecmp(var, "enable-fs-events") && val) {
                                verto_globals.enable_fs_events = switch_true(val);
                        } else if (!strcasecmp(var, "detach-timeout-sec") && val) {
index bbf0114503401cc6e6fd85e40c3c59a0068c1089..9018f6ce9517f3eff155eddad9c87f3ca01f27d2 100644 (file)
@@ -246,6 +246,8 @@ struct verto_profile_s {
        char *userauth;
        char *root_passwd;
 
+       int send_passwd;
+       
        char *context;
        char *dialplan;
 
@@ -307,6 +309,7 @@ struct globals_s {
 
        int debug;
        int ready;
+       int send_passwd;
        int profile_threads;
        int enable_presence;
        int enable_fs_events;