10-26-2018 02:23 PM - edited 03-14-2019 06:34 PM
Hello,
I've seen a number of questions related to this but thought I would try to get some clarification. I have a script that front ends all my other scripts and does database dips to pull data from a couple of databases. I store this data into variables within the script. I then use a Get Session step to create a new session and use a Set Session Info step to store my data from script variables into the session and do a call redirect to my next app/script
My 2nd script does a Get Session step (not new) and then a Get Session Info to read my data from the session back into my script variables. This is working fine and my data is consistent (as far as I can tell). The problem is that for some calls, I transfer to yet a 3rd script depending on what options the caller pressed or if they have been in queue for too long. In my 3rd script, again I use a Get Session step (not new) followed by a Get Session Info step to read data from the session into script variables. Many times, the data I read back into the 3rd script appears to be data from a different (wrong) session and my data is not what I'm expecting.
In each script I write my data using CPV's so I can validate and report on everything
I read another post where another user was experiencing similar behavior and the recommendation was to use Get and Set Call Contact steps instead of Get and Set Session steps.
So I have 2 questions, what is the difference between setting and getting the session info using a call contact step vs using the session steps and secondly, how and why is my session data getting mixed up with data from other calls? I was always under the impression every call has a unique session associated with it.
Thanks in advance,
Glenn
Solved! Go to Solution.
10-26-2018 02:48 PM
10-28-2018 08:14 PM
No. Use Get Contact Info step in all three scripts. The Get Session step is only useful when you want to create a new session from scratch or find one by a Mapping ID. In your use case the automatically created Session for the triggering contact can should be used instead.
10-26-2018 02:48 PM
10-27-2018 11:58 AM
10-28-2018 10:43 AM
Hi Jonathan,
Call redirects are direct to triggers. See my reply to Anthony for how I'm using the session
Thanks,
Glenn
10-28-2018 10:36 AM
Hi Anthony and Jonathan, thanks for the replies. The only reason I'm creating a new session in my initial script, is because I thought that's what I needed to do. It is important to note that to my knowledge, this is working correctly when I transfer to the 2nd script. My data only seems to get out of whack when transferring to the 3rd script and I sometimes data from other calls/sessions.
In my main script, I create a new Session:
Then I write variables to the session:
In the 2nd or 3rd scripts, I get the session:
Then I read my variables back into the script from the session:
Thanks,
Glenn
10-28-2018 10:48 AM
The Mapping ID looks odd For at least two reasons:
1) what are you setting it to that is a known-unique value per-call before executing the Get Session step? This is how the second and third scripts uniquely identify the session for THIS call vs. all the others. Remember that sessions survive for 30 minutes after the call ends.
2) The variable name starts with “s_”. Since your screenshots show you using “str_” to indicate a String variable I’m guessing this stands for Session? Mapping IDs are supposed to be globally unique String values, not internal Session identifiers themselves.
10-28-2018 05:20 PM
Hi Jonathan,
Doesn't the first Get Session get populated by the unique session ID generated by CCX into the variable s_session? You are correct that s_session is a variable of type session. That is the only variable type this step will allow. What should my initial Get Session step look like?
Thanks,
Glenn
10-28-2018 05:45 PM
10-28-2018 07:07 PM
Ok, thanks. Do I still use the Get Session step in my 2nd and 3rd scripts
?
Thanks,
Glenn
10-28-2018 08:14 PM
No. Use Get Contact Info step in all three scripts. The Get Session step is only useful when you want to create a new session from scratch or find one by a Mapping ID. In your use case the automatically created Session for the triggering contact can should be used instead.
11-02-2018 05:00 AM
Apologize for the delay responding. It took me a while to test and put updated scripts into production. Thanks very much to Jonathan and Anthony for their assistance. Their suggestions did the trick.
Glenn
11-02-2018 12:44 PM
11-04-2018 07:11 PM
The solution was to use the Get Contact Info step as the session ID.
Thanks,
Glenn
11-06-2018 01:42 AM
10-28-2018 08:44 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide