In VoiceXML, prompts are not really played when the prompt element is executed, they are rather queued.
The prompts in the queue will be played only
- when the interpreter reaches a waiting state (e.g. recognition), or
- when the interpreter fetches a resource while a fetchaudio attribute is set on the corresponding fetch element.
More details in the VoiceXML 2.0 spec, 4.1.8 Prompt Queueing and Input Collection
As you see, there's no VoiceXML directive that you can use to explicitly flush the prompt queue. The trick is to specify a fetchaudio somewhere in order to satisfy #2.
So I would suggest that you force the prompt queue to be played by specifying a fetchaudio
attribute on the subdialog
element. Since you don't really want to hear the fetchaudio, it can be a 10ms silence audio file.
<block>
<prompt>
<audio src="audio/very_long_message.wav">
</prompt>
</block>
<subdialog src="osdm/custom" fetchaudio="audio/10ms_silence.wav"/>
...
</subdialog>
Note that the user won't be able to barge-in during the long prefix prompt but will be able to do so in the OSDM subdialog.