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

How to use variable to transfer call

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jporrello
Posts: 2
Joined: Tue Jun 03, 2008 8:27 am

How to use variable to transfer call

Post by jporrello »

I am trying to transfer a call to a pager after calling a subdialog to get a pager number. I can get it to say the number but I can not set the dest= to the variable passed.

Scratchpad program:
<?xml version="1.0"?>
<vxml version="2.0">

<form id="intro">
<block>
<prompt bargein="false">
<audio src="wavfiles/humanvoice.wav">
Hello! Welcome to My program On-Call System!
</audio>
</prompt>
</block>
<field name="option" type="digits?minlength=1;maxlength=1">
<prompt>
Please Enter One for location1, Two for location2
</prompt>
</field>
<subdialog name="random" src="http://myserver.com/pager.php"/>
<block>
The pager number is <value expr="random.pager"/>.
</block>
<!-- transfer to Pager -->
<transfer dest=random.pager connecttimeout="20s" bridge="true"/>
</form>
</vxml>





This is the php file on the server:
<?php
header("Content-type: text/xml");

$pager1 = "12055555555";
?>

<vxml version="2.0">
<form>
<block>
<var name="pager" expr="'<?php echo($pager1)?>'"/>
<return namelist="pager"/>
</block>
</form>
</vxml>


Thanks,

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

Change in IVR code allows call transfers

Post by support »

Hi,

The reason why you cannot use the dest attribute of the IVR tag, <transfer>, is because you are trying to pass an ECMAScript expression to it (random.pager). Instead, you should use the destexpr attribute of the <transfer> tag. I would recommend changing this line of IVR code:

Code: Select all

<transfer dest=random.pager connecttimeout="20s" bridge="true"/> 
to this:

Code: Select all

<transfer destexpr="random.pager" connecttimeout="20s" bridge="true"/>
We have tested this IVR code with this one change and confirmed it to work. Hope this helps.

Regards,
Plum Support

Post Reply