new_socket:
while(globals.running) {
+ char *listening_ip = NULL;
switch_clear_flag_locked(profile, PFLAG_RESPAWN);
rv = switch_sockaddr_info_get(&sa, profile->ip, SWITCH_UNSPEC, profile->port, 0, tmp_pool);
if (rv)
rv = switch_socket_listen(profile->sock, 5);
if (rv)
goto sock_fail;
+ switch_sockaddr_ip_get(&listening_ip, sa);
+ if (!profile->ip || strcmp(listening_ip, profile->ip)) {
+ profile->ip = switch_core_strdup(profile->pool, listening_ip);
+ }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Socket up listening on %s:%u\n", profile->ip, profile->port);
break;