From fcb0040932cb9f043d8832c173be2013ce176a02 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Wed, 30 Sep 2009 16:38:30 +0000 Subject: [PATCH] Moved outgoing invitations to CallPeerSipImpl (apparently git and java.net killed one of my earlier modifications). Fixes selection of intended destination for media to take into account the presence of an outbound proxy so that our SDP offers are in IPv4 when we are connected to an IPv4 server. --- .../impl/protocol/sip/CallSipImpl.java | 82 +------------------ 1 file changed, 1 insertion(+), 81 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java index be4a88076..a3a18887e 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java @@ -336,91 +336,11 @@ public CallPeerSipImpl invite(Address calleeAddress, CallPeerSipImpl callPeer = createCallPeerFor(inviteTransaction, jainSipProvider); - // invite content - attachSdpOffer(invite, callPeer); - - try - { - inviteTransaction.sendRequest(); - if (logger.isDebugEnabled()) - logger.debug("sent request:\n" + invite); - } - catch (SipException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "An error occurred while sending invite request", - OperationFailedException.NETWORK_FAILURE, ex, logger); - } + callPeer.invite(); return callPeer; } - /** - * Creates an SDP offer destined to callPeer and attaches it to - * the invite request. - * - * @param invite the invite Request that we'd like to attach an - * SDP offer to. - * @param callPeer the callPeer that we'd like to address our - * offer to - * - * @throws OperationFailedException if we fail constructing the session - * description. - */ - private void attachSdpOffer(Request invite, CallPeerSipImpl callPeer) - throws OperationFailedException - { - try - { - CallSession callSession = SipActivator.getMediaService() - .createCallSession(callPeer.getCall()); - callPeer.setMediaCallSession(callSession); - - callSession.setSessionCreatorCallback(callPeer); - - // if possible try to indicate the address of the callee so - // that the media service can choose the most proper local - // address to advertise. - URI calleeURI = callPeer.getPeerAddress().getURI(); - - if (calleeURI.isSipURI()) - { - // content type should be application/sdp (not applications) - // reported by Oleg Shevchenko (Miratech) - ContentTypeHeader contentTypeHeader = getProtocolProvider() - .getHeaderFactory().createContentTypeHeader( - "application", "sdp"); - - String host = ((SipURI) calleeURI).getHost(); - InetAddress intendedDestination = getProtocolProvider() - .resolveSipAddress(host).getAddress(); - - invite.setContent(callSession - .createSdpOffer(intendedDestination), - contentTypeHeader); - } - } - catch (UnknownHostException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "Failed to obtain an InetAddress for " + ex.getMessage(), - OperationFailedException.NETWORK_FAILURE, ex, logger); - } - catch (ParseException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "Failed to parse sdp data while creating invite request!", - OperationFailedException.INTERNAL_ERROR, ex, logger); - } - catch (MediaException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "Could not access media devices!", - OperationFailedException.INTERNAL_ERROR, ex, logger); - } - - } - /** * Creates a new call peer associated with containingTransaction *