CCX Scripting Series – Terminating a Contact

Another common scripting issue I’ve encountered has to do with the way CCX scripts are configured to TERMINATE a contact. More often than not, I’ve seen script authors configure a script to merely END, thinking that CCX will automatically clean up a contact connection. In some cases, this is true; however, in many cases, not terminating a contact within the script will cause a delay in CCX clearing a CTI connection, or may even cause a CTI connection to hang. Eventually, if enough connections are hung, CCX will stop accepting contacts.

Ideally, prior to ending script processing, we will verify whether the contact is still active and if it is, terminate the contact before ending script processing. Additional info on scripting this process will follow over the next few days, but essentially we need a bool variable (bCallActive below) to check contact state. We add a GET CONTACT INFO step and assign the new bool variable (bContactActive) to ACTIVE. Then we’ll use an IF step to determine whether the bContactActive is true or false. In the true output branch, we’ll add a TERMINATE step to terminate the active contact, then GOTO END, wheres the false output branch will ideally have a GOTO END step.

This allows the script to either terminate a contact cleanly, if the contact is still active, prior to ending the script, or if a contact is not active, proceed with closing the script cleanly.

no terminate step terminate step