From 6ddb25fb8a425f594597e0b8d71f7b0b4385223d Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Mon, 5 Aug 2013 12:02:07 +0300 Subject: [PATCH] Uses INACTIVE media direction for peers which are remotely-on-hold in conferences --- .../CallPeerMediaHandlerJabberImpl.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java index a75cca75c..3906113f5 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java @@ -150,7 +150,7 @@ public CallPeerMediaHandlerJabberImpl(CallPeerJabberImpl peer) } /** - * Determines and sets the direction that a stream, which has been placed on + * Determines the direction that a stream, which has been placed on * hold by the remote party, would need to go back to after being * re-activated. If the stream is not currently on hold (i.e. it is still * sending media), this method simply returns its current direction. @@ -1884,33 +1884,35 @@ public void setRemotelyOnHold(boolean onHold) { ColibriConferenceIQ.Channel channel = getColibriChannel(mediaType); - //TODO: calculate the direction independently of 'channel' - MediaDirection direction - = channel.getDirection().and(MediaDirection.RECVONLY); getPeer().getCall().setChannelDirection( channel.getID(), mediaType, - direction); + MediaDirection.INACTIVE); } else { - //TODO: calculate the direction properly + //TODO: does SENDRECV always make sense? ColibriConferenceIQ.Channel channel = getColibriChannel(mediaType); - MediaDirection direction - = channel.getDirection().or(MediaDirection.SENDONLY); getPeer().getCall().setChannelDirection( channel.getID(), mediaType, - direction); + MediaDirection.SENDRECV); } } else //no videobridge { if (remotelyOnHold) { - stream.setDirection(stream.getDirection() - .and(MediaDirection.RECVONLY)); + /* + * In conferences we use INACTIVE to prevent, for example, + * on-hold music from being played to all the participants. + */ + MediaDirection newDirection + = getPeer().getCall().isConferenceFocus() + ? MediaDirection.INACTIVE + : stream.getDirection().and(MediaDirection.SENDRECV); + stream.setDirection(newDirection); } else {