Genesys Cloud - Main

 View Only

Discussion Thread View
Expand all | Collapse all

Invoke URL when dialing contact in preview campaign

  • 1.  Invoke URL when dialing contact in preview campaign

    Posted 14 days ago

    Hello everyone,

    Is there a way to open a URL at the moment the agent clicks on the "begin call" during a preview interaction?

    Using an if/else scenario with the scripter.interaction state at the page load action did not work. Any ideas?

    Regards,


    #ArchitectureandDesign

    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------


  • 2.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 14 days ago

    There may be something you can do with Data Actions to make this work properly, but that's out of my wheelhouse.  Strictly working within Scripts, nothing comes to mind that's clean... you could always try something like:

    1) Set boolean Variable, default: False

    2) Custom Script - Name it "URL". 

    • Try 
      • If boolean = False
        • If {{Scripter.Interaction State}} Equals (Ignoring Case) Connecting
          • {{Scripter.Set Variable}} boolean = True
          • {{Script.Open URL}}
    • On Error
      • Delay 3000
      • Custom > URL

    3) Set Start Page > Page Load Action = "URL"

    Naturally, this is not something I tested, and it's not very clean using a millisecond timer.  Without Data Actions I'm not sure it really can be clean.  Though I'd be intrigued if it could. 



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 3.  RE: Invoke URL when dialing contact in preview campaign

    Posted 14 days ago

    Hi Steven,

    Thanks for your reply. Your approach is based on the fact that the agent would actually press the begin call button. That would be OK, but there are scenarios where an agent would not call the customer (e.g. skip). Furthermore, there is no time limit. An agent could spend between a second and 10 minutes before doing any action.

    I was wondering if there is a way to use boolean variables as "trigger" points.

    Regards,



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 4.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 14 days ago

    My pleasure!  

    So, with my solution in mind, I'd like to point out two things:

    1. If the user never hits begin call, the URL will not be invoked.  If that's not the behavior you want - we can try to work around that but I will need more details.
    2. The way the Try On Error in my situation works is, it says "Check if the boolean is still false, if not, wait 3 seconds and try again".  This would happen endlessly until the interaction is terminated.  So whether it takes 1 second, or it takes 10 minutes, the result would occur with a potential delay of up to 3 seconds.  This can naturally be modified to suit your needs; shorter/longer/etc.

    So, that being said, are there other situations where the URL would still need to be invoked?



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 5.  RE: Invoke URL when dialing contact in preview campaign

    Posted 14 days ago

    Hi Steven,

    "This would happen endlessly until the interaction is terminated"

    Now this is something new to me. I thought it would only check once. I will give it a try tommorrow and see what happens. Thanks again!

    Cheers,



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 6.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 14 days ago

    No problem!  Curious how it turns out, so let me know.  The set / check for boolean is a good trick in situations where you cannot do a proper do while/until loop; which beyond having something that natively binds to clicking the "Begin Call" button, sounds like you need. 

    You're basically just saying "if this isn't ready yet, wait and go back to the top of the script". 



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 7.  RE: Invoke URL when dialing contact in preview campaign

    Posted 13 days ago

    Hi Steven,

    Tried your suggestion but unfortunately it didn't work. I did numerous tests, worked with delays, removed boolean variable, etc and I can only assume that the script cannot handle the interaction state variable. I added the boolean variable as text in order to monitor if it changes values, in order to have some kind of "logging" during my tests. No changes whatsoever.

    I am now more confused. Your suggestion should work, it is pretty straightforward, yet the behavior of the script states that it cannot handle the interaction state at all.



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 8.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 13 days ago

    Good Morning Charis - 

    Disappointing!  Let's try a few more things.  First, in addition to logging the boolean (which should theoretically stay False), add some text values to follow along with {{Scripter.Interaction State}} and {{Scripter.Interaction Type}}.

    The following Interaction States will be labeled with their respective strings:

    1. While "Previewing" a call, the {{Interaction State}} will be "Connected".  The {{Interaction Type}} will be "Callback".
    2. Once you click "Begin Dial", the {{Interaction State}} changes to "Connecting" and the {{Interaction Type}} changes to "Call".
    3. If the customer/person accepting the call answers the call, the {{Interaction State}} changes to "Connected", and the {{Interaction Type}} remains "Call".

    Knowing these three facts, it's important to account for them in our script.  Add those attributes as text fields, and see if they change in the same manner that I am reporting.  If not, you may have to account for the specific names you see.  You may also have to add an extra layer that says something to the effect of:

    • Try If {{Scripter.Interaction Status}} Equals (Ignoring Case) Connecting
      • Do the stuff we talked about above
    • On Error
      • Try If {{Scripter.Interaction Status}} Equals (Ignoring Case) Connected
        • If {{Scripter.Interaction Type}} Equals (Ignoring Case) Call
          • Do stuff
      • On Error 
        • Custom > URL

    This way you account for not only the "Connecting" Status, which should happen upon dialing (maybe yours is called Dialing?), but also account for what happens if the customer answers before it loops back (Status: Connected / Type: Call). 

    Sorry this is such a mess!  Hopefully you're able to come up with a solution.  Let me know if I can help in any other way. 



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 9.  RE: Invoke URL when dialing contact in preview campaign

    Posted 13 days ago

    Hi Steven,

    I actually found a way but I will surely try your second approach too. I will come back with details.

    Regards,



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 10.  RE: Invoke URL when dialing contact in preview campaign

    Posted 12 days ago

    OK so it turns out that the try/on error approach is not doing anything! Or at least the logic in my situation needs further consideration. The only solution I found, was to create 2 if/else custom actions that were loaded to 2 script pages and each action would simply change the page in the end of the action:

    Home Page and Dial Page are the exact same.

    Home Page loaded custom action:

    • Delay 3 seconds
    • if boolean=false
      • if Scripter.Interaction State = Connecting
        • Then Set boolean=true
        • Scripter.Open URL
        • Else change Page to Dial Page

    Dial Page loaded custom action:

    • Delay 3 sconds
    • if boolean=false
      • if Scripter.Interaction State = Connecting
        • Then Set boolean=true
        • Scripter.Open URL
        • Else change Page to Home Page

    This worked but I know it is not ideal. The script keeps changing pages even though it is not visible at all and I do not know what could this cause in matters of performance. I experienced a memory issue during one of my test calls (had to refresh the page).



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 11.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 12 days ago

    Yeah anything that has a timed delay is not going to work ideally. Add Change Pages endlessly into the mix and I'm sure it'll end up running out of resources eventually. I am intrigued by why Try Error is not working for you.  If you'd like to test a few more things, you can keep your boolean value default to False, then set some text boxes on a page based on new string variables (saying whatever you want, just make 2 and have them be distinct).

    Then:

    • Try
      • If boolean = True
        • Update String Variable 1 to anything else
    • On Error
      • If boolean = False
        • Update String Variable 2 to anything else
        • Update boolean to True
        • Call URL

    Mess with something to this effect and see if you can pinpoint why the Try Error may or may not be working.



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 12.  RE: Invoke URL when dialing contact in preview campaign

    Posted 10 days ago

    Thanks Steven, the try/on error now works. I had to play round with the on error part.



    ------------------------------
    Charis Sideridis
    INTRACOM SINGLE MEMBER S.A. TELECOM SOLUTIONS.
    ------------------------------



  • 13.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 10 days ago

    That's great news!  Hopefully that covers everything then.  Let me know if you need anything else.



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



  • 14.  RE: Invoke URL when dialing contact in preview campaign

    Posted 11 days ago

    Hello,

    Instead of loading a new page you can use Custom action in your Else statement and have it run the same script again, so it would loop the same script until state is Connecting.

    It's also worth considering using {{Scripter.Raw Interaction State}} instead if you have agents using different languages for their interface.

    {{Scripter.Interaction State}} is translated to whatever language the agent has on their UI.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 15.  RE: Invoke URL when dialing contact in preview campaign

    Top 25 Contributor
    Posted 11 days ago

    Agreed.  That's what the Custom > URL from above was alluding to.  A de facto "go to the top of the script" if you will.  Should definitely work; sounds like the Change Page option was because the OP was having issues getting it to hit the On Errors/Elses.  Definitely not a long term solution as longer calls will get butchered by the resource use.

    That's great to know about the Interaction State applying localized languages.  Haven't encountered that yet on my end - but I'm glad I know about it should it come up. Thank you for that!



    ------------------------------
    Steven Busse
    Vice President, Lead Business Analyst
    M&T Bank
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources