We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

<break>, .wav file play back and grammar question

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
yunyun
Posts: 21
Joined: Mon Jan 23, 2006 8:31 pm

<break>, .wav file play back and grammar question

Post by yunyun »

1. This is how I use <break> tag:

Press star key ... <break time="1s" /> Press 9 ...

I got a error like this:

Element 'break' is not valid for content model:

When I remove <break> from the context, the problem goes away.

2. I record a message by <record> and post it to my server. I could see the wav file exsiting on my server. Then I want <audio src="..."/> to hear my message. I heard nothing.

3. I have a scenario like the following:
"Press star key at any time to back to main menu." (star key as a document grammar) Then I ask user to enter a 7-digit number. But right after I press star key after hearing "Press star key at any time to back to main menu." I still get to the part to enter a 7-digit number. After that pressing star will get me to the main menu.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR example using <break> tag

Post by support »

Hello,

You are describing several different IVR issues, in the future it would be best to post each one as a seperate question.

1. The break tag requires surrounding prompt tags, the IVR error you are seeing is stating that the element "<break>" can not be placed inside the IVR tags you currently have it. For IVR example:

INVALID:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.1">
	<form>
		<block>
			Hello<break time="1s"/>Goodbye
		</block>
	</form>
</vxml>
VALID:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.1">
	<form>
		<block>
			<prompt>
				Hello<break time="1s"/>Goodbye
			</prompt>
		</block>
	</form>
</vxml>
2. The best method for playing back recordings is to play them in their filled block and then perform the POST:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.1">
	<form>
		<record name="the_recording" beep="true">
			<prompt>
				Please record your message after the beep.
			</prompt>
			<filled>
				<prompt>
					I heard <value expr="the_recording"/>
				</prompt>
				<submit next="someurl.php" namelist="the_recording" method="post" enctype="multipart/form-data"/>
			</filled>
		</record>
	</form>
</vxml>
3. This question is a little more tricky, it would be helpful if you could provide a simplified example. It sounds like the prompt "Press the star key at any time to get back to the main menu" is either not bargeable (i.e. - bargein="false") or it is on a different page than the prompt asking for the user to enter a 7-digit number. If this is not a sufficient answer please reply with a simplfied example.

Regards,
Plum Support
Last edited by support on Thu Feb 25, 2010 2:37 pm, edited 3 times in total.

yunyun
Posts: 21
Joined: Mon Jan 23, 2006 8:31 pm

Post by yunyun »

Thank you for the quick reply.

2. I wanted to record a message from the user, post it to my server, store the wav file as the same directory as VXML file and then play it back later. The case is that I need to put the <audio> tag in a diffrent form. How can I play it correctly?

3. The following example is similar to what I did:
<?xml version="1.0"?>
<vxml version="2.1">
<link next="mainMenu.vxml">
<grammar>"*"</grammar>
</link>
<form>
<block>
<prompt>
Press star key at any time to back to the main menu
Press 9 at any time for the options menu
</prompt>
<goto next="getNumber.vxml" />
</block>
</form>
</vxml>

Even if I press star right after the call is connected, I still hear the prompt asking for a 7-digit number. At this point, pressing star will work.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Only way to guarentee IVR sys actively listens for input

Post by support »

Hello,

The majority of the work required for item 2 is on your server scripting side. You need to accept a multipart/form-data POST on your IVR server, move the file that is provided to a publicly accessible location and then provide that URL back to our IVR platform. Some things to consider are the audio encoding type you are specifying to the <record> tag, and if you are not you need to make sure that you rename the file (and possibly reconfigure your web server) so that the correct mime type is sent back by your web server.

For item 3 there is no reason to separate out this document from the rest of your IVR code, it should just be the first form on the getNumber.vxml file and should do a local <goto src="#some_form_id"/>. This is the only way to guarantee that the IVR system will be actively listening for input when you are playing back audio.

Regards,
Plum Support
Last edited by support on Thu Feb 25, 2010 2:51 pm, edited 2 times in total.

yunyun
Posts: 21
Joined: Mon Jan 23, 2006 8:31 pm

Post by yunyun »

Thank you for the information.

For the wav file playing back problem, I did everything you mentioned in the reply including accepting the post and renaming. The only thing I'm not quite sure is the <record> tag. Here is the statement.

<record name="userNote" beep="true" maxtime="60s" finalsilence="1.5s" type="audio/wav">

In fact, I put my code on BeVocal voice portal and everything works fine.

For item 3, I need to put the getNumber form at a separate jsp file since I need to access this form from other jsp file. It seems that wouldn't work out to access some form in the middle of a jsp file.

yunyun
Posts: 21
Joined: Mon Jan 23, 2006 8:31 pm

Post by yunyun »

And this is my log message:

bargein set to true
INPUTMODES set to "DTMF VOICE"
Using proxy server 127.0.0.1:8080 for channel 18
Attempting to fetch http://some-company.com:8080/some-file.wav
Audio segment from the URL audioFiles/R20_2006_01_26_17_17_22_431094.wav added to prompt queue
File: audioFiles/R20_2006_01_26_17_17_22_431094.wav not WAV/RIFF format
Unrecognized format in pvxPromptConvertCopySource
Failure during pvxPromptConvertCopySource
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:

yunyun
Posts: 21
Joined: Mon Jan 23, 2006 8:31 pm

Post by yunyun »

I changed the type property to audio/x-wav then I could hear my recorded messages.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

specify audio type in <record> or IVR platform default

Post by support »

If you don't specify the audio encoding type in the <record> tag, the IVR platform will default to u-law. So if you want a .wav file to be recorded instead, you did the correct thing by explicitly stating that you want the file to be recorded as "audio/x-wav"

Post Reply