JVoiceXmlImplementationPlatform implements SpokenInputListener, SynthesizedOutputListener,
        TelephonyListener, ImplementationPlatform, Configurable { @Override public void telephonyCallHungup(final TelephonyEvent event) { synchronized (this) { if (hungup) { return; } } LOGGER.info("telephony connection hung up " + event); if (input != null && input.isBusy()) { final Collection<ModeType> types = new java.util.ArrayList<ModeType>();; types.add(ModeType.VOICE); types.add(ModeType.DTMF); input.stopRecognition(types); } if (eventbus != null) { final JVoiceXMLEvent hangupEvent = new ConnectionDisconnectHangupEvent("caller hung up"); eventbus.publish(hangupEvent); } synchronized (this) { hungup = true; } LOGGER.info("returning aqcuired resources"); returnSystemOutput(); returnUserInput(); returnCallControl(); LOGGER.info("implementation platform closed"); } JVoiceXmlImplementationPlatform(
            final KeyedResourcePool<Telephony> telePool,
            final KeyedResourcePool<SynthesizedOutput> synthesizedOutputPool,
            final KeyedResourcePool<SpokenInput> spokenInputPool,
            final ConnectionInformation connectionInformation);   JVoiceXmlImplementationPlatform(
            final KeyedResourcePool<Telephony> telePool,
            final KeyedResourcePool<SynthesizedOutput> synthesizedOutputPool,
            final KeyedResourcePool<SpokenInput> spokenInputPool,
            final BufferedDtmfInput bufferedCharacterInput,
            final ConnectionInformation connectionInformation); @Override void init(final Configuration configuration); Session getSession(); @Override boolean isHungup(); @Override SystemOutput getSystemOutput(); @Override void waitOutputQueueEmpty(); void waitNonBargeInPlayed(); @Override UserInput getUserInput(); @Override boolean isUserInputActive(); @Override DtmfInput getCharacterInput(); @Override CallControl getCallControl(); @Override void close(); @Override void setEventBus(final EventBus bus); void resultAccepted(final RecognitionResult result); void resultRejected(final RecognitionResult result); @Override void inputStatusChanged(final SpokenInputEvent event); @Override void telephonyCallAnswered(final TelephonyEvent event); @Override void dtmfInput(final char dtmf); @Override void telephonyCallHungup(final TelephonyEvent event); void telephonyCallTransferred(final TelephonyEvent event); @Override void telephonyMediaEvent(final TelephonyEvent event); @Override void outputStatusChanged(final SynthesizedOutputEvent event); void setSession(final Session currentSession); @Override void outputError(final ErrorEvent error); @Override void inputError(final ErrorEvent error); @Override void telephonyError(final ErrorEvent error); @Override void startPromptQueuing(final long timeout); @Override void queuePrompt(final SpeakableText speakable); @Override void renderPrompts(final String sessionId,
            final DocumentServer server, final CallControlProperties props);  }
@Test public void testTelephonyCallHungup() { final Telephony telephony = Mockito.mock(Telephony.class); final TelephonyEvent event = new TelephonyEvent(telephony, TelephonyEvent.HUNGUP); platform.telephonyCallHungup(event); Assert.assertFalse(platform.isUserInputActive()); Assert.assertTrue(platform.isHungup()); Assert.assertFalse(platform.isClosed()); }