07-30-2018 03:30 AM - edited 03-15-2019 06:40 AM
Dears;
i want to create a script with ability to store variable value in memory permanently with the capability to change it once required, this is to change the Redirection Target automatically without interaction with IT Section
script look like this
Menu function
- press one will redirect to = "Hotline.A" -- Using Call Redirect
- Press two To Change Value of Hotline.A
- Ask For Pin
- Once Confirmed -- using If Statement
- Extended Get Digit String ( New.Hotline) to Modify Value of Hotline.A
- Set Hotline.A=New.Hotline
the script working fine but once the user close the call with changing Hotline.A Value . the next caller will redirected to initial value of Hotline.A or Drop the call without redirection. i am not able to maintain the new value in the system.
is this possible?
Thanks;
Solved! Go to Solution.
07-30-2018 08:40 AM - edited 08-07-2018 07:57 AM
Actually, if you're just storing the destination itself, then a plain text file would suffice.
E.g., Update and Save
caller_entered_digits = Get Digit String (--Triggering Contact--) Successful Upload Document ((Document) caller_entered_digits to L[default], "hotline-a.txt") Successful Play Prompt (--Triggering Contact--, P[updated.wav])
E.g., Read and Redirect
Set destination = DOC[hotline-a.txt] Call Redirect (--Triggering Contact-- to destination) Successful Set Contact Info (--Triggering Contact--, handled)
Pro Tip: If you use the upload document step, and immediately try to read the contents of the file you uploaded, it will cause a race condition and you may get mixed results. I recommend a 3 second delay after uploading, before trying to read the file.
07-30-2018 05:36 AM
Assuming this is CCX, your best option would be to create an XML file that stores the value of this variable and read it from the file prior to routing. There are many examples out there on how to write and read from XML files from CCX script. Some good examples under "UCCX script repository".
07-30-2018 08:40 AM - edited 08-07-2018 07:57 AM
Actually, if you're just storing the destination itself, then a plain text file would suffice.
E.g., Update and Save
caller_entered_digits = Get Digit String (--Triggering Contact--) Successful Upload Document ((Document) caller_entered_digits to L[default], "hotline-a.txt") Successful Play Prompt (--Triggering Contact--, P[updated.wav])
E.g., Read and Redirect
Set destination = DOC[hotline-a.txt] Call Redirect (--Triggering Contact-- to destination) Successful Set Contact Info (--Triggering Contact--, handled)
Pro Tip: If you use the upload document step, and immediately try to read the contents of the file you uploaded, it will cause a race condition and you may get mixed results. I recommend a 3 second delay after uploading, before trying to read the file.
08-06-2018 04:51 AM
08-06-2018 07:51 AM
08-07-2018 08:03 AM
Sure, so the way in which this works is, in UCCX App Admin, you'll go to Applicaiton > Document Management > Default and you should see your file there. If you open it (either download and open, or it opens in your browser), you should see the destination as the only thing in that file.
The example assumes you'll be overwriting the file each time you update and save it, so it doesn't act as a transaction log, rather just holds the current value.
If you are getting that far, and are able to change the value in the file, then the failure on the redirect will need to be more closely inspected. Can you confirm whether or not you are able to change the value in the file successfully? If so, follow the call in the logs and see where it's failing.
08-06-2018 04:51 AM
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