diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java index 55f52e025..c6551806f 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java @@ -227,8 +227,33 @@ private CallSipImpl createOutgoingCall(Address calleeAddress) .createCallSession(callParticipant.getCall()); ((CallSipImpl)callParticipant.getCall()) .setMediaCallSession(callSession); + + //if possible try to indicate the address of the callee so that the + //media service can choose the most proper local address to + //advertise. + javax.sip.address.URI calleeURI = calleeAddress.getURI(); + InetAddress intendedDestination = null; + if(calleeURI.isSipURI()) + { + String host = ((SipURI)calleeURI).getHost(); + + try + { + intendedDestination = InetAddress.getByName(host); + invite.setContent( + callSession.createSdpOffer(intendedDestination) + , contentTypeHeader); + } + catch (UnknownHostException ex) + { + logger.warn("Failed to obtain an InetAddress for " + + host + , ex); + } + } + invite.setContent( - callSession.createSdpOffer() + callSession.createSdpOffer(intendedDestination) , contentTypeHeader); } catch (ParseException ex)