mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 08:29:45 +00:00
FS-5396 --resolve
This commit is contained in:
parent
f9c5f85444
commit
647f3fd3fb
@ -4275,6 +4275,24 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
host++;
|
host++;
|
||||||
|
|
||||||
|
if (!strchr(host, '.')) {
|
||||||
|
struct sockaddr_in sa;
|
||||||
|
struct hostent *he = gethostbyname(host);
|
||||||
|
char *ip, *tmp;
|
||||||
|
|
||||||
|
if (he) {
|
||||||
|
memcpy(&sa.sin_addr, he->h_addr, sizeof(struct in_addr));
|
||||||
|
ip = inet_ntoa(sa.sin_addr);
|
||||||
|
|
||||||
|
tmp = switch_string_replace(dest, host, ip);
|
||||||
|
//host = switch_core_session_strdup(nsession, ip);
|
||||||
|
//dest = switch_core_session_strdup(nsession, tmp);
|
||||||
|
switch_channel_set_variable_printf(nchannel, "sip_route_uri", "sip:%s", tmp);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tech_pvt->dest = switch_core_session_alloc(nsession, strlen(dest) + 5);
|
tech_pvt->dest = switch_core_session_alloc(nsession, strlen(dest) + 5);
|
||||||
tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
|
tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
|
||||||
switch_snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
|
switch_snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user