提交 73acee71 authored 作者: Anthony Minessale's avatar Anthony Minessale

use portable switch_inet_ntop

上级 81863e44
...@@ -530,7 +530,7 @@ SWITCH_STANDARD_API(gethost_api_function) ...@@ -530,7 +530,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;
} }
......
...@@ -5094,7 +5094,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session ...@@ -5094,7 +5094,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);
switch_channel_set_variable_printf(nchannel, "sip_route_uri", "sip:%s", tmp); switch_channel_set_variable_printf(nchannel, "sip_route_uri", "sip:%s", tmp);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论