订阅者点击 # 时发生致命错误

发布于 2024-12-15 16:16:03 字数 4937 浏览 5 评论 0原文

我想要用户点击 # 后 IVR 控件返回主菜单。

但是当用户点击#时,它说发生了致命错误。

我是 IVR 域的新手,请帮助我。

<?xml version='1.0' encoding='iso-8859-1' ?>
<vxml application='http://intx.dev.spokn.com/airtelintx/global.vxml' version='2.0'>
  <log expr='[vxml_root_page] This log is after property element' />
  <property name='termchar' value=' '></property>
  <property name='inputmodes' value='dtmf'></property>
  <log expr='[vxml_root_page] This log is after property element' />
  <form id='main_menu'>
    <var expr='0' name='errorcount' />
    <var expr='3' name='maxerrors' />
    <field name='ivr_input'>
      <grammar mode='dtmf' root='main_choices' type='application/srgs+xml' version='1.0' xml:lang='en-US' xmlns='http://www.w3.org/2001/06/grammar'>
        <rule id='main_choices'>
          <one-of>
            <item>
              1
            </item>
            <item>
              2
            </item>
            <item>
              3
            </item>
            <item>
              #
            </item>
          </one-of>
        </rule>
      </grammar>
      <prompt>
        Choose which country you would like to go.
        For USA, press  1. 
        For UK, press 2. 
        For Canada, press  3. 
        Press # to return to the main menu.
      </prompt>
      <nomatch>
        <if cond='errorcount == maxerrors'>
          <goto next='#exit' />
          <else />
          <assign expr='errorcount + 1' name='errorcount' />
          Oops that was an invalid input
          <reprompt />
        </if>
      </nomatch>
      <noinput>
        <if cond='errorcount == maxerrors'>
          <goto next='#exit' />
          <else />
          <assign expr='errorcount + 1' name='errorcount' />
          No input detected. Please try again.
          <reprompt />
        </if>
      </noinput>
      <filled>
        <if cond='ivr_input == 1'>
          <log expr="'[vxml_reply] ivr_input choice 1, record'" />
          <log expr="'[vxml_reply] ivr_input choice 1, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == 2'>
          <log expr="'[vxml_reply] ivr_input choice 2, record'" />
          <log expr="'[vxml_reply] ivr_input choice 2, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == 3'>
          <log expr="'[vxml_reply] ivr_input choice 3, record'" />
          <log expr="'[vxml_reply] ivr_input choice 3, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == #'>
          <log expr="'[vxml_reply] ivr_input choice #, record'" />
          <log expr="'[vxml_reply] ivr_input choice #, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/main_menu.vxml'" namelist='ivr_input callerid' />
        </if>
      </filled>
    </field>
  </form>
  <error>
    <log>
      APP ERROR!!!
      <value expr='_event' />
    </log>
    A fatal error occurred. Please contact a customer service representative.
    <disconnect />
  </error>
  <catch event=''>
    <log>
      UNHANDLED EVENT!!!
      <value expr='_event' />
    </log>
    Sorry, there was a problem processing your request. Please try again later.
    <disconnect />
  </catch>
</vxml>

我想这应该可以完成工作,即分配 termchar 值“”,用户可以输入 # 作为输入。

<property name='termchar' value=' '></property>

我得到流动错误:=

swi:SBjsi|501|SBjsi:ECMAScript engine exception|errmsg=SyntaxError: illegal character|line=1|linetxt=ivr_input == #|tokentxt=#\n

I want the where, user clicks on the # and the IVR control goes back to main menu.

But when user clicks on # it say fatal error occurred.

I am newbie in IVR Domain please help me out.

<?xml version='1.0' encoding='iso-8859-1' ?>
<vxml application='http://intx.dev.spokn.com/airtelintx/global.vxml' version='2.0'>
  <log expr='[vxml_root_page] This log is after property element' />
  <property name='termchar' value=' '></property>
  <property name='inputmodes' value='dtmf'></property>
  <log expr='[vxml_root_page] This log is after property element' />
  <form id='main_menu'>
    <var expr='0' name='errorcount' />
    <var expr='3' name='maxerrors' />
    <field name='ivr_input'>
      <grammar mode='dtmf' root='main_choices' type='application/srgs+xml' version='1.0' xml:lang='en-US' xmlns='http://www.w3.org/2001/06/grammar'>
        <rule id='main_choices'>
          <one-of>
            <item>
              1
            </item>
            <item>
              2
            </item>
            <item>
              3
            </item>
            <item>
              #
            </item>
          </one-of>
        </rule>
      </grammar>
      <prompt>
        Choose which country you would like to go.
        For USA, press  1. 
        For UK, press 2. 
        For Canada, press  3. 
        Press # to return to the main menu.
      </prompt>
      <nomatch>
        <if cond='errorcount == maxerrors'>
          <goto next='#exit' />
          <else />
          <assign expr='errorcount + 1' name='errorcount' />
          Oops that was an invalid input
          <reprompt />
        </if>
      </nomatch>
      <noinput>
        <if cond='errorcount == maxerrors'>
          <goto next='#exit' />
          <else />
          <assign expr='errorcount + 1' name='errorcount' />
          No input detected. Please try again.
          <reprompt />
        </if>
      </noinput>
      <filled>
        <if cond='ivr_input == 1'>
          <log expr="'[vxml_reply] ivr_input choice 1, record'" />
          <log expr="'[vxml_reply] ivr_input choice 1, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == 2'>
          <log expr="'[vxml_reply] ivr_input choice 2, record'" />
          <log expr="'[vxml_reply] ivr_input choice 2, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == 3'>
          <log expr="'[vxml_reply] ivr_input choice 3, record'" />
          <log expr="'[vxml_reply] ivr_input choice 3, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/confirm_country.vxml'" namelist='ivr_input callerid' />
        </if>
        <if cond='ivr_input == #'>
          <log expr="'[vxml_reply] ivr_input choice #, record'" />
          <log expr="'[vxml_reply] ivr_input choice #, record'" />
          <log expr="'[vxml_reply] The calling Number callerid'">
            <value expr='callerid'></value>
          </log>
          <submit expr="application.apphost + application.appuri + '/ivr/main_menu.vxml'" namelist='ivr_input callerid' />
        </if>
      </filled>
    </field>
  </form>
  <error>
    <log>
      APP ERROR!!!
      <value expr='_event' />
    </log>
    A fatal error occurred. Please contact a customer service representative.
    <disconnect />
  </error>
  <catch event=''>
    <log>
      UNHANDLED EVENT!!!
      <value expr='_event' />
    </log>
    Sorry, there was a problem processing your request. Please try again later.
    <disconnect />
  </catch>
</vxml>

I guess this should do the work i.e. assigning termchar value " ", the user can enter # as input.

<property name='termchar' value=' '></property>

I get flowing Error :=

swi:SBjsi|501|SBjsi:ECMAScript engine exception|errmsg=SyntaxError: illegal character|line=1|linetxt=ivr_input == #|tokentxt=#\n

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤千羽 2024-12-22 16:16:04

在大多数平台上,“#”键是终止字符。这可以通过在应用程序中设置属性“termchar”来更改。如果您想查看用户是否按下了“termchar”,您可以使用影子变量“termchar”来查看他们按下的内容。有关此属性和影子变量的更多详细信息,您可以参考 VoiceXML 规范

On most platforms the "#" key is a termination character. This can be changed by setting the property "termchar" in you application. If you want to see if the user pressed a "termchar" you can use the shadow variable "termchar" to see what they pressed. For more details on this property and shadow variable you can reference the VoiceXML Specification.

哭泣的笑容 2024-12-22 16:16:04

标签内的 if 条件应该是

<if cond='ivr_input == '#''>

并且它工作正常。是的!!!

The if condition inside tag should be

<if cond='ivr_input == '#''>

And it works fine. yeah!!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文