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 transfer using a variable for the phone number

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
always24x7
Posts: 30
Joined: Tue Apr 18, 2006 3:05 pm
Location: Bedford, TX

Problem with transfer using a variable for the phone number

Post 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>

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

IVR script for use of destexpr attribute

Post 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
Last edited by support on Thu Feb 25, 2010 2:10 pm, edited 4 times in total.

always24x7
Posts: 30
Joined: Tue Apr 18, 2006 3:05 pm
Location: Bedford, TX

Post 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.

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

IVR fix by assigning dest_num to string instead of number

Post 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
Last edited by support on Thu Feb 25, 2010 2:10 pm, edited 2 times in total.

always24x7
Posts: 30
Joined: Tue Apr 18, 2006 3:05 pm
Location: Bedford, TX

Post by always24x7 »

That was it.

Sorry, I haven't done a lot of scripting in html.

Thanks

Post Reply