Page 1 of 1

Problem with xml variables

Posted: Thu Dec 07, 2006 3:36 pm
by ntudor
I have a problem with a variable defined within xml not being posted correctly through to my application server. The value should be:

19703726648

but is received as:

19703726080.000000

The xml is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
  <property name="inputmodes" value="dtmf"/>
  <var name="pin" expr="0"/>
  <form>
    <block>
      <prompt>Hello, this is the system.  Someone from this phone registered to be notified about one of our red dot sales.  This sale has started.  If you would like to enter</prompt>
      <goto next="#pinentry"/>
    </block>
  </form>
  <form id="pinentry">
    <field name="id" type="digits?length=4">
      <prompt>Please type in the Pin you set when you called us earlier.</prompt>
      <filled>
        <assign name="pin" expr="id"/>
        <goto next="#continue"/>
      </filled>
    </field>
  </form>
  <form id="continue">
    <block>
      <var name="number" expr="19703726648"/>
      <submit method="post" next="http://servername.com/ivr/enter_phone" namelist="number pin"/>
    </block>
  </form>
</vxml>
Thanks,

Nick

IVR code- put value in single quotes to convert to a string

Posted: Fri Dec 08, 2006 9:38 am
by support
Hello,

This is a limitation of the Javascript interpreter. Since that is such a large number the only way to store it is as a float. However, since you are not performing arithmatic on the variable you can write IVR code by putting the value in single quotes to convert it to a string. Note that the expr for the <var> name, number, below has single quotes around it.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
  <property name="inputmodes" value="dtmf"/>
  <var name="pin" expr="0"/>
  <form>
    <block>
      <prompt>Hello, this is the system.  Someone from this phone registered to be notified about one of our red dot sales.  This sale has started.  If you would like to enter</prompt>
      <goto next="#pinentry"/>
    </block>
  </form>
  <form id="pinentry">
    <field name="id" type="digits?length=4">
      <prompt>Please type in the Pin you set when you called us earlier.</prompt>
      <filled>
        <assign name="pin" expr="id"/>
        <goto next="#continue"/>
      </filled>
    </field>
  </form>
  <form id="continue">
    <block>
      <!-- note the single quotes inside the double quotes -->
      <var name="number" expr="'19703726648'"/>
      <submit method="post" next="http://servername.com/ivr/enter_phone" namelist="number pin"/>
    </block>
  </form>
</vxml>
Regards,
Plum Support