Page 1 of 1

JavaScript Speed issues

Posted: Fri May 09, 2008 3:52 pm
by mikepoullas
I am building a very simple vxml app that uses the <data> tag to go out and call a web service and speak back the account info . The web service does not return a fully structured XML but rather a single string with a pound sign (#) to delimit the different accounts and a comma to delimit the fields in the account. I use the <script> tag to execute some JavaScript that basically pulls apart the single string using the delimiters and assign them to vxml vars. The problem I am having is that while the JS is doing everything right, it can take up to 15 seconds to parse through the string, sometimes even longer and confused the caller thinking something is wrong! When I execute the code using a browser, it comes back super quick and I even tried the code with another IVR platform and it too comes back real quick and with much less GHz speed on the hardware side.

What could be going wrong here? Should I avoid JS?

I'll do my best to describe the code here without listing the entire app.

This is what a return string looks like from the web service:

<string>0,999999991,,,0,0,0#1,000023336,,,0,1300,1300#2,000005365,,06/01/2008,0,241.61,129.38#3,05K678321,,06/01/2008,0,250.37,167.28#4,392840464,,,0,0,4632.5#5,000000000,,,0,0,-263.59</string>

<!-- Globals -->
<var name="gc_accounts_string" expr=""/>
<var name="each_account" expr=""/>


<!-- Get Account String Web Service -->
...
<data name="domXMlData" src="http://mywebserver.com/ivr.asmx/GetAccountsString" namelist="sToken sSSN Sep1 Sep2" method="post" />

<block>
<assign name="gc_accounts_string" expr="domXMlData.documentElement.firstChild.toString()"/>
</block>


### The JS call below, separates out the account by using the # delimiter

<block cond="segment_account_info()">

....

</block>

<block cond="account_index < gc_account_count" name="play_accounts">

### The JS call below, separates out the fields in the account by using the , delimiter. In this case, I use an index counter in a loop to load the field values in vars to play back

<if cond="get_account_info(account_index)">

### In between I play back the values returned in the JS below.

</if>
</block>

### I use the JS SPLIT method to separate out the accounts and fields in the accounts.

<script>

function segment_account_info() {

var the_accounts = gc_accounts_string;
each_account = the_accounts.split("#");

return true;
}

function get_account_info(i) {

var elements = each_account.split(",");

record = elements[0];
loanid = elements[1].substr(6,3);
lastpaymentdate = elements[2];
nextpaymentdate = elements[3];
lastpayment = elements[4];
nextpayment = elements[5].split(".");

dollarsdue = nextpayment[0];
centsdue = nextpayment[1];

balance = elements[6].split(".");
dollarsbalance = balance[0];
centsbalance = balance[1];

return true;
}


</script>

IVR issue with javascript may be TTS related

Posted: Mon May 12, 2008 1:21 pm
by support
Hi Mike,

We believe that this IVR issue is TTS related. We're currently looking into this IVR issue and we'll let you know once we find a resolution.

Regards,
Plum Support

Posted: Mon May 12, 2008 1:52 pm
by mikepoullas
I would agree that there is something going on with the TTS playback in that when I remove the <say-as> tags for playing back the account info, there is almost no delays.

Greatly appreciated.

IVR issue with javascript was due to TTS engine

Posted: Tue May 13, 2008 10:46 am
by support
Hi Mike,

The IVR support team has just let us know that they believe that have resolved the IVR issue with the TTS engine. Please try calling in again to test your IVR application to see if the speed has improved.

Regards,
Plum Support

Posted: Tue May 13, 2008 12:39 pm
by mikepoullas
Hi. There might a misunderstanding here. I am not using the hosted solution but have my own standalone plum ivr system. I will contact support and let them know this.

IVR support team fix TTS speed being read back

Posted: Tue May 13, 2008 12:44 pm
by support
Hi,

Yes, the support team has made this TTS update to your IVR system. Please send an e-mail to support@plumvoice.com with your customer ID in the subject line if you are still having IVR issues with the TTS speed being read back.

Regards,
Plum Support