[asterisk-dev] chan_woomera tries to connect to strange host

Ganbold Tsagaankhuu ganbold at gmail.com
Fri Feb 22 01:02:50 CST 2008


Hi,

It is very strange that following chan_woomera code part gives IP address
44.215.5.41.

static int connect_woomera(int *new_socket, woomera_profile *profile, int
flags)
{
struct sockaddr_in localAddr, remoteAddr;
struct hostent *hp;
struct ast_hostent ahp;
int res = 0;

*new_socket=-1;

printf("WOOMERA HOST: %s\n",profile->woomera_host); // THIS PRINTS CORRECT
IP ADDRESS
if ((hp = ast_gethostbyname(profile->woomera_host, &ahp))) {
remoteAddr.sin_family = hp->h_addrtype; memcpy((char *)
&remoteAddr.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length);

printf("************************ WOOMERA HOST: %s\n", inet_ntoa(
remoteAddr.sin_addr)); // THIS PRINTS 44.215.5.41
remoteAddr.sin_port = htons(profile->woomera_port);

And chan_woomera tries to connect to 44.215.5.41:42240, it is very strange,
because
I have already defined host 192.168.0.18 in woomera.conf.

I can hardcode it like:

// memcpy((char *) &remoteAddr.sin_addr.s_addr, hp->h_addr_list[0],
hp->h_length);
inet_aton("192.168.0.18", &remoteAddr.sin_addr);

But I would like to know the right solution.
Please let me know.

thanks,

Ganbold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080222/10fe7277/attachment.htm 


More information about the asterisk-dev mailing list