[Freeswitch-users] Unexpected behavior with hostname in socket application

Doug Campbell d.campbell at ampersand.com
Fri Mar 30 18:47:26 MSD 2012


 > The obvious answer would be: fix the DNS settings :)

If I could, I would.  (Machine not under my admin).
But it's a larger problem than that.  See below.

 > (or use the ip address of the network, not the loopback ip)

No address or hostname ever resolves to anything but "localhost" in freeswitch.
Very strange, because it picks up the port number, just not the hostname.

 > What happens if you try to do a "telnet localhost 4574" and then a "telnet 127.0.0.1 4574" on the same machine? Works in one case and not in the other?

I've forced the host to use only local files for name resolution,
fixed "localhost" to point to 127.0.0.1, and when I telnet or nc
to localhost:4574 it works.
nslookup localhost is the only thing that returns the wrong address.
Earlier versions of freeswitch used to work fine in this way.
Something about the current versions is not using the host-configured
name lookup, but seems to be going directly to DNS lookups.
(In addition to the problem of not picking up the correct hostname
from the dialplan).

Again thanks for any help,
Doug

On 03/29/2012 03:26 PM, Hector Geraldino wrote:
> The obvious answer would be: fix the DNS settings :) (or use the ip address of the network, not the loopback ip)
>
> Anyway, I'm curious about this one. What happens if you try to do a "telnet localhost 4574" and then a "telnet 127.0.0.1 4574" on the same machine? Works in one case and not in the other?
>
>
> -----Original Message-----
> From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Doug Campbell
> Sent: Thursday, March 29, 2012 1:25 PM
> To: freeswitch-users at lists.freeswitch.org
> Subject: [Freeswitch-users] Unexpected behavior with hostname in socket application
>
> I am getting unexpected behavior on the hostname used in the socket application.
>
> I have a trivial dialplan:
>
>     <context name="phoneglue">
>       <extension name="outside_call" continue="true">
>         <condition>
>           <action application="socket" data="127.0.0.1:4574 async"/>
>         </condition>
>       </extension>
>     </context>
>
> This outbound event socket gets connected fine on my CentOS 6.2 machine.
> Though the freeswitch.log file seems to change "127.0.0.1" to "localhost":
>
> EXECUTE sofia/phoneglue/9789735994 socket(localhost:4574 async)
>
> However, with the identical software (including fs built from git today), on my RHEL 6.2 machine that has a DNS glitch resolving "localhost" badly (don't ask), it fails.
> The freeswitch.log file says:
>
> EXECUTE sofia/phoneglue/9789735994 socket(localhost:4574 async)
> 2012-03-29 10:05:08.200547 [ERR] mod_event_socket.c:458 Socket Error!
>
> Why is it changing "127.0.0.1" to "localhost"?
> Shouldn't it be using the raw IP when it is so specified?
> Without it doing this, my RHEL box is doomed.
>
> Much thanks for any help,
> Doug
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>  
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list