Do not freak out when the to address of SIP Messages is not AAAA/A resolvable (report by Dan Bogos)

cusax-fix
Emil Ivov 18 years ago
parent 0d9418baf7
commit 8ac25f4061

@ -379,15 +379,6 @@ Request createMessage(Contact to, Message message)
try
{
toAddress = parseAddressStr(to.getAddress());
destinationInetAddress = InetAddress.getByName(
( (SipURI) toAddress.getURI()).getHost());
}
catch (UnknownHostException ex)
{
throw new IllegalArgumentException(
( (SipURI) toAddress.getURI()).getHost()
+ " is not a valid internet address " + ex.getMessage());
}
catch (ParseException exc)
{
@ -401,6 +392,33 @@ Request createMessage(Contact to, Message message)
, OperationFailedException.INTERNAL_ERROR
, exc);
}
try
{
destinationInetAddress = InetAddress.getByName(
( (SipURI) toAddress.getURI()).getHost());
}
catch (UnknownHostException ex)
{
//getByName() verifies host existance with an AAAA/A check and the
//destination could only have an SRV record so let's not let this
//bother us and only log it (report by Dan Bogos)
logger.warn( ( (SipURI) toAddress.getURI()).getHost()
+ " is not a valid internet address " + ex.getMessage());
//replace the destination address with that of the proxy if we
//have it or that of the registrar otherwise.
if(sipProvider.getOutboundProxy() != null)
{
destinationInetAddress
= sipProvider.getOutboundProxy().getAddress();
}
else
{
destinationInetAddress
= sipProvider.getRegistrarConnection().getRegistrarAddress();
}
}
// Call ID
CallIdHeader callIdHeader = this.sipProvider

@ -1873,6 +1873,31 @@ public Address getOurSipAddress()
{
return ourSipAddress;
}
/**
* In case we are using an outbound proxy this method returns its address.
* The method returns <tt>null</tt> otherwise.
*
* @return the address of our outbound proxy if we are using one and
* <tt>null</tt> otherwise.
*/
public InetSocketAddress getOutboundProxy()
{
return this.outboundProxySocketAddress;
}
/**
* In case we are using an outbound proxy this method returns the transport
* we are using to connect to it. The method returns <tt>null</tt>
* otherwise.
*
* @return the transport used to connect to our outbound proxy if we are
* using one and <tt>null</tt> otherwise.
*/
public String getOutboundProxyTransport()
{
return this.outboundProxyTransport;
}
/**
* Extracts all properties concerning the usage of an outbound proxy for

Loading…
Cancel
Save