VoiceGuide IVR Software Main Page
Jump to content

How Do I Use Evaluate Expression

Recommended Posts

Hi

 

I'm new to using Script Designer. I've looked at a few of the example scripts and I must say, it seems simple but powerful. Very nice.

 

Where I need help is with a script that is supposed to chek if the callers CLI complies to a certain rule. Basically I want to check the first three digits of the caller's CLI to see if they match up to accepted numbers.

 

Accepted numbers start with 072, 082, 073, 083, 074, 084 and 076.

 

At the moment what happens in the script is this:

  • Caller phones in and a welcome messag is played.
  • A VBScript runs to determine my companies web services status - I've skipped this part for now.
  • The caller's CLI is checked to see if it matches some criteria (as mentioned above). If there is no match the caller is prompted to enter their mobile phone number.
I'm using an Evaluate Expression module to check $RV_CIDNUMBER. This is what I have:

firstThreeDigits = left($RV_CIDNUMBER, 3)

if firstThreeDigits = "072" or firstThreeDigits = "072" or firstThreeDigits = "073" or firstThreeDigits = "083" or firstThreeDigits = "074" or firstThreeDigits = "084" or firstThreeDigits = "076" then
   outcome = True
else
   outcome = False
end if

 

In the Evalute Expression window's 'Assign result to....' field I have specified outcome.

 

Now after you have laughed at my feeble attempt or alternatively scratched your head in confusion, could you please help?

 

Like I said, this is my first attempt, so I might very well be going about this the wrong way. All I know is it isn't working and I don't know how to make it work.

Share this post


Link to post

AHA!

 

I've fixed the problem. Instead of using a Validate Expression module I used a Run VB Script module.

 

I'd still like to know what the limitations are to using the Validate Expression and what it's intended use is. I get the feeling that I was expecting too much from it.

 

Here's what I've done:

set vg = CreateObject("VoiceGuide.CommandLink")

ddd = left("$RV_CIDNUMBER", 3)

if ddd <> "072" and ddd <> "082" and ddd <> "073" and ddd <> "083" and ddd <> "074" and ddd <> "084" and ddd <> "076" then
 sResult = "verify_failed"
else
 sResult = "verify_passed"
 vg.RvSet $RV_LINEID, "CallerID", "$RV_ENTEREDNUMBER"
end if

vg.Run_ResultReturn $RV_LINEID, sResult
set vg = Nothing

Share this post


Link to post

In the Evaluate Expression module have you tried using:

 

Left("$RV_CIDNUMBER", 3)

 

and then specify paths like this:

 

on {072} goto [Match]

on {082} goto [Match]

on {073} goto [Match]

on {083} goto [Match]

on {074} goto [Match]

on {084} goto [Match]

on {076} goto [Match]

on {Success} goto [NotMatched]

on {Fail} goto [NotMatched]

 

Have a look at the trace log as well when running the script - debug info there usually helps to clarify what's happening.

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
×