src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java
/**
     * 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.
     *
     * @param stream the {@link MediaStreamTarget} whose post-hold direction
     * we'd like to determine.
     *
     * @return the {@link MediaDirection} that we need to set on <tt>stream</tt>
     * once it is reactivate.
     */
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 , this method simply returns its current direction.

@param stream the  MediaStreamTarget whose post-hold direction
we'd like to determine.

@return the  MediaDirection that we need to set on stream
once it is reactivate.
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 this method simply returns its current direction . @param stream the MediaStreamTarget whose post - hold direction we ' d like to determine . @return the MediaDirection that we need to set on stream once it is reactivate .
private MediaDirection calculatePostHoldDirection(MediaStream stream)
    {
        MediaDirection streamDirection = stream.getDirection();
        if (streamDirection.allowsSending())
            return streamDirection;
        /*
         * When calculating a direction we need to take into account 1) what
         * direction the remote party had asked for before putting us on hold,
         * 2) what the user preference is for the stream's media type, 3) our
         * local hold status, 4) the direction supported by the device this
         * stream is reading from.
         */
        ContentPacketExtension content = remoteContentMap.get(stream.getName());
        MediaDirection postHoldDir
            = JingleUtils.getDirection(content, !getPeer().isInitiator());
        MediaDevice device = stream.getDevice();
        postHoldDir
            = postHoldDir.and(
                    getDirectionUserPreference(device.getMediaType()));
        if (isLocallyOnHold())
            postHoldDir = postHoldDir.and(MediaDirection.SENDONLY);
        postHoldDir = postHoldDir.and(device.getDirection());
        return postHoldDir;
    }
private MediaDirection calculatePostHoldDirection ( MediaStream stream ) { MediaDirection streamDirection = stream . getDirection ( ) ; if ( streamDirection . allowsSending ( ) ) return streamDirection ; /*
         * When calculating a direction we need to take into account 1) what
         * direction the remote party had asked for before putting us on hold,
         * 2) what the user preference is for the stream's media type, 3) our
         * local hold status, 4) the direction supported by the device this
         * stream is reading from.
         */ ContentPacketExtension content = remoteContentMap . get ( stream . getName ( ) ) ; MediaDirection postHoldDir = JingleUtils . getDirection ( content , ! getPeer ( ) . isInitiator ( ) ) ; MediaDevice device = stream . getDevice ( ) ; postHoldDir = postHoldDir . and ( getDirectionUserPreference ( device . getMediaType ( ) ) ) ; if ( isLocallyOnHold ( ) ) postHoldDir = postHoldDir . and ( MediaDirection . SENDONLY ) ; postHoldDir = postHoldDir . and ( device . getDirection ( ) ) ; return postHoldDir ; }
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.
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 .
// 1. what the remote party originally told us (from our perspective) // 2. the user preference // 3. our local hold status // 4. the device direction