cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
918
Views
10
Helpful
6
Replies

Change Redirection Destination Automatically by End user

eng.jamil
Level 1
Level 1

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;

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

6 Replies 6

Chris Deren
Hall of Fame
Hall of Fame

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".

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.

Many Thanks for the kind advise

Many Thanks Anthony;

This is exactly script i am looking for ; i follow the same but the redirection will happen only once , next call will be dropped. can i have more details about the Variables and parameters so i can double check.
Document / "hotline-a.txt" /caller_entered_digits

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.

Many Thanks for the hint :)