Terminates a script.
- If you use End in a script with an unsupported media type, it may not end all processes properly or the contact. Ending background processes is a key function of terminating actions. For this reason, it's important to use the action best suited for the media type of your script:
- For inbound phone scripts, you can use End as long as the call hasn't connected. After a call connects, use the Hangup action to terminate the script.
- For outbound phone scripts, you can use End until the Placecall action executes. After the call connects, use the Hangup action to terminate the script.
- For chat scripts, use Exit to terminate the script.
- For email scripts, use Discard to terminate the script.
- For digital scripts, End only terminates the script. It doesn't terminate the contact. Digital contacts continue to exist in Digital First Omnichannel. For all other script types, End terminates both the script and the contact.
- If you use End in a subscript, it terminates both the subscript and the originating script. Use the Return action if you want to terminate the subscript but for the originating script to continue.
- End should be used to terminate the logic flow of an active script and invoke the OnRelease event action. For this reason, it shouldn't be used after the OnRelease event logic.
Supported Script Types
- Discard—Terminates an email script.
- End—Terminates a phone, voicemail, SMS, or digital script. Does not terminate a digital contact, but terminates contacts in scripts with other media types.
- End a Contact—Terminates the active contact. Does not terminate the current script.
- EndText—Terminates an SMS workflow that doesn't include a Regagent action (for Digital Channels only).
- EndWi—Terminates a work item with a cause code. Does not terminate the current script.
- Exit—Terminates a chat session and disconnects the chat contact.
- Hangup—Terminates a phone script.
- Return—Terminates a subscript and returns control to the originating script.
Do not use the Stop action to terminate a script. It doesn't terminate the script and leaves contacts running. This has a negative impact on the CXone servers.
Phone Script Example Using End
This script shows a very simple example in which End is used in a phone script, but the outbound call was never placed because an error occurred. If the error had not occurred, Placecall would have been triggered, and you would have used Hangup in a different branch. Refer to Placecall to see an example of using Hangup in a phone script.
Would you like to download this script?