JVoiceXmlPromptAccumulator implements PromptAccumulator { @Override public void renderPrompts(final String sessionId, final DocumentServer server, final CallControlProperties callProps) throws BadFetchError, NoresourceError, ConnectionDisconnectHangupEvent { final CallControl call = platform.getCallControl(); if (!call.isCallActive()) { throw new NoresourceError( "cannot render prompts. call is no longer active"); } final SystemOutput output = platform.getSystemOutput(); for (SpeakableText speakable : prompts) { if (speakable instanceof SpeakableSsmlText) { final SpeakableSsmlText ssmlSpeakable = (SpeakableSsmlText) speakable; final long currentTimeout = ssmlSpeakable.getTimeout(); if (currentTimeout >= 0) { timeout = currentTimeout; } } try { call.play(output, callProps); } catch (IOException e) { throw new BadFetchError("error playing to calling device", e); } output.queueSpeakable(speakable, sessionId, server); } prompts.clear(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("timeout after prompt queuing: " + timeout); } } JVoiceXmlPromptAccumulator(
            final ImplementationPlatform implementationPlatform); @Override void startPromptQueuing(final long promptTimeout); long getPromptTimeout(); @Override void queuePrompt(final SpeakableText speakable); SpeakableText getLastSpeakableText(); @Override void renderPrompts(final String sessionId,
            final DocumentServer server, final CallControlProperties callProps);  }
@Test public void testRenderPrompts() throws Exception, JVoiceXMLEvent { final SsmlDocument ssml1 = new SsmlDocument(); final Speak speak1 = ssml1.getSpeak(); speak1.addText("this is a test"); final SpeakableText speakable1 = new SpeakableSsmlText(ssml1); accumulator.queuePrompt(speakable1); final SsmlDocument ssml2 = new SsmlDocument(); final Speak speak2 = ssml2.getSpeak(); speak2.addText("this is another test"); final SpeakableSsmlText speakable2 = new SpeakableSsmlText(ssml2); final long timeout = 40; speakable2.setTimeout(timeout); accumulator.queuePrompt(speakable2); final CallControlProperties props = new CallControlProperties(); accumulator.renderPrompts(null, null, props); Assert.assertEquals(timeout, accumulator.getPromptTimeout()); }