@@ -428,7 +428,7 @@ SWITCH_STANDARD_APP(socket_function)
428
428
return ;
429
429
}
430
430
431
- if ((port_name = strchr (host , ':' ))) {
431
+ if ((port_name = strrchr (host , ':' ))) {
432
432
* port_name ++ = '\0' ;
433
433
port = (switch_port_t ) atoi (port_name );
434
434
}
@@ -440,12 +440,12 @@ SWITCH_STANDARD_APP(socket_function)
440
440
441
441
switch_channel_set_variable (channel , "socket_host" , host );
442
442
443
- if (switch_sockaddr_info_get (& sa , host , AF_INET , port , 0 , switch_core_session_get_pool (session )) != SWITCH_STATUS_SUCCESS ) {
443
+ if (switch_sockaddr_info_get (& sa , host , SWITCH_UNSPEC , port , 0 , switch_core_session_get_pool (session )) != SWITCH_STATUS_SUCCESS ) {
444
444
switch_log_printf (SWITCH_CHANNEL_SESSION_LOG (session ), SWITCH_LOG_ERROR , "Socket Error!\n" );
445
445
return ;
446
446
}
447
447
448
- if (switch_socket_create (& new_sock , AF_INET , SOCK_STREAM , SWITCH_PROTO_TCP , switch_core_session_get_pool (session ))
448
+ if (switch_socket_create (& new_sock , switch_sockaddr_get_family ( sa ) , SOCK_STREAM , SWITCH_PROTO_TCP , switch_core_session_get_pool (session ))
449
449
!= SWITCH_STATUS_SUCCESS ) {
450
450
switch_log_printf (SWITCH_CHANNEL_SESSION_LOG (session ), SWITCH_LOG_ERROR , "Socket Error!\n" );
451
451
return ;
@@ -2766,7 +2766,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
2766
2766
config ();
2767
2767
2768
2768
while (!prefs .done ) {
2769
- rv = switch_sockaddr_info_get (& sa , prefs .ip , SWITCH_INET , prefs .port , 0 , pool );
2769
+ rv = switch_sockaddr_info_get (& sa , prefs .ip , SWITCH_UNSPEC , prefs .port , 0 , pool );
2770
2770
if (rv )
2771
2771
goto fail ;
2772
2772
rv = switch_socket_create (& listen_list .sock , switch_sockaddr_get_family (sa ), SOCK_STREAM , SWITCH_PROTO_TCP , pool );
0 commit comments