VoiceGuide IVR Software Main Page
Jump to content

Script Modules

Recommended Posts

Hi VG Team,

 

I would like to use response result from web service.

 

ie: If result = 'a'

run module 'Say Card Number'

else

run module 'Enter Card Number'

How can i do that?

 

Thank you for your support.

Share this post


Link to post

Use an Evaluate Expression module.

 

The Web Service module will create a number of Result Variables ($RVs). Best to look at vgEngine trace to see what these are.

If you know the exact XML or JSON that the Web Service returns then you can deduce what $RVs are created, but best/easiest to just look in vgEngine trace after running a call to the Web Service.

 

Use the Evaluate Expression module to evaluate the $RV that you want to check the value of, and then set paths that match each value.

 

Say your Web Service module creates this $RV (amongst many others) :

 

$RV[MyWS_Report_Mode]

 

and the above $RV can have values aaaa or bbbb or something else.

 

then you would use this as expression to evaluate in the Evaluate Expression module (notice the quotes):

 

"$RV[MyWS_Report_Mode]"

 

and the paths would be:

 

on {aaaa} goto [say Card Number]

on {bbbb} goto [someModuleB]

on {True} goto [Enter Card Number]

Share this post


Link to post

Thank you so much.

 

I also have a issue in script module. Can VoiceGuide speak 3 random digits?

Share this post


Link to post

Use an 'Evaluate Expression' type module to evaluate this expression:

 

100 + Int(900*Rnd)

 

this will result in random number between 100 and 999.

 

The random number will be saved in $RV with the same name as the title of the Evaluate Expression module.

 

The $RV can then be used in a 'Say Numbers' type module to speak out the digits.

 

Use a Success or True path to go from the 'Evaluate Expression' type module to the 'Say Numbers' type module.

 

 

see vgEngine trace excerpt of a script doing this:

 

'Evaluate Expression' module was titled: GenerateSomeRnd

 

It created $RV[GenerateSomeRnd] that held the random number value, and the $RV[GenerateSomeRnd] was then played out by the Say Numbers module:

213304.349  11   5   1 state [GenerateSomeRnd] Evaluate [100 + Int(900*Rnd)]
213304.349  11   5   1       eval  [100 + Int(900*Rnd)]
213304.349  11   5   1       eval  InvokeMember Eval returned
213304.349  11   5   1       rvns  add   GenerateSomeRnd_Input|100 + Int(900*Rnd)
213304.349  11   5   1       rvns  add   GenerateSomeRnd|621
213304.349  11   5   1       Eval Expr result:[621]
213304.349  11   5   1       path {621} not found
213304.349  11   5   1       matching path not found [621], try boolean paths.
213304.349  11   5   1       ex: ScriptIo.VGMTYPE_EVALEXPR [621] could not be converted to boolean. Take Success path as string non-empty.
213304.349  11   5   1       FindNextVgmTitleInPathList: next module title is=[SayRnd]
213304.349  11   5   1       matching path found (Boolean True)
213304.349  11   5   1 t     timer clear (force=False)
213304.349  11   5   1       RunModule start
213304.349  11   5   1       RunModule start Say Numbers, [SayRnd], iModuleIdx=62, previous: vgm=61, vgs=2:2
213304.349  11   5   1       rv    replace start [$RV[GenerateSomeRnd]]
213304.349  11   5   1       rv    replace end   [621]
213304.349  11   5   1 state [SayRnd] Say Numbers: 621 as Digits

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×