@Override public synchronized void cancel() throws CallException { final List<State> possibleStates = new ArrayList<State>(); possibleStates.add(QUEUED); possibleStates.add(RINGING); assertState(possibleStates); if(Direction.OUTBOUND_DIAL == getDirection()) { final SipServletRequest cancel = initialInvite.createCancel(); try { cancel.send(); cleanup(); setState(CANCELLED); fireStatusChanged(); } catch(final IOException exception) { cleanup(); setState(FAILED); fireStatusChanged(); throw new CallException(exception); } } }