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

User Interaction with DTMF and Speech in the same VXML

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Hello ,

I was going through PlumVoice dev Documentation and trying to understand how i can implement below script where user can either press DTMF key or Speak the number to proceed further.

Script example -

For sales, press 1 or say sales.
For tech support, press 2 or say support.
For company directory, press 3 or say directory.

I am referring below code from PlumVoice tutorial, but i do not see how it is possible to implement until i add
<grammar type="application/x-jsgf" mode="voice"> one|two|three </grammar>

How can i add "AND" condition here like mode ="VOICE" AND mode ="DTMF". How is the below code working from PlumVoice tutorial?

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

  <form>
    <block>
      <prompt>
         Welcome to Plum Voice.
      </prompt>
      <goto next="#mainmenu"/>
    </block>
  </form>

  <menu id="mainmenu">
    <prompt>
      For sales, press 1 or say sales.
      For tech support, press 2 or say support.
      For company directory, press 3 or say directory.
    </prompt>
    <choice dtmf="1" next="#sales">
       Sales</choice>
    <choice dtmf="2" next="#support">
       Tech Support</choice>
    <choice dtmf="3" next="#directory">
       Company Directory</choice>
  </menu>

  <form id="sales">
    <block>
      Please hold for the next available sales
      representative.
      <!-- transfer to sales -->
    </block>
  </form>

  <form id="support">
    <block>
      <!-- transfer to tech support -->
    </block>
  </form>

  <form id="directory">
    <block>
      <!-- transfer to company directory -->
    </block>
  </form>

</vxml>
Also, the second part of question is, I am trying to validate a user from its AccountID resides in our Database. If user's Account ID is valid but not subscribed for any of our services we would like to throw error message otherwise we would like to validate the account ID first and then see which service user has subscribed for and then accordingly play script using GOTO statement.

It would be a great help if you can refer or point me how to use "and" clause in if statement, below is the code for your reference.

Code: Select all

<form id="validate_caller">
      <subdialog name="result" namelist="AccountID" method="post" src="http://AbsoluePathofOurServer/validatecaller.aspx"/>
      <block>
         <if cond="result.valid" and "result.service" == 1>
            <goto next="#valid_caller_Service1"/>
         <else/>
		 <if cond="result.valid" and "result.service" == 3>
            <goto next="#valid_caller_Service3"/>
         <else/>
            <goto next="#invalid_caller"/>
         </if>
      </block>
   </form>

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

Re: User Interaction with DTMF and Speech in the same VXML

Post by support »

Hey,

Multiple grammars can be added to a single form input. In this way, we could add both the DTMF and the voice grammars to the input, like such:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
	<form>
		<field name="selection">
			<grammar type="application/srgs+xml" root="voice_options" mode="voice">
				<rule id="voice_options">
					<one-of>
						<item>sales</item>
						<item>support</item>
						<item>directory</item>
					</one-of>
				</rule>
			</grammar>
			<grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
				<rule id="dtmf_options">
					<one-of>
						<item>1</item>
						<item>2</item>
						<item>3</item>
					</one-of>
				</rule>
			</grammar>
			<prompt>
				For sales, press 1 or say sales.
				For tech support, press 2 or say support.
				For company directory, press 3 or say directory.
			</prompt>
			<filled>
				<if cond="selection == 1 || selection == 'sales'">
					<prompt>You selected sales.</prompt>
				<elseif cond="selection == 2 || selection == 'support'"/>
					<prompt>You selected support.</prompt>
				<elseif cond="selection == 3 || selection == 'directory'"/>
					<prompt>You selected directory.</prompt>
				</if>
			</filled>
		</field>
	</form>
</vxml>
This way you would be able to enter the dtmf value or say the spoken phrase and then use the or operator to check the value in the <filled> block.

To answer your question regarding using the AND operator within the <if> tags, you would do so as such (encoding && to &&):

Code: Select all

<if cond="result.valid && result.service == 1">
Please let us know if you have any additional questions.

Regards,
Plum Support

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Great, Thank You for your quick response. This certainly helps.
I will rewrite VXML as suggested. I will let you know if i have any other questions.

Thank You So much.

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Thank You, your previous suggestion helped a lot and i am able to proceed further. I have few more questions.
I am trying here is to first ask for selection and then record message for that particular selection.
So i have added 3 different block of <form>, one block is for your review <form id="sales">.

I have a global variable name="recordingtype", in the <form id="sales"> block i am asking user to record a message.

Questions ? ---->

1. I want user/caller to hear a Beep first and then start speaking, if i put beep="true" in record tag, is it going to take care of that?

2. I want user/caller to terminate his recording once he/she finished recording message, if i put dtmfterm="true" in record tag, is it going to take care of that?

3. Can i put both properties, Beep and DTMTTerm in same Record Tag like this
<record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">

4. I am re-playing User's Recording using this statement and then Submit the recording to our DB using below code -

<filled>
You've just recorded the following message: <value expr="recordingtype" expr="myrecording"/>
<submit next="http://AbsoluePathofOurServer/submitrecording.aspx" namelist="digitalID recordingtype myrecording" method="post" enctype="multipart/form-data"/>
</filled>

But if user did not like the recording and wants to re-record the message, how can i prompt something like this below before the <submit> tag.


<filled>
You've just recorded the following message: <value expr="recordingtype" expr="myrecording"/>

<prompt>
To Submit the Recording, press 1 or say Submit.
To Cancel the Recording, press 2 or say Cancel.
To Re-Record the Recording, press 3 or say Record.
</prompt>

And according to condition match (Using the code that you previously mentioned), I would Submit or Terminate or Go back to Recording again.

Please Help.

Thanks.

Code: Select all


<?xml version="1.0"?>
<vxml version="2.0">

<var name="recordingtype">

   <form>
      <field name="selection">
         <grammar type="application/srgs+xml" root="voice_options" mode="voice">
            <rule id="voice_options">
               <one-of>
                  <item>sales</item>
                  <item>support</item>
                  <item>directory</item>
               </one-of>
            </rule>
         </grammar>
         <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
            <rule id="dtmf_options">
               <one-of>
                  <item>1</item>
                  <item>2</item>
                  <item>3</item>
               </one-of>
            </rule>
         </grammar>
         <prompt>
            For sales, press 1 or say sales.
            For tech support, press 2 or say support.
            For company directory, press 3 or say directory.
         </prompt>
         <filled>
            <if cond="selection == 1 || selection == 'sales'">
               <prompt>You selected sales.</prompt>
            <elseif cond="selection == 2 || selection == 'support'"/>
               <prompt>You selected support.</prompt>
            <elseif cond="selection == 3 || selection == 'directory'"/>
               <prompt>You selected directory.</prompt>
            </if>
         </filled>
      </field>
   </form>

<form id="sales">

 <assign name="RecordingType" expr="recordingtype"/>

	<record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
		<!-- <record name="myrecording" type="audio/x-wav" beep="true"> -->
		<prompt bargein="true">
			<audio src="http://AbsoluePathofOurServer/Scripts/SalesMessage.wav">
				<voice name="Mike"> 
					Please record your Message for Sales Dept. Try speaking louder, hold the phone closer to your mouth. 
					Press any key when you are finished recording.
				</voice>
			</audio>
		</prompt>

  <filled>
	You've just recorded the following message: <value expr="recordingtype" expr="myrecording"/>
	<submit next="http://AbsoluePathofOurServer/submitrecording.aspx" namelist="AccountID recordingtype myrecording" method="post" enctype="multipart/form-data"/>
  </filled>

 </record>

 <goto next="#finish" />

 <disconnect/>

</form>

<form id="finish">
<block>
<prompt bargein="true">
<audio src="http://AbsoluePathofOurServer/Scripts/goodbye.wav">
<voice name="Mike">
  Thank you. Goodbye!
</voice>
</audio>
</prompt>
</block>
</form>

</vxml>


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

Re: User Interaction with DTMF and Speech in the same VXML

Post by support »

Hi,

To answer your questions:

1. Yes, setting the beep="true" attribute on the <record> tag will take care of playing the beep message to indicate that the recording is beginning.

2. Yes, setting the dtmfterm="true" property on the <record> tag will allow the caller to enter any key to terminate the recording.

3. Yes, you can include as many of the supported, optional attributes on the record tag as desired. These two together are very common.

4. When prompting the user to record a message and having them confirm the message there are a few areas where you want to pay close attention. Firstly, you must declare a variable that's either global to your application or at least global to the script in which you will be capturing the recording and playing it back to your caller. The reason for this is that once you leave the form with your <record> tag, you will need a way to reference the recording. Storing the recording in a global variable so that you can access it elsewhere is the easiest method to do so. Secondly, once you have gathered the recording, you will need to play the recording back to the caller and prompt them as to whether or not to accept or re-record the message. In the case where they accept, you can submit it to you server and all is well, but if they choose to re-record, you'll need to repeat the process of gathering the message, playing it back to them, and confirming the message is acceptable. We've included a sample script that does just this for you to use as a reference. This should be sufficient for you to modify as necessary to fit your needs.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<!-- declaring here make it global to this entire page -->
<var name="recorded_message"/>

<form id="record_feedback">
   <record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
      <prompt>Please record your message after the beep. Press any key when you are finished recording.</prompt>

      <filled>
         <assign name="recorded_message" expr="myrecording"/>
         <goto next="#confirm_recording"/>
      </filled>
   </record>
</form>

<form id="confirm_recording">
   <field name="recording_confirmation" type="boolean">
      <prompt>You recorded <value expr="recorded_message"/>. To confirm this message, press 1. To re-record, press 2.</prompt>

      <filled>
         <if cond="recording_confirmation">
            <!-- true (1) case -->
            <submit next="http://example.com" namelist="recorded_message" method="post" enctype="multipart/form-data"/>
         <else/>
            <!-- false (2) case -->
            <goto next="#record_feedback"/>
         </if>
      </filled>
   </field>
</form>

</vxml>
Hopefully that helps. Please let us know if you have any additional question.

Regards,
Plum Support

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Thanks for the reply. From 1 to 3, it is ok.. but number 4, i have my doubts because our requirement is very complex.
I may have to send the whole vxml for your review and condition or Business Rules in details.. but no doubt it gave me a starting point.

Thanks again,

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Hello, As per your valuable suggestions and provided sample codes, i am trying to write an Auto Attendant Script which will be hooked up with an Inbound Line. When a callers call to that number, Caller will be greeted first then asked for a Selection, after caller selects for Self Service, we will be validating caller by it's account ID present in our DB and also if caller's services are stale or not. If all goes well caller can go to Self service and can Choose only 1 service at a time out of 3 service that we offer.

Let's say we provide 3 services and under each service we have 4-5 service lines (child Services). For each service line Caller can record message and submit it to us.

I have few problems, may be minor but i could not figure out what i am doing wrong here in the below code. It is giving following error when i check my Call Logs.

Issue 1 ->

Error Details ->

Thu 24 Dec 2015 03:53:55 PM EST:

Click here to view saved VoiceXML script

GrammarManager::CreateGrammarFromString(application/srgs+xml):
---------
<?xml version='1.0'?>
<grammar root="voice_options" xml:lang="en-us" mode="voice">
<rule id="voice_options_6" scope="private"><one-of><item>Service</item><item>Sales</item><item>Support</item></one-of></rule>
</grammar>
---------
Message from ASR engine:
---------
SWI_PARSER_XML_SYNTAX_ERROR| XML grammar failed XML validation| SWIxendElement | Specified root rule not found in XML file 'STRING_GRAMMAR'
SWI_PARSER_GEN_ERROR| XML parse error| SWIgramHandlers::endElement | ... in XML file at line 4 char 11
---------
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
A serious error of type </speak>
---------
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>error.grammar.inlined</speak>
---------
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak> has occurred. Exiting. </speak>
---------
VXI::exit_element()
Newly queued prompts are now being played

Thu 24 Dec 2015 03:54:01 PM EST:
Call End Event
Ending session
Ending Session On Channel 74

VXML that is giving above error ->

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<!-- *************************************************************************** -->
<!--  Auto Attendant VXML -->
<!-- *************************************************************************** -->

<!-- declare page variables -->
<var name="AccountID"/>
<var name="RecordingType"/>
<var name="recorded_message"/>

<form id="introduction">
	 <block>
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/WelcomeIVRMessage.wav">
				 <voice name="crystal">
					 Hello, Welcome to Our Company, a Leader in XXX Solutions.
				 </voice>
			 </audio>
		 </prompt>
	  <goto next="#MainMenu"/>
	 </block>
</form>

<form id="MainMenu">
	 <field name="MainMenuselection">
		 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
			 <rule id="voice_options_6">
			     <one-of>
					 <item>Service</item>
					 <item>Sales</item>
					 <item>Support</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
			 <rule id="dtmf_options_6">
			     <one-of>
					 <item>1</item>
					 <item>2</item>
					 <item>3</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/MainMenuOptions.wav">
				 <voice name="crystal">
					 Please choose one of the following options
					 For Self Service, press 1 or say Service.
					 For Sales related queries, press 2 or say Sales.
					 For Application related Issues or Support, press 3 or say Support.
				 </voice>
			 </audio>
		 </prompt>
			
		 <filled>
			 <if cond="MainMenuselection == 1 || selection == 'Service'">
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#SelfService"/>
				<elseif cond="MainMenuselection == 2 || selection == 'Sales'"/>
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#Sales"/>
				 <elseif cond="MainMenuselection == 3 || selection == 'Support'"/>
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#Support"/>
			 </if>
		 </filled>
	 </field>
</form>

<!-- Record the callers Account ID -->
<form id="SelfService">
	 <field name="Account_ID" type="digits?length=5">
		 <prompt bargein="false" count="1">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg1.wav">
				 <voice name="crystal">
					 Please Enter your Account ID.
				 </voice>
			 </audio>
		 </prompt>
	  
	     <prompt bargein="true" count="2">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg2.wav">
				 <voice name="crystal">
					 Please Enter your five digit Account ID.
				 </voice>
			 </audio>
	     </prompt>
  
		 <prompt bargein="true" count="3">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg3.wav">
				 <voice name="crystal">
						 Your five digit Account ID can be found on your membership page at our website, Please Enter your five digit Account ID.
				 </voice>
			 </audio>
		 </prompt>
  
		 <filled>
			 <assign name="AccountID" expr="Account_ID"/>
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/YouEntered.wav">
						 <voice name="crystal">
							 You have entered <value expr="Account_ID"/>.
						 </voice>
					 </audio>		
				 </prompt>
			 <goto next="#validate_caller"/>
		 </filled>
  
		 <catch event="nomatch noinput" count="1,2">
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/NoMatchNoInputCount12.wav">
						 <voice name="crystal">
							Your input was not valid.
						 </voice>
					 </audio>
				 </prompt>
			 <reprompt/>
		 </catch>
  
		 <catch event="nomatch noinput" count="3">
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/NoMatchNoInputCount3.wav">
						 <voice name="crystal">
							 It seems you are having difficulty with your Account ID, Let me transfer you to our Support department. 
							 Please stay on the line while we connect you to the next available Support Analyst.
						 </voice>
				     </audio>
				 </prompt>
			 <goto next="#Support"/>
		 </catch>
 	 </field>
</form>

<!-- Validate callers Account ID -->
<form id="validate_caller">
	 <subdialog name="result" namelist="AccountID" method="post" src="http://AbsoluePathofOurServer/validatecaller.aspx"/>
		 <block>
			 <if cond="result.valid && result.service == 1">
				 <goto next="#valid_caller_Service1"/>
			 </if>
			 <if cond="result.valid && result.service == 3">
				 <goto next="#valid_caller_Service3"/>
			 </if>
			 <if cond="result.invalid || result.service != 3 || result.service != 1">
				<goto next="#invalid_caller"/>
			 </if>
		 </block>
</form>

<form id="invalid_caller">
	 <block>
		 <prompt bargein="true">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/InvalidCaller.wav">
				 <voice name="crystal">
					 Sorry, you do not have access to use our system.
				 </voice>
			 </audio>
		 </prompt>
	 <goto next="#Finish" />
	 <disconnect/>
	 </block>
</form>

<form id="valid_caller_Service1">
	 <block>
		 <prompt bargein="true">
		 <audio src="http://AbsoluePathofOurServer/WaveFiles/ValidCallerService1.wav">
			 <voice name="crystal">
				 You have been validated successfully, Our system indicates that You have subscribed for Service 1.
			 </voice>
		 </audio>
	 </prompt>
	 <goto next="#Service1menu" />
	 </block>
</form>

<form id="Service1menu">
	 <field name="Service1RecordingTypeSelection">
		 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
			 <rule id="voice_options_1">
			     <one-of>
					 <item>Welcome</item>
					 <item>Event</item>
					 <item>Cancellation</item>
					 <item>Followup</item>
					 <item>ABC</item>
					 <item>XYZ</item>
					 <item>Switch Service</item>
					 <item>Main Menu</item>
					 <item>Hangup</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
			 <rule id="dtmf_options_1">
			     <one-of>
					 <item>1</item>
					 <item>2</item>
					 <item>3</item>
					 <item>4</item>
					 <item>5</item>
					 <item>6</item>
					 <item>7</item>
					 <item>8</item>
					 <item>9</item>
			     </one-of>
			 </rule>
		 </grammar>
	 <prompt bargein="false">
		 <audio src="http://AbsoluePathofOurServer/WaveFiles/Service1MenuOptions.wav">
			 <voice name="crystal">
				 To record your personalised Welcome Message, Press 1 or say Welcome.
				 To record your personalised Event related Message, Press 2 or say Event.
				 To record your personalised Cancellation Message, Press 3 or say Cancellation.
				 To record your personalised Followup Message, Press 4 or say Followup.
				 To record your personalised ABC Message, Press 5 or say ABC.
				 To record your Provider Name, XYZ Press 6 or say XYZ.
				 To switch between services, Press 7 or say Switch Service.
				 To go back to the main menu, Press 8 or say Main Menu.
				 To terminate this call simply hang up or Press 9 or say Hangup.
			 </voice>
		 </audio>
	 </prompt>
		 <filled>
			 <if cond="Service1RecordingTypeSelection == 1 || selection == 'Welcome'">
			   <goto next="#Welcome"/>
			 <elseif cond="Service1RecordingTypeSelection == 2 || selection == 'Event'"/>
				<goto next="#Event"/>
			 <elseif cond="Service1RecordingTypeSelection == 3 || selection == 'Cancellation'"/>
				<goto next="#Cancellation"/>
			 <elseif cond="Service1RecordingTypeSelection == 4 || selection == 'Followup'"/>
				<goto next="#Followup"/>
			 <elseif cond="Service1RecordingTypeSelection == 5 || selection == 'ABC'"/>
				<goto next="#ABC"/>
			 <elseif cond="Service1RecordingTypeSelection == 6 || selection == 'XYZ'"/>
				<goto next="#XYZ"/>		   
			 <elseif cond="Service1RecordingTypeSelection == 7 || selection == 'Switch Service'"/>
			   <goto next="#SelfService"/>
			 <elseif cond="Service1RecordingTypeSelection == 8 || selection == 'Main Menu'"/>
			   <goto next="#MainMenu"/>
			 <elseif cond="Service1RecordingTypeSelection == 9 || selection == 'Hangup'"/>
			   <goto next="#Finish"/>
			 </if>
		 </filled>
	 </field>
</form>

<form id="Sales">
	 <transfer dest="tel:+1OURTELEPHONE;postd=EXTENSIONNUMBER">
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/TransferToSales.wav"> 
				 <voice name="crystal">
					 Please stay on the line while we connect you to the next available Sales Representitive.
				 </voice>
			 </audio>
		 </prompt>
	 </transfer>
</form>

<form id="Support">
	 <transfer dest="tel:+1OURTELEPHONE;postd=EXTENSIONNUMBER">
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/TransferToSupport.wav">
				 <voice name="crystal">
				 	 Please stay on the line while we connect you to the next available Support Analyst.
				 </voice>
			 </audio>
		 </prompt>
	 </transfer>
</form>

<form id="Finish">
	 <block>
		 <prompt bargein="true">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/goodbye.wav">
				 <voice name="crystal">
				     Thank you. Goodbye!
				 </voice>
			 </audio>
		 </prompt>
	 </block>
</form>

</vxml>
Issue 2 ->

I am inserting code for a Service Line called "Welcome" which is placed between <form id="Service1menu"> and <form id="Sales"> from the above code. I am asking caller to record a message for "Welcome" Service Line of Sevice 1. Once he finished recording, I need to save Callers AccountID, Service Line Type and Callers Recording as soon as he press 1 or say submit. I will be writing same kind of code for each service line.

When i am inserting code for a Service Line called "Welcome", The error for Issue 1 goes away and It gave me couple of other errors, listing few of them here -

DocumentParser::FetchDocument - Parse error in file "http://74.208.43.153:8080/starturl.aspx ... PROCESS!20", line 331, column 12 - Element 'field' is not valid for content model: '(#PCDATA|audio|enumerate|value|catch|help|noinput|nomatch|error|filled|grammar|prompt|property)*'
errno: 205 uri http://74.208.43.153:8080/starturl.aspx ... PROCESS!20
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
A serious error of type </speak>

DocumentParser::FetchDocument - Parse error in file "http://74.208.43.153:8080/starturl.aspx ... PROCESS!20", line 329, column 11 - Element 'record' is not valid for content model: '(#PCDATA|audio|enumerate|value|catch|help|noinput|nomatch|error|filled|grammar|link|option|prompt|property)*'
errno: 205 uri http://74.208.43.153:8080/starturl.aspx ... PROCESS!20
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
A serious error of type </speak>

Code that is giving error for a Service Line called Welcome which is placed between <form id="Service1menu"> and <form id="Sales">

Code: Select all

<form id="Welcome">
	 <!-- <assign name="RecordingType" expr="RecordingType"/> -->
	 <record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
			 <prompt bargein="true">
				 <audio src="http://AbsoluePathofOurServer/WaveFiles/Welcome.wav">
					 <voice name="crystal"> 
						 Please record your Welcome Message after the beep. Try speaking louder, hold the phone closer to your mouth.
						 Press any key when you are finished recording.
					 </voice>
				 </audio>
			 </prompt>
			 
		<field name="WelcomeMessageSelection">
			 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
				 <rule id="voice_options_2">
					 <one-of>
						 <item>Submit</item>
						 <item>Record</item>
						 <item>Cancel</item>
						 <item>Replay</item>		  
					 </one-of>
				 </rule>
			 </grammar>
			 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
				 <rule id="dtmf_options_2">
					 <one-of>
						 <item>1</item>
						 <item>2</item>
						 <item>3</item>
						 <item>4</item>
					 </one-of>
				 </rule>
			 </grammar>
			 
			 <filled>
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/JustRecorded.wav">
						 <voice name="crystal">
							 You have just recorded the following message
						 </voice>
					 </audio>
				 </prompt>
				
				 <prompt bargein="true">
					<value expr="myrecording"/>
				 </prompt>
								
				 <prompt bargein="false">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/WelcomeCallMessageRecordingConfirmation.wav">
						 <voice name="crystal">
							 To Submit your personalised Welcome Message, Press 1 or say Submit.
							 To Re record your personalised Welcome Message, Press 2 or say Record.
							 To Cancel your personalised Welcome Message, Press 3 or say Cancel.
							 To Replay your personalised Welcome Message, Press 4 or say Replay.
						 </voice>
					 </audio>
				 </prompt>
								
					 <if cond="WelcomeMessageSelection == 1 || selection == 'Submit'">
						 <submit next="http://AbsoluePathofOurServer/submitrecording.aspx" namelist="digitalID RecordingType myrecording" method="post" enctype="multipart/form-data"/>
					 <elseif cond="WelcomeMessageSelection == 2 || selection == 'Record'"/>
					     <goto next="#Welcome"/>
					 <elseif cond="WelcomeMessageSelection == 3 || selection == 'Cancel'"/>
					     <goto next="#Service1menu"/>
					 <elseif cond="WelcomeMessageSelection == 4 || selection == 'Replay'"/>
						 <prompt bargein="true">
							 <audio src="http://AbsoluePathofOurServer/WaveFiles/JustRecorded.wav">
								 <voice name="crystal">
									 You have just recorded the following message 
								 </voice>
							 </audio>
						 </prompt>
				
						 <prompt bargein="true">
							 <value expr="myrecording"/>
						 </prompt>
					 </if>
			 </filled>
		</field>
	 </record>
	 <goto next="#Finish" />
	 <disconnect/>
</form>
As you suggested before that to keep Recording Part in a separate form and confirmation_Message on other form, in my case it may not be possible becausee i have to submit Service Line in the DB along with Recording + AccountID. So i have to Repeat Record Tag for each Service Line forms like i did in <form id="Welcome">.

Issue 3 - >

When user wants to RE-RECORD the message by pressing 2 or saying record.

I wrote this piece of code which i am pretty sure is wrong.

<elseif cond="WelcomeMessageSelection == 2 || selection == 'Record'"/>
<goto next="#Welcome"/>

So what i am trying here is, Within the <form id="Welcome">, if Caller did not like the message he recorded and wants to RE-record, i want him to start over and record in the same <form id="Welcome">. Go to is like to anchor tag, wish it can go to line number instead. Please guide me How can i write something like this.

Issue 4 ->

I am trying to validate caller, in this code <form id="validate_caller">. I am trying to validate that if User has a valid Account ID and also Subscribed for any one of the Service out of 3 that we offer. Even if the Account ID is valid but Service Subscription is Stale (Failed) or AccountID is invalid, then we have to throw error. Please guide me how to do grouping in IF condition. <if cond="result (is Valid but result.service != 3 || result.service != 1)" or result is inValid).

Code: Select all

<form id="validate_caller">
	<subdialog name="result" namelist="AccountID" method="post" src="http://AbsoluePathofOurServer/validatecaller.aspx"/>
	<block>
	<if cond="result.valid && result.service == 1">
        <goto next="#valid_caller_Service1"/>
	</if>
	<if cond="result.valid && result.service == 3">
	<goto next="#valid_caller_Service3"/>
	</if>
	<if cond="result (is Valid but result.service != 3 || result.service != 1)" or result is inValid) --> need grouping here.
	<goto next="#invalid_caller"/>
	 </if>
        </block>
</form>
Hope i am detailed enough to present my problems to you, Please help.

Here is the full vxml for your review.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<!-- *************************************************************************** -->
<!--  Auto Attendant VXML -->
<!-- *************************************************************************** -->

<!-- declare page variables -->
<var name="AccountID"/>
<var name="RecordingType"/>
<var name="recorded_message"/>

<form id="introduction">
	 <block>
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/WelcomeIVRMessage.wav">
				 <voice name="crystal">
					 Hello, Welcome to Our Company, a Leader in XXX Solutions.
				 </voice>
			 </audio>
		 </prompt>
	  <goto next="#MainMenu"/>
	 </block>
</form>

<form id="MainMenu">
	 <field name="MainMenuselection">
		 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
			 <rule id="voice_options_6">
			     <one-of>
					 <item>Service</item>
					 <item>Sales</item>
					 <item>Support</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
			 <rule id="dtmf_options_6">
			     <one-of>
					 <item>1</item>
					 <item>2</item>
					 <item>3</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/MainMenuOptions.wav">
				 <voice name="crystal">
					 Please choose one of the following options
					 For Self Service, press 1 or say Service.
					 For Sales related queries, press 2 or say Sales.
					 For Application related Issues or Support, press 3 or say Support.
				 </voice>
			 </audio>
		 </prompt>
			
		 <filled>
			 <if cond="MainMenuselection == 1 || selection == 'Service'">
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#SelfService"/>
				<elseif cond="MainMenuselection == 2 || selection == 'Sales'"/>
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#Sales"/>
				 <elseif cond="MainMenuselection == 3 || selection == 'Support'"/>
			     <!-- <prompt>You selected.</prompt> -->
					 <goto next="#Support"/>
			 </if>
		 </filled>
	 </field>
</form>

<!-- Record the callers Account ID -->
<form id="SelfService">
	 <field name="Account_ID" type="digits?length=5">
		 <prompt bargein="false" count="1">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg1.wav">
				 <voice name="crystal">
					 Please Enter your Account ID.
				 </voice>
			 </audio>
		 </prompt>
	  
	     <prompt bargein="true" count="2">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg2.wav">
				 <voice name="crystal">
					 Please Enter your five digit Account ID.
				 </voice>
			 </audio>
	     </prompt>
  
		 <prompt bargein="true" count="3">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/SelfServiceMsg3.wav">
				 <voice name="crystal">
						 Your five digit Account ID can be found on your membership page at our website, Please Enter your five digit Account ID.
				 </voice>
			 </audio>
		 </prompt>
  
		 <filled>
			 <assign name="AccountID" expr="Account_ID"/>
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/YouEntered.wav">
						 <voice name="crystal">
							 You have entered <value expr="Account_ID"/>.
						 </voice>
					 </audio>		
				 </prompt>
			 <goto next="#validate_caller"/>
		 </filled>
  
		 <catch event="nomatch noinput" count="1,2">
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/NoMatchNoInputCount12.wav">
						 <voice name="crystal">
							Your input was not valid.
						 </voice>
					 </audio>
				 </prompt>
			 <reprompt/>
		 </catch>
  
		 <catch event="nomatch noinput" count="3">
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/NoMatchNoInputCount3.wav">
						 <voice name="crystal">
							 It seems you are having difficulty with your Account ID, Let me transfer you to our Support department. 
							 Please stay on the line while we connect you to the next available Support Analyst.
						 </voice>
				     </audio>
				 </prompt>
			 <goto next="#Support"/>
		 </catch>
 	 </field>
</form>

<!-- Validate callers Account ID and the Services he subscribed for-->

<form id="validate_caller">
	<subdialog name="result" namelist="AccountID" method="post" src="http://AbsoluePathofOurServer/validatecaller.aspx"/>
	<block>
	<if cond="result.valid && result.service == 1">
        <goto next="#valid_caller_Service1"/>
	</if>
	<if cond="result.valid && result.service == 3">
	<goto next="#valid_caller_Service3"/>
	</if>
	<if cond="result (is Valid but result.service != 3 || result.service != 1)" or result is inValid) --> need grouping here.
	<goto next="#invalid_caller"/>
	 </if>
        </block>
</form>

<form id="invalid_caller">
	 <block>
		 <prompt bargein="true">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/InvalidCaller.wav">
				 <voice name="crystal">
					 Sorry, you do not have access to use our system.
				 </voice>
			 </audio>
		 </prompt>
	 <goto next="#Finish" />
	 <disconnect/>
	 </block>
</form>

<form id="valid_caller_Service1">
	 <block>
		 <prompt bargein="true">
		 <audio src="http://AbsoluePathofOurServer/WaveFiles/ValidCallerService1.wav">
			 <voice name="crystal">
				 You have been validated successfully, Our system indicates that You have subscribed for Service 1.
			 </voice>
		 </audio>
	 </prompt>
	 <goto next="#Service1menu" />
	 </block>
</form>

<form id="Service1menu">
	 <field name="Service1RecordingTypeSelection">
		 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
			 <rule id="voice_options_1">
			     <one-of>
					 <item>Welcome</item>
					 <item>Event</item>
					 <item>Cancellation</item>
					 <item>Followup</item>
					 <item>ABC</item>
					 <item>XYZ</item>
					 <item>Switch Service</item>
					 <item>Main Menu</item>
					 <item>Hangup</item>
			     </one-of>
			 </rule>
		 </grammar>
		 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
			 <rule id="dtmf_options_1">
			     <one-of>
					 <item>1</item>
					 <item>2</item>
					 <item>3</item>
					 <item>4</item>
					 <item>5</item>
					 <item>6</item>
					 <item>7</item>
					 <item>8</item>
					 <item>9</item>
			     </one-of>
			 </rule>
		 </grammar>
	 <prompt bargein="false">
		 <audio src="http://AbsoluePathofOurServer/WaveFiles/Service1MenuOptions.wav">
			 <voice name="crystal">
				 To record your personalised Welcome Message, Press 1 or say Welcome.
				 To record your personalised Event related Message, Press 2 or say Event.
				 To record your personalised Cancellation Message, Press 3 or say Cancellation.
				 To record your personalised Followup Message, Press 4 or say Followup.
				 To record your personalised ABC Message, Press 5 or say ABC.
				 To record your Provider Name, XYZ Press 6 or say XYZ.
				 To switch between services, Press 7 or say Switch Service.
				 To go back to the main menu, Press 8 or say Main Menu.
				 To terminate this call simply hang up or Press 9 or say Hangup.
			 </voice>
		 </audio>
	 </prompt>
		 <filled>
			 <if cond="Service1RecordingTypeSelection == 1 || selection == 'Welcome'">
			   <goto next="#Welcome"/>
			 <elseif cond="Service1RecordingTypeSelection == 2 || selection == 'Event'"/>
				<goto next="#Event"/>
			 <elseif cond="Service1RecordingTypeSelection == 3 || selection == 'Cancellation'"/>
				<goto next="#Cancellation"/>
			 <elseif cond="Service1RecordingTypeSelection == 4 || selection == 'Followup'"/>
				<goto next="#Followup"/>
			 <elseif cond="Service1RecordingTypeSelection == 5 || selection == 'ABC'"/>
				<goto next="#ABC"/>
			 <elseif cond="Service1RecordingTypeSelection == 6 || selection == 'XYZ'"/>
				<goto next="#XYZ"/>		   
			 <elseif cond="Service1RecordingTypeSelection == 7 || selection == 'Switch Service'"/>
			   <goto next="#SelfService"/>
			 <elseif cond="Service1RecordingTypeSelection == 8 || selection == 'Main Menu'"/>
			   <goto next="#MainMenu"/>
			 <elseif cond="Service1RecordingTypeSelection == 9 || selection == 'Hangup'"/>
			   <goto next="#Finish"/>
			 </if>
		 </filled>
	 </field>
</form>

<form id="Welcome">
	 
	 <record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
			 <prompt bargein="true">
				 <audio src="http://AbsoluePathofOurServer/WaveFiles/Welcome.wav">
					 <voice name="crystal"> 
						 Please record your Welcome Message after the beep. Try speaking louder, hold the phone closer to your mouth.
						 Press any key when you are finished recording.
					 </voice>
				 </audio>
			 </prompt>
			 
		<field name="WelcomeMessageSelection">
			 <grammar type="application/srgs+xml" root="voice_options" mode="voice">
				 <rule id="voice_options_2">
					 <one-of>
						 <item>Submit</item>
						 <item>Record</item>
						 <item>Cancel</item>
						 <item>Replay</item>		  
					 </one-of>
				 </rule>
			 </grammar>
			 <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
				 <rule id="dtmf_options_2">
					 <one-of>
						 <item>1</item>
						 <item>2</item>
						 <item>3</item>
						 <item>4</item>
					 </one-of>
				 </rule>
			 </grammar>
			 
			 <filled>
				 <prompt bargein="true">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/JustRecorded.wav">
						 <voice name="crystal">
							 You have just recorded the following message
						 </voice>
					 </audio>
				 </prompt>
				
				 <prompt bargein="true">
					<value expr="myrecording"/>
				 </prompt>
								
				 <prompt bargein="false">
					 <audio src="http://AbsoluePathofOurServer/WaveFiles/WelcomeCallMessageRecordingConfirmation.wav">
						 <voice name="crystal">
							 To Submit your personalised Welcome Message, Press 1 or say Submit.
							 To Re record your personalised Welcome Message, Press 2 or say Record.
							 To Cancel your personalised Welcome Message, Press 3 or say Cancel.
							 To Replay your personalised Welcome Message, Press 4 or say Replay.
						 </voice>
					 </audio>
				 </prompt>
								
					 <if cond="WelcomeMessageSelection == 1 || selection == 'Submit'">
						 <submit next="http://AbsoluePathofOurServer/submitrecording.aspx" namelist="digitalID RecordingType myrecording" method="post" enctype="multipart/form-data"/>
					 <elseif cond="WelcomeMessageSelection == 2 || selection == 'Record'"/>
					     <goto next="#Welcome"/>
					 <elseif cond="WelcomeMessageSelection == 3 || selection == 'Cancel'"/>
					     <goto next="#Service1menu"/>
					 <elseif cond="WelcomeMessageSelection == 4 || selection == 'Replay'"/>
						 <prompt bargein="true">
							 <audio src="http://AbsoluePathofOurServer/WaveFiles/JustRecorded.wav">
								 <voice name="crystal">
									 You have just recorded the following message 
								 </voice>
							 </audio>
						 </prompt>
				
						 <prompt bargein="true">
							 <value expr="myrecording"/>
						 </prompt>
					 </if>
			 </filled>
		</field>
	 </record>
	 <goto next="#Finish" />
	 <disconnect/>
</form>

<form id="Sales">
	 <transfer dest="tel:+1OURTELEPHONE;postd=EXTENSIONNUMBER">
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/TransferToSales.wav">
				 <voice name="crystal">
					 Please stay on the line while we connect you to the next available Sales Representitive.
				 </voice>
			 </audio>
		 </prompt>
	 </transfer>
</form>

<form id="Support">
	 <transfer dest="tel:+1OURTELEPHONE;postd=EXTENSIONNUMBER">
		 <prompt bargein="false">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/TransferToSupport.wav"> 
				 	 Please stay on the line while we connect you to the next available Support Analyst.
				 </voice>
			 </audio>
		 </prompt>
	 </transfer>
</form>

<form id="Finish">
	 <block>
		 <prompt bargein="true">
			 <audio src="http://AbsoluePathofOurServer/WaveFiles/goodbye.wav">
				 <voice name="crystal">
				     Thank you. Goodbye!
				 </voice>
			 </audio>
		 </prompt>
	 </block>
</form>

</vxml>

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

I would really appreciate if i get any help/response on my last post/queries/Questions.
Please guide.

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

Re: User Interaction with DTMF and Speech in the same VXML

Post by support »

Hi,

Regarding your first issue. This is a mismatch between the root attribute set in your grammar tag and the id attribute of the rule you definied for your grammar:

Code: Select all

<grammar type="application/srgs+xml" root="voice_options" mode="voice">
             <rule id="voice_options_2">
needs to be:

Code: Select all

<grammar type="application/srgs+xml" root="voice_options_2" mode="voice">
             <rule id="voice_options_2">
Regarding your second issues, these are simply tags being misplaced. You should be able to use the vxml validator to locate these general tag mismatches and tags that aren't valid for the context model. To do so, in the Application Configuration menu, where you specify the settings for an application assigned to a phone number, you can click the 'Validate' button and it will display these types of errors.

When a tag is 'not valid in the context model' it means that that tag doesn't belong within the parent tag or child tag in which it is set. To see which child and parent tags apply to each tag, you can reference the tags documentation here:
http://www.plumvoice.com/docs/dev/voicexml:tags

When selecting a tag, you can see the Child Tags and Parent Tags sections which will give you an idea about in which context the tag is valid and can be used.

You can also submit multiple items to your scripts via the namelist by separating each by a space, for example:
<submit next="somescript.php" namelist="account_id recording something_else" method="post"/>

This will submit the variables by those names to the scipt, which can be accessed by those same names. You'll have to make sure your varaibles are accessible, normally by storing them in global variables, as displayed in our previous recording code snippet.

Regarding issue 3, please refer to our previous example regarding re-recording. This is the most common method for achieving this functionality.

Regarding issue 4, it's not entirely clear the business rules of your service, but if logic can be nested if needed, so you could do something like the following:

Code: Select all

<!-- first validate whether the account was valid -->
<if cond="result.valid">
	<!-- next check if your service matches specific allows values
	<if cond="result.service == 3"/>
		<!-- do something -->
	<elseif cond="result.service == 1"/>
		<!-- do something else -->
	<else/>
		<!-- did not match conditions, throw error or however you want to handle it -->
	</if>
<else/>
	<!-- account was not valid, branch on returned services as necessary -->
</if>
Hopefully that should help point you in the right direction.

Regards,
Plum Support

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

First of all, Thank you very much, your response was really helpful to fix some issues, However i have below clarifications.
Please guide.

Question on Issue 1 Response ->

Code: Select all

<grammar type="application/srgs+xml" root="voice_options" mode="voice">
          <rule id="voice_options_6">
              <one-of>
                <item>Service</item>
                <item>Sales</item>
                <item>Support</item>
              </one-of>
          </rule>
       </grammar>
       <grammar type="application/srgs+xml" root="dtmf_options" mode="dtmf">
          <rule id="dtmf_options_6">
              <one-of>
                <item>1</item>
                <item>2</item>
                <item>3</item>
              </one-of>
          </rule>
       </grammar> 
You suggested to match the root attribute that i set in my grammar tag and the id attribute of the rule that i defined for my grammar, I see example for voice_options only,

Code: Select all

 <grammar type="application/srgs+xml" root="voice_options_2" mode="voice">
             <rule id="voice_options_2">
Is this something needs to be done in the same way for dtmf_options as well, Like below -

Code: Select all

       <grammar type="application/srgs+xml" root="dtmf_options_6" mode="dtmf">
          <rule id="dtmf_options_6">
I am sure answer is yes, still confirming.

Also, i am using 2 block of grammar that is for voice and dtmf in one Form, so basically 12 grammar tags in the vxml. Scope of the grammar tag i believe in only to that form where it is defined, Right? am i doing right? I want to use different set of command in each form so in grammar tag the root="voice_options and root="dtmf_options should have unique name and so the corresponding Rule Id. Correct? Like your example for voice_options_2.

I think, i know the answer, it is Yes but still confirming :D

Question on Issue 2 Response ->

Regarding your second issues, these are simply tags being misplaced. You should be able to use the vxml validator to locate these general tag mismatches and tags that aren't valid for the context model. To do so, in the Application Configuration menu, where you specify the settings for an application assigned to a phone number, you can click the 'Validate' button and it will display these types of errors.

What and where i can find "vxml validator" tool, currently i am using Notepad++, please point if any other tool that will be helpful for rapid development without worrying about tag mismatch. Tool can suggest the Tags.
"Application Configuration menu" Is this available in the tool that you are referring?

I was going through the VXML that you provided on Mon Jun 02, 2003 3:47 pm. Below is the vxml.
Can you please help me to provide an example using the above code only, if i have to give the caller, the "speech" option as well.
Instead of "To confirm this message, press 1. To re-record, press 2.",
I would like to provide "To confirm this message, Say Confirm or press 1. To re-record, Say Re-Record or press 2."


Here is your code ->

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<!-- declaring here make it global to this entire page -->
<var name="recorded_message"/>

<form id="record_feedback">
   <record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
      <prompt>Please record your message after the beep. Press any key when you are finished recording.</prompt>
      <filled>
         <assign name="recorded_message" expr="myrecording"/>
         <goto next="#confirm_recording"/>
      </filled>
   </record>
</form>

<form id="confirm_recording">
   <field name="recording_confirmation" type="boolean">
      <prompt>You recorded <value expr="recorded_message"/>. To confirm this message, press 1. To re-record, press 2.</prompt>

      <filled>
         <if cond="recording_confirmation">
            <!-- true (1) case -->
            <submit next="http://example.com" namelist="recorded_message" method="post" enctype="multipart/form-data"/>
         <else/>
            <!-- false (2) case -->
            <goto next="#record_feedback"/>
         </if>
      </filled>
   </field>
</form>

</vxml>
This example will be a great help to me.

Question on Issue 3 Response -> Great Help, All Set.

Question on Issue 4 Response -> Great Help, All Set.

Thanks for all of your support.

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

Re: User Interaction with DTMF and Speech in the same VXML

Post by support »

Hi,

For issue 1, yes you will want the root attribute of the grammar to match the id attribute of the rule for DTMF as well.

For issue 2, our VXML Validator is located here: http://hosting.plumgroup.com/developer_ ... idator.php.

Note that you will have to log into your account to access the tool. You can copy your code into the validator, and it will return with feedback regarding any errors with your code.

For your particular issue, the reason you are seeing a "not valid for content model" error is because you are placing tags where they are not allowed. For example, you tried to use a <field> tag inside a <record> tag. This is not valid VXML. You can use our documentation to find which child tags are allowed within a particular tag. For example, if you look at our documentation for the <record> tag, the allowed child tags are: <audio>, <catch>, etc.

Regards,
Plum Support

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

Thank you for pointing me to the ScracthPad (VXML Validator), I am not sure how i missed that. I would have saved a lot of time.

I will get back to you if i face any issues.

Thank You very much for all your support.

headpill
Posts: 40
Joined: Mon Aug 17, 2015 9:34 pm

Re: User Interaction with DTMF and Speech in the same VXML

Post by headpill »

I have resolved all the issues, using Scratchpad was helpful than Scratching my Head :lol: :lol: :lol:

Thank You So Much!

Post Reply