Call Variable Capabilities

Talk with others about developing applications for Switchvox

Moderators: bmdhacks, dpodolsky, tristand, jwitt, joshuas

Call Variable Capabilities

Postby pbj » Wed Sep 01, 2010 5:51 am

I've found that if a "Send Call Values to URL" times out, then any call variables listed as returned values are reset (any previous values are lost), and I haven't been able to figure out a way to "protect" them. I can use temporary variables for the return values, but how do I use the Conditional Clause to determine if a value has been returned or "is null"? And even if I could, how do I set the value of my persistent call variable to the (non-null) value contained in the temporary variable, since the "Set Variable" action only takes "hardcoded" values or system variables? Thanks.
pbj
Newsterisk
 
Posts: 6
Joined: Tue Aug 31, 2010 2:51 pm

Re: Call Variable Capabilities

Postby intellectit » Sun Sep 05, 2010 7:13 pm

Have you tried using global variables instead? Not sure if this will work for your appliaciton or not. However it might be worth a try.

Switchvox @ Intellect IT
intellectit
Oldsterisk
 
Posts: 92
Joined: Sun Aug 02, 2009 8:08 am

Re: Call Variable Capabilities

Postby pbj » Fri Sep 10, 2010 10:10 am

Thanks for the suggestion, but I don't think global variables will help for two reasons: (1) I need separate variables for each call or else invocation of the IVR for one call will step on the actions of the same IVR for another call, and (2) the only thing I can do with global variables is set and get them (to/from local variables). I still can't check for a null value, e.g., CONDITIONAL CLAUSE varX == "" (or blank) doesn't take the conditional branch for an uninitialized variable; neither does LESS THAN 0. I'm only asking for a little more functionality with regard to variable manipulation, and I am surprised not to see similar posts wrt the current limitations.

Thanks again. I hope someone else has some suggestions.
pbj
Newsterisk
 
Posts: 6
Joined: Tue Aug 31, 2010 2:51 pm

Re: Call Variable Capabilities

Postby dpodolsky » Mon Sep 13, 2010 2:06 pm

I might have a suggestion to help. Also, thank you for the feedback on the product I am including the information from this forum posting to create a feature request to make our IVR actions stronger.

Work around suggestion:
I haven't tested this exactly, but the suggest might help. Before making the URL request create a variable called "value_is_one" and set it to the value 1. Now if variables get reset on a slow URL request (haven't looked into this), then in your conditional check if "value_is_one" is actually one. If it isn't one, the URL request failed, if your URL succeeded make sure you return one for this value.

With your temporary variables you can't swap them into the other variables, but you can have that conditional clause go down a separate IVR tree that uses those temporary variables and another IVR tree that uses the real variables.

Optimize your web requests suggestion:
If you have a web request that has some long running code that is causing the IVR URL to timeout, I suggest splitting it up and giving the user a better experience.

Example: Your new IVR:
Action 1. Make a URL request that forks off a background process that runs all your long running code, and have that request immediately return an ID that you store in a variable that you will later use to get the results.
Action 2. Play a sound "We are currently looking up your account records please be patient."
Action 3. Wait 5 seconds
Action 4. Make another URL request that has your ID from the first request and pulls the results that have already finished running.

Hope this helps.
dpodolsky
Oldsterisk
 
Posts: 325
Joined: Thu Apr 23, 2009 2:35 pm

Re: Call Variable Capabilities

Postby intellectit » Thu Dec 30, 2010 10:13 pm

Thanks for the tip. I can confirm that this technique works. In my case I needed to check for the existance of an extension. If I do a "get extension status" in my IVR it will return nothing if the extension does not exist. I then run into the same problem that the conditional clause cannot check for a null value. By setting the variable used for the "get extension status" to a value first, "null" in my case. I can then test for "null" in my conditinal clause.

Switchvox @ Intellect IT
intellectit
Oldsterisk
 
Posts: 92
Joined: Sun Aug 02, 2009 8:08 am


Return to Switchvox Developers

Who is online

Users browsing this forum: No registered users and 2 guests