From abf5671f709edda39021954a3d60a437b831b07b Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Thu, 5 Nov 2009 20:14:49 +0000 Subject: [PATCH] First steps on modifying SIP to use the neomedia package --- .../impl/protocol/sip/CallPeerSipImpl.java | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java index e0dd7c0d7..187d3d3bb 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java @@ -106,10 +106,13 @@ public class CallPeerSipImpl private final OperationSetBasicTelephonySipImpl parentOpSet; /** - * The CallSession that the media service has created for this - * call. + * The media handler class handles all media management for a single + * CallPeer. This includes initializing and configuring streams, + * generating SDP, handling ICE, etc. One instance of CallPeer always + * corresponds to exactly one instance of CallPeerMediaHandler and + * both classes are only separated for reasons of readability. */ - private CallSession mediaCallSession = null; + private final CallPeerMediaHandler mediaHandler; /** * Creates a new call peer with address peerAddress. @@ -130,6 +133,8 @@ public CallPeerSipImpl(Address peerAddress, this.parentOpSet = owningCall.getParentOperationSet(); this.messageFactory = getProtocolProvider().getMessageFactory(); + this.mediaHandler = new CallPeerMediaHandler(this); + setDialog(containingTransaction.getDialog()); setLatestInviteTransaction(containingTransaction); setJainSipProvider(sourceProvider); @@ -594,30 +599,6 @@ private void attachSdpAnswer(Response response) .createContentTypeHeader("application", "sdp")); } - /** - * Sets the CallSession that the media service has created for this - * call peer. - * - * @param callSession the CallSession that the media service has - * created for this CallPeer. - */ - public void setMediaCallSession(CallSession callSession) - { - this.mediaCallSession = callSession; - } - - /** - * Returns the CallSession that the media service has created for - * this peer. - * - * @return the CallSession that the media service has created for - * this peer or null if no call session has been created so far. - */ - public CallSession getMediaCallSession() - { - return this.mediaCallSession; - } - /** * Updates the media flags for this peer according to the value of the SDP * field. @@ -1622,4 +1603,21 @@ public void handleAuthenticationChallenge(ClientTransaction retryTran) setLatestInviteTransaction(retryTran); setJainSipProvider(jainSipProvider); } + + /** + * Returns a reference to the CallPeerMediaHandler used by this + * peer. The media handler class handles all media management for a single + * CallPeer. This includes initializing and configuring streams, + * generating SDP, handling ICE, etc. One instance of CallPeer + * always corresponds to exactly one instance of + * CallPeerMediaHandler and both classes are only separated for + * reasons of readability. + * + * @return a reference to the CallPeerMediaHandler instance that + * this peer uses for media related tips and tricks. + */ + private CallPeerMediaHandler getMediaHandler() + { + return mediaHandler; + } }