You'll need to check if {{Scripter.Raw Interaction State}} is connected, if not then you put a 1-2 second delay and call the same script again.
That way it will loop until the correct state.
Depending on the use case triggers might be a better option.
https://help.mypurecloud.com/articles/about-triggers/
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
------------------------------
Original Message:
Sent: 01-30-2024 02:46
From: Nuttapong Limadisai
Subject: Script screenpop after the interaction has been connected
I want the agent scirpt to send an API to the middleware after the agent presses answer to answer the call.

#ArchitectureandDesign
#Integrations
#SystemAdministration
#Telephony
------------------------------
Nuttapong Limadisai
G-Able Public Company Limited
------------------------------