Page 1 of 1
Problem with transfer using a variable for the phone number
Posted: Tue Apr 18, 2006 5:05 pm
by always24x7
I am attempting to transfer a call to a phone number that is in a variable.
When the following code is executed, it treats the phone number like a very large number in scientific notation. ie: 1.81796e61.
How do I get it to treat it as a string or a list of digits?
Thanks
<form id="transfer">
<var name="dest_num"/>
<block>
<assign name="dest_num" expr="18179661716"/>
</block>
<transfer dest="dest_num">
<prompt>
Transferring to
<say-as type="acronym">
<value expr="dest_num"/>
</say-as>.
</prompt>
</transfer>
</form>
IVR script for use of destexpr attribute
Posted: Tue Apr 18, 2006 11:31 pm
by support
Hello,
To use an ECMAScript variable as the destination for the IVR tag,
<transfer>, you should use the destexpr attribute, not the dest attribute. For IVR example:
Code: Select all
<form id="transfer">
<var name="dest_num"/>
<block>
<assign name="dest_num" expr="18179661716"/>
</block>
<transfer destexpr="dest_num">
<prompt>
Transferring to
<say-as type="acronym">
<value expr="dest_num"/>
</say-as>.
</prompt>
</transfer>
</form>
Hope this helps.
Regards,
Plum Support
Posted: Wed Apr 19, 2006 7:47 am
by always24x7
Actually, I used the destexpr attribute first, since I copied it from an example.
The code I included was an alternate attempt that I forgot to change back.
Neither appears to work.
IVR fix by assigning dest_num to string instead of number
Posted: Wed Apr 19, 2006 8:38 am
by support
Hello,
The problem you were really having was completely overlooked. You were complaining that the number was being converted to scientific notation. The IVR problem can be fixed by assigning dest_num to a string instead of a number (notice the single quotes inside the double quotes):
Code: Select all
<assign name="dest_num" expr="'18179661716'"/>
It helps to be concious of the fact that everything that can be assigned is an ECMAScript variable. The same rules that were causing your number to come out as scientific notation hold true in all standard web browsers. The above IVR code is just shorthand for the following ECMAScript:
Code: Select all
<script>
dest_num='18179661716';
</script>
Hope this helps.
Regards,
Plum Support
Posted: Wed Apr 19, 2006 9:17 am
by always24x7
That was it.
Sorry, I haven't done a lot of scripting in html.
Thanks