[asterisk-bugs] [Asterisk 0013985]: No audio on outgoing Gtalk calls if /etc/hosts has Centos default; work-around provided

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jan 9 12:52:17 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13985 
====================================================================== 
Reported By:                jcovert
Assigned To:                phsultan
====================================================================== 
Project:                    Asterisk
Issue ID:                   13985
Category:                   Channels/chan_gtalk
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 159558 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-11-28 10:41 CST
Last Modified:              2009-01-09 12:52 CST
====================================================================== 
Summary:                    No audio on outgoing Gtalk calls if /etc/hosts has
Centos default; work-around provided
Description: 
If /etc/hosts includes the name of the host in addition to "localhost",
e.g.

127.0.0.1   blade14.on-state.com  blade14 localhost.localdomain localhost

chan_gtalk tries to set up the rtp audio channel on 127.0.0.1, which
obviously fails (see protocol exchange below).

Now, _I_ personally would never set up /etc/hosts that way, but this seems
to be a religious issue, and according to the IT guy who built the Linux
system for me to install Asterisk on, the Centos default is to include the
host name.

As soon as I changed the line to just

127.0.0.1 localhost.localdomain localhost

Gtalk calls worked just fine.

It would, however, be desirable for Gtalk to work without having to modify
/etc/hosts from the default, so it would work regardless of your religious
position on this issue.  I categorized this as "minor" since the workaround
is simple, but it's "major" for anyone of the "we must put the real
host-name in here" party.

/john
====================================================================== 

---------------------------------------------------------------------- 
 (0097335) jcovert (reporter) - 2009-01-09 12:52
 http://bugs.digium.com/view.php?id=13985#c97335 
---------------------------------------------------------------------- 
No, I didn't, because that's just another workaround for the basic
problem.

If you make the bindaddr non-zero, then only that interface will be used,
rather than all of them, and you can't use the current DHCP-assigned
interface if you're on a dynamic host.

Your suggestion made me see what's wrong with the code.  I read the code
in routine ast_find_ourip, and I see that it gets the IP address to use for
the RTP session either from the bindaddr if specified, or by doing a lookup
of the local host name and then converting that to an address, which fails
if the CentOS default of translating your own host name to 127.0.0.1 is
taken.  Ugh.

Just like SIP, this is a problem with using separate sessions.  In this
case what we want is the address of the interface that is going to be used
to communicate with the remote party (which will vary depending on what the
remote party's IP address is), not some random interface turned up by doing
a DNS lookup of our local hostname.

If you do a DNS lookup of the local hostname, then you need to get all of
the possible results, not just the first, and use all of them as
"candidates", and probably only bother to use 127.0.0.1 if it's the only
one that comes back.

Since I consider the CentOS default of putting your local host name into
/etc/hosts as 127.0.0.1 to be bogus, if you want to close this as "too hard
to fix properly", I wouldn't object. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-09 12:52 jcovert        Note Added: 0097335                          
======================================================================




More information about the asterisk-bugs mailing list