public void handleEvent ( final MasqueradeEvent b ) { if ( this . isConnectedToSelf ( b . getClone ( ) ) ) { // At this point we will actually have two CallTrackers // which we now need to merge into a single CallTracker. CallTracker original = findCall ( b . getOriginal ( ) ) ; CallTracker clone = findCall ( b . getClone ( ) ) ; if ( original != null && clone != null ) { clone . mergeCalls ( original ) ; clone . setState ( b . getCloneState ( ) ) ; this . evaluateState ( ) ; } else logger . warn ( "When processing masquradeEvent we could not find the expected calls. event=" //$NON-NLS-1$ + b . toString ( ) + " original=" + original + " clone=" + clone ) ; //$NON-NLS-1$ //$NON-NLS-2$ } }
We handle the masqurade event is it contains channel state information . During a masquerade we will have two channels for the one peer the original and the clone . As the clone is taking over from the original peer we now need to use that as true indicator of state .