Showing 6 results.
Items per Page 50
of 1

CVP Forum

« Back to Universal Edition New Feature Discussion

Var assigns and function reference calls

Combination View Flat View Tree View
Threads [ Previous | Next ]
Some basics,

Ability to create and assign values to a session variable on its own without inclusion on an element. Sometimes you just want to do this!

Assigning can
1. Calculate
2. Concatenate strings
3. Refer to and obtain a result from a javascript library and place it in the assignment.

Maybe there is something in v5 that I have missed but didn't see it.

PS. I'm aware of the math object.

thankyou

Hi Karl,

You can do this today with the Application Modifier element. It is an Action element with no required settings. It provides the ability to remove session data (among other things), and you can set new session data via its "Data" tab. You can use this element when you would like to set some session data while not necessarily performing some other action, which it seems you are describing.

In regards to concatenation, you can do this via substitution. For example, when creating new session data in this element, you can concatenate a piece of Element Data with a piece of Session Data by using substitution and inserting both of those values side-by-side. At runtime they will be concatenated and stored in the new session data variable you specified.

For calculations, the Math element is generally the way to go (as you mentioned). However, if that is not appropriate for your needs, please provide some additional insight into what you would like to do so that we can give a better recommendation.

In regards to Javascript values, please note that Javascript is executed on the voice browser side. While Call Services will include Javascript you specify in the root document for the voice browser to process, it will never see the result of that processing unless you specify in your VoiceXML that the result should be submitted back. You could create a custom element to submit this data back, or you could also do it with a VoiceXML Insert element (if it's a one-off situation).

Hope that helps,
Vance

Vance,

I accept what you say, yes its new in 5.

As for the javascript reference, you are correct about the voice browser.

"You could create a custom element to submit this data back, or you could also do it with a VoiceXML Insert element (if it's a one-off situation"

I would say an enhancement is required here to create variables associated with a form (basic, digits, menu, etc) and point it at some javascript function but include that reference when audium serves up its VXML component code to the VB, the VXML var will get filled and the data posted back into session or element data.

I would expect this to be out of the box.

Hi Karl,

Thanks for suggesting the JavaScript function reference by element and session data. Could you please provide a few use cases so that we could better understand your suggestion?

Thanks,

John

Audium supports Javascript library inclusion.

Therefore

How do we make a call to a javascript function and store the result in a variable (session/element data)

We should not have to build custom components to implement these things.

Usually when a form is filled or a VXML processing form is implemented you can assign the result for javascript functions into a VXML Variable, clearly we want to get this into session or element data.

The product will just open up a bit more. Assigning results allows for

1. Special voice browser session values (specific to voice browsers within telephony environments).
2. NBest Processing/Skip Lists.
3. Dates/Times/Format Functions
4. JavaScript Dom

I know some things are exposed but to get everything you have to start re-engineering Audium to implement all the missing bits.

So what could the approach be.

How about a processing form object
1. Specify the function to call
2. Specify the parameters that go into it
3. Specify which session variable it updates (i.e. returns)

And Or

On the Data Tab have a ECMCAScript function item (besides session/element)
1. Name of function
2. Call before or after step
3. Session/Element Parameters to pass in
4. Result to map back.

Hi Karl,

One of the strengths of Audium Call Services is the fact that it leverages a web app architecture and stores session data and performs most processing on the app server; this design takes much of the burden of processing a call and storing data off of the voice browser, and distributes it to the app server.

As a best practice, it is generally not recommended to use your voice browser to perform CPU-intensive processing or to store large amounts of caller-centric data since it could adversely affect other calls (which need CPU and memory resources for many other purposes).

With that said, we have entered the request to provide the ability to make a call to a JavaScript function and store the result in a session or element data variable into our internal issue-tracking system with an ID of CSCsh73482. Should you wish to track the status of this request in the future, please refer to that ID.

Regards,
Roberto

Thanks!

Audium itself generates ECMAScript in several areas. Its unlikely most designers/developers will implement much ECMAScript only in special cases where it makes sense.

We are not talking of heavy usage but we are talking of the ability to have this option open.

It is not for the vendor to control what design decisions are to be made by solution providers, but to simply give guidance on patterns and best practice.