Record user response
Posted: Fri Sep 08, 2017 3:06 pm
Hi, is there a way to record the user's response to a prompt? I have tried the below but it just causes an error.
Code: Select all
<property name="inputmodes" value="dtmf+voice"/>
<var name="recorded_message"/>
<form id="acct_status">
<record name="myrecording" type="audio/x-wav" maxtime="300s" finalsilence="30s" beep="true" dtmfterm="true">
<block>
<prompt>
<speak xml:lang="<?=$lang?>"><voice name="'<?=$TTS[$lang]?>'">
When you say “Yes” to the following prompt your payment will be authorized. To cancel this transaction say “No”.
Please wait for the beep to record your response.
</voice></speak>
</prompt>
</block>
<field name="mainmenu">
<grammar type="application/srgs+xml" root="ROOT" mode="voice">
<rule id="ROOT">
<one-of>
<item>yes</item>
<item>no</item>
</one-of>
</rule>
</grammar>
<prompt>
<speak xml:lang="<?=$lang?>">
<voice name="'<?=$TTS[$lang]?>'">
Are you authorizing [CompanyNameHere] to initiate an electronic payment from your [AcctType] account,
ending in [Last4Digits] on [Date] for the amount of $[Amount]?
</voice>
</speak>
</prompt>
<filled>
<assign name="recorded_message" expr="myrecording"/>
<if cond="mainmenu=='yes'">
<prompt>You confirmed your payment. <value expr="recorded_message"/></prompt>
<submit next="http://11989d89.ngrok.io/api/IVR/saverecording" namelist="recorded_message" method="post" enctype="multipart/form-data"/>
<elseif cond="mainmenu==2"/>
<prompt>You candled your payment. <value expr="recorded_message"/></prompt>
<goto next="end.php"/>
</if>
</filled>
</record>
</field>
</form>