]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] add some more log lines
authorAnthony Minessale <anthm@signalwire.com>
Fri, 2 Apr 2021 23:02:38 +0000 (23:02 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:01:06 +0000 (22:01 +0300)
src/mod/endpoints/mod_verto/mod_verto.c

index 85d1f3e49c71ca6f19d594b1130e8892b66303b4..610523cf39937dbb5da48b5ff4eb700a01374f4d 100644 (file)
@@ -1069,6 +1069,8 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
                        const char *use_passwd = NULL, *verto_context = NULL, *verto_dialplan = NULL;
                        time_t now = switch_epoch_time_now(NULL);
 
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Login sucessful for user: %s domain: %s\n", id, domain ? domain : "N/A");
+                       
                        jsock->logintime = now;
                        jsock->id = switch_core_strdup(jsock->pool, id);
                        jsock->domain = switch_core_strdup(jsock->pool, domain);
@@ -1124,7 +1126,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
 
                                                if (tmp > now) {
                                                        jsock->exptime = tmp;
-                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Login expire time for %s set to %ld seconds\n", jsock->uid, tmp - now);
+                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Login expire time for %s set to %ld seconds [%ld] [%ld]\n", jsock->uid, tmp - now, jsock->exptime, now);
                                                } else {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid expire time for %s. Defaulting to 300 sec\n", jsock->uid);
                                                        jsock->exptime = now + 300;
@@ -1997,7 +1999,7 @@ static void client_run(jsock_t *jsock)
 
                        if (now >= jsock->exptime) {
                                switch_set_flag(jsock, JPFLAG_AUTH_EXPIRED);
-                               die("%s Authentication Expired\n", jsock->uid);
+                               die("%s Authentication Expired [%ld] >= [%ld]\n", jsock->uid, now, jsock->exptime);
                        }
 
                }