public CallImpl join ( OperandChannel originatingOperand , Call rhs , OperandChannel acceptingOperand , CallDirection direction ) throws PBXException { CallImpl joinTo = ( CallImpl ) rhs ; Channel originatingParty = null ; Channel acceptingParty = null ; // Pull the originating party from the this call. originatingParty = this . getOperandChannel ( originatingOperand ) ; if ( originatingParty != null && originatingParty . isLive ( ) ) originatingParty . removeListener ( this ) ; // Pull the accepting party from the other 'call' as the accepting // party. acceptingParty = rhs . getOperandChannel ( acceptingOperand ) ; if ( acceptingParty != null && acceptingParty . isLive ( ) ) acceptingParty . removeListener ( ( CallImpl ) rhs ) ; if ( originatingParty == null || ! originatingParty . isLive ( ) || acceptingParty == null || ! acceptingParty . isLive ( ) ) throw new PBXException ( "Call.HangupDuringJoin" ) ; //$NON-NLS-1$ CallImpl joined = new CallImpl ( originatingParty , direction ) ; joined . setAcceptingParty ( acceptingParty ) ; joined . _owner = OWNER . SELF ; joined . _callStarted = minDate ( this . _callStarted , joinTo . _callStarted ) ; joined . _holdStarted = minDate ( this . _holdStarted , joinTo . _holdStarted ) ; joined . _timeAtDialin = minDate ( this . _timeAtDialin , joinTo . _timeAtDialin ) ; logger . debug ( "Joined two calls lhs=" + this + ", rhs=" + joinTo ) ; //$NON-NLS-1$//$NON-NLS-2$ return joined ; }
Joins a specific channel from this call with a specific channel from another call which results in a new Call object being created . Channels that do not participate in the join are left in their original Call .