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

Problem with xml variables

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
ntudor
Posts: 1
Joined: Thu Dec 07, 2006 10:44 am

Problem with xml variables

Post 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

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

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

Post 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

Post Reply