mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
FS-5396 --resolve add gethost function to call gethostbyname as desired
This commit is contained in:
@@ -4270,12 +4270,12 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
||||
if (!strchr(host, '.') || switch_true(switch_event_get_header(var_event, "sip_gethostbyname"))) {
|
||||
struct sockaddr_in sa;
|
||||
struct hostent *he = gethostbyname(host);
|
||||
char *ip, *tmp;
|
||||
char buf[50] = "", *tmp;
|
||||
const char *ip;
|
||||
|
||||
if (he) {
|
||||
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
|
||||
ip = inet_ntoa(sa.sin_addr);
|
||||
|
||||
ip = inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf));
|
||||
tmp = switch_string_replace(dest, host, ip);
|
||||
//host = switch_core_session_strdup(nsession, ip);
|
||||
//dest = switch_core_session_strdup(nsession, tmp);
|
||||
|
||||
Reference in New Issue
Block a user