]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] add chop-domain undocumented feature to allow FS to ignore @ in username
authorAnthony Minessale <anthm@signalwire.com>
Thu, 13 Aug 2020 21:08:32 +0000 (21:08 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:01:00 +0000 (22:01 +0300)
src/mod/endpoints/mod_verto/mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.h

index 8f8c1ca92672f7733c12a2ba69638b8d01f08892..505b9892ee93e7f69b5e5c785838f1a71650d02c 100644 (file)
@@ -970,10 +970,10 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
                } else if (switch_true(jsock->profile->userauth)) {
                        id = switch_core_strdup(jsock->pool, login);
 
-                       if ((domain = strchr(id, '@'))) {
+                       if (jsock->profile->chop_domain && (domain = strchr(id, '@'))) {
                                *domain++ = '\0';
                        }
-
+                       
                }
 
                if (jsock->profile->register_domain) {
@@ -5065,7 +5065,7 @@ static switch_status_t parse_config(const char *cf)
 
                        profile->mcast_sub.sock = KS_SOCK_INVALID;
                        profile->mcast_pub.sock = KS_SOCK_INVALID;
-
+                       profile->chop_domain = SWITCH_TRUE;
 
                        for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
                                char *var = NULL;
@@ -5107,6 +5107,8 @@ static switch_status_t parse_config(const char *cf)
                                        profile->blind_reg = switch_true(val);
                                } else if (!strcasecmp(var, "userauth") && !zstr(val)) {
                                        profile->userauth = switch_core_strdup(profile->pool, val);
+                               } else if (!strcasecmp(var, "chop-domain") && !zstr(val)) {
+                                       profile->chop_domain = switch_true(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)) {
index c9087e5adabfd734afd5d61dc4514410a0f6789a..112fb09ae61994fbd219e616fa193c1fa733a276 100644 (file)
@@ -241,7 +241,8 @@ struct verto_profile_s {
        int ssl_ready;
        int ready;
        int debug;
-
+       int chop_domain;
+       
        int in_thread;
        int blind_reg;