cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5181
Views
1
Helpful
12
Replies

Checking if ANI is blank / null?

Gerry O'Rourke
Spotlight
Spotlight

Simple question I think?

But I don't see a way using the decision editor to check if a variable is blank or null?

I can write a simple java action element to check, but is there a way to do this without using some simple java custom code?

Gerard

1 Accepted Solution

Accepted Solutions

ptindall
Cisco Employee
Cisco Employee

Gerard,

May seem clunky but you can append another character ($, for example) and then test whether the resultant string starts with it.

View solution in original post

12 Replies 12

hemal.mehta
Level 5
Level 5

You can use the decision editor and use cargument type call data and call data type ani and use operator does not exist.

Hemal

Ahh, I thought that would check if the actual variable exists or not and not the value of the variable itself.

Thanks for the tip. I will give it a test and see.

Gerard

It turns out that with VXML Server, if you set a variable value to NULL

then VXML Server deletes the variable.

So you'll never have a session or call data variable that exists with a

NULL value.

I found if I set a variable in ICM and send it to CVP, even if it has not value it does "exist".

So the above tip from Helma does not work.

If ANI is restricted ani, gets set to "anoymous", so I can use this in this case...

But for the more general case, where a session variable has a string value of "",

it would be nice if you could test this without a custom java code.

Gerard.

Use the same decision editor to test a string value equal to "".  Use operator equals string.

Hemal

I already had tried that. Not allowed!

Gerard

What do you mean by not allowed. I tested it works for me.

Hemal

Ok, I get what you are saying. All you need to is create a string in the session equal to empty string "" and then  check against that session variable.

Hemal

Another option would be a translation of the caller number on the gateway, before the call ever gets to CVP.

-Jameson

-Jameson

ptindall
Cisco Employee
Cisco Employee

Gerard,

May seem clunky but you can append another character ($, for example) and then test whether the resultant string starts with it.

Thanks all for very useful answers.

Hemal it is not possible to create a session variable in CVP Studio equal to a blank value, CVP Studio will not allow it.

But using Paul approach and your approach I did the following.

1) in ICM set the microapp.ToExt[0] to "application=CVP_Test_App;variable1="

2) we want to test if the session variable "variable1" is blank or not (it is blank in above example).

3) create a session variable "IsVariable1Empty" in CVP Studio which equals "{Data.Session.variable1}$$$

4) using decision Editor check if "IsVariable1Empty" equal the constant string "$$$"

5) If it is, variable1 is empty, if not, its not.

Thanks again for everyone's help on this.

Gerard.

Chintan Gajjar
Level 8
Level 8

Try this, first define your decision using Decision editor.

in the same node instead of using decision editor choose XML.

on your preferable exit state do edit XML and put "" there. (that will make it null).

Chintan