[sip-comm-dev] [PATCH] prevent inverse hostname lookup to speed up SIP call initiation


#1

Hello,

attached is a small patch which can increase SIP call initation when
connecting to a recipient with a "private" IP address. Apparently, the SUN
RTPSessionMgr.addTarget does an inverse hostname lookup if the target was
given as an IP address. This lookup can take several seconds if the name
server can't resolve the hostname (especially if the target IP is a
"private" IP like 192.168.81.3). The patch works around it by explicitly
setting the hostname of the target InetAddress (to the IP address as
String), which suppresses the lookup.

As far as I can see, knowing the actual hostname of the target is not
neccessary. I'd be glad if someone who knows the SIP/RTP specifications
could double-check this change. Also see this discussion, where I got the
idea for the change:
http://www.nabble.com/addTarget()-in-private-network-so-slow-t4434066.html

Regards
Michael Koch

CallSessionImpl-prevent_hostname_lookup.patch (1.19 KB)


#2

That's a good fix. A further improvement would be to initiate the
hostname lookup in a separate thread, setting hostname asynchronously
whenever (if) the request returned. That would preserve the state at
call initiation completion of always having both IP# and hostname,
regardless of which was specified in the initiation request, that the
old, blocking method delivered. So other code that depends on
both/either data could work.

ยทยทยท

On Fri, 2007-10-26 at 09:41 +0200, Koch Michael wrote:

Hello,

attached is a small patch which can increase SIP call initation when
connecting to a recipient with a "private" IP address. Apparently, the SUN
RTPSessionMgr.addTarget does an inverse hostname lookup if the target was
given as an IP address. This lookup can take several seconds if the name
server can't resolve the hostname (especially if the target IP is a
"private" IP like 192.168.81.3). The patch works around it by explicitly
setting the hostname of the target InetAddress (to the IP address as
String), which suppresses the lookup.

As far as I can see, knowing the actual hostname of the target is not
neccessary. I'd be glad if someone who knows the SIP/RTP specifications
could double-check this change. Also see this discussion, where I got the
idea for the change:
http://www.nabble.com/addTarget()-in-private-network-so-slow-t4434066.html

Regards
Michael Koch

--

(C) Matthew Rubenstein

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net