05-07-2020 02:04 AM
Hello
I need a way to make a global counter variable that counts a number "played prompt for ex. or any other step" and this variable value always counter and does not reset if self when the application end.
I searched questions in the community of this same purpose but non ended by solved.
simple variable "intiger or float" that i can increment or decrement within an application and the value if not resetted when the application ended.
TIA
05-07-2020 04:09 AM
05-07-2020 05:25 AM
Hi Mohammad,
In the beginning, I want to say that this is an interesting problem that you have. There are 2 questions that you will need to answer before you can find a good solution:
Let's start with the first one.
I think that there are 2 options that you need to consider
The decision is up to you based on the infrastructure that you have and can use for this solution. What is important when creating the mechanism, is the fact that at the same time there can be multiple requests to update the value as the IVR sessions can run simultaneously. The writing mechanism should queue all the requests and process them one by one.
Let's look at the second question
When we consider when tow write, I think that we need to keep in mind 2 scenarios:
Please treat my questions and answers as a concept of the solution that might work for you. There are some things that I haven't tested in real life.
05-07-2020 08:42 AM
05-07-2020 11:36 PM
05-08-2020 07:46 AM - edited 05-09-2020 12:35 PM
I see now. So, in a way, the "meaningful step" is your counter step.
Unless, you can figure out how to make the actual "meaningful step" execute your counter for you.
E.g.,
Play Prompt (--Triggering Contact--, P[myfile.wav]) Increment myfile_counter VS Play Prompt (--Triggering Contact--, { myfile_counter++; return P[myfile.txt]; })
Then, like @Marek (gaman-gt.com) mentioned, you could catch all exceptions and use the script's ending to write the value one time at the end. This should work most of the time, but, if for example the Engine crashed, you would not be able to write the values you've been collecting for the duration of the call. If this concerns you, then you'd need to write immediately to secure the data from this scenario.
Did you already have a place you wanted to write the information to? This will determine how you consume the results too.
05-09-2020 08:31 AM - edited 05-09-2020 08:34 AM
Solved by counting the hits and storing it in a new tsql able created for this purpose.
for easy reset too.
Thank you all so much :)
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