]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11088: Fixing verto status api
authorSergio Filipe <sergio.kalmik@gmail.com>
Wed, 4 Apr 2018 11:50:14 +0000 (11:50 +0000)
committerSergio Filipe <sergio.kalmik@gmail.com>
Wed, 4 Apr 2018 11:50:14 +0000 (11:50 +0000)
Checking if profile server_socket is valid to decide if is running or not

src/mod/endpoints/mod_verto/mod_verto.c

index 7a8b6e23b113ae5fc41d76a6eef57c60215acce7..811ae0de87c68962fc8ca71f72c96a0bb324a8b5 100644 (file)
@@ -5024,10 +5024,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
 
        switch_mutex_lock(verto_globals.mutex);
        for(profile = verto_globals.profile_head; profile; profile = profile->next) {
-               for (i = 0; i < profile->i; i++) { 
+               for (i = 0; i < profile->i; i++) {
                        char *tmpurl = switch_mprintf(strchr(profile->ip[i].local_ip, ':') ? "%s:[%s]:%d" : "%s:%s:%d",
                                                                                  (profile->ip[i].secure == 1) ? "wss" : "ws", profile->ip[i].local_ip, profile->ip[i].local_port);
-                       stream->write_function(stream, "%25s\t%s\t  %40s\t%s\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN");
+                       stream->write_function(stream, "%25s\t%s\t  %40s\t%s\n", profile->name, "profile", tmpurl, (profile->server_socket[i] != ws_sock_invalid) ? "RUNNING" : "DOWN");
                        switch_safe_free(tmpurl);
                }
                cp++;