cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
513
Views
1
Helpful
2
Replies

Track agent state in custom gadget

sthan89
Level 1
Level 1

I have a gadget to make outbound calls in finesse and it is working as required but i am having challenges in returning agent to the previous state. Is there a way to get the status or track the agent status before making the call. I can return them to Ready state but if the agent was in Not-ready state before making the call, i want to put them back to the same state.

1 Accepted Solution

Accepted Solutions

Hey

In your handleUserChange event you can do something like this :

    function handleUserChange(userevent) {

        currentState = user.getState();

        oldState = newState;
        newState = currentState;

        if (oldState === "NOT_READY" && newState === "OUTBOUND") {
            savedOldState = "NOT_READY"
        } else {
            savedOldState = "READY"
        }
    }

 

currentstate = user.getState

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

View solution in original post

2 Replies 2

Hey

In your handleUserChange event you can do something like this :

    function handleUserChange(userevent) {

        currentState = user.getState();

        oldState = newState;
        newState = currentState;

        if (oldState === "NOT_READY" && newState === "OUTBOUND") {
            savedOldState = "NOT_READY"
        } else {
            savedOldState = "READY"
        }
    }

 

currentstate = user.getState

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

sthan89
Level 1
Level 1

Thank You Thomas for the help.