}
} else {
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->e_dest = switch_core_session_strdup(nsession, dest);
switch_snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);