平台:沙盒测试场所
我想再添加一组片段
下面的代码片段将从呼叫者那里获取手机号码,并将呼叫者输入的号码发布到另一个页面,代码工作正常,
但我想检查表中的那个号码并提取“输入的电话号码详细信息”,即在 contact_tbl 中保存电话号码、名字、姓氏、地址,现在我想为给定的电话号码提取这些详细信息。
<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<vxml version = "2.1">
<meta name="maintainer" content="your_email_address@wherever.com"/>
<property name="inputmodes" value="dtmf" />
<form id="get_mobile_no">
<field name="mobileno" type="digits?minlength=10;maxlength=10">
<prompt>
<prosody rate="slow"> please enter your 10 digit mobile number !</prosody>
</prompt>
<!--INVALID-->
<nomatch count = "1">
<prompt>
<prosody rate="slow"> Is that a number? Please try again. </prosody>
</prompt>
<reprompt/>
</nomatch>
<!--TIMEOUT-->
<noinput count = "1">
<prompt>Again, please enter your 10 digit mobile number !</prompt>
<reprompt/>
</noinput>
<catch event="noinput nomatch" count="3">
<prompt>Please try again later. Good bye.</prompt>
<exit/> </catch>
<filled>
<prompt>
<prosody rate="slow"> you said
<value expr="mobileno"/>
! Thanks for calling, you may now hang up.</prosody>
</prompt>
</filled>
</field>
<block name="sendData">
<prompt>Entering entering...</prompt>
<submit next="get_dtmf_ip.php" namelist="mobileno" method="post" />
</block>
</form>
</vxml>
示例 VXML ivr 应用程序,它从用户那里获取输入并播放呼叫者输入的号码。
下面的代码工作正常,但是当我删除语法标签时,它会播放一些错误代码,我无法跟踪该错误代码。
现在我想做一点改变,那个用户可以输入多个数字。
来电者必须输入他们的手机号码。
如何更改代码以接受多个号码。
<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<vxml version = "2.1">
<meta name="maintainer" content="your_email_address@wherever.com"/>
<form id="guessNumber">
<field name="guess">
<grammar type="text/gsl">
[dtmf-1 dtmf-2 dtmf-3 dtmf-4 dtmf-5 dtmf-6 dtmf-6 dtmf-7 dtmf-8 dtmf-9]
</grammar>
<prompt>
<prosody rate="slow">
Guess what the computer is thinking! Pick a number between 0 and 9.
</prosody>
</prompt>
<nomatch>
<prompt>
<prosody rate="slow">
Is that a number? Please try again.
</prosody>
</prompt>
<reprompt/>
</nomatch>
<filled>
<prompt>
<prosody rate="slow">
you said
<value expr="guess"/>
!
</prosody>
</prompt>
</filled>
</field>
</form>
</vxml>