use portable switch_inet_ntop

This commit is contained in:
Anthony Minessale 2014-02-12 03:31:21 +05:00
parent 3449e265a0
commit 10d2dd3e73
2 changed files with 2 additions and 2 deletions

View File

@ -529,7 +529,7 @@ SWITCH_STANDARD_API(gethost_api_function)
if (he) { if (he) {
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr)); memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
ip = inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf)); ip = switch_inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf));
stream->write_function(stream, "%s", ip); stream->write_function(stream, "%s", ip);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }

View File

@ -4292,7 +4292,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
if (he) { if (he) {
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr)); memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
ip = inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf)); ip = switch_inet_ntop(AF_INET, &sa.sin_addr, buf, sizeof(buf));
tmp = switch_string_replace(dest, host, ip); tmp = switch_string_replace(dest, host, ip);
//host = switch_core_session_strdup(nsession, ip); //host = switch_core_session_strdup(nsession, ip);
//dest = switch_core_session_strdup(nsession, tmp); //dest = switch_core_session_strdup(nsession, tmp);