John,
As you've come to find out, reason codes are not exposed to the UCCX scripting engine. If you absolutely need to check reason codes you have two options that I can think of:
1. Query the informix database for the code
2. Check a CTI server for the information
Option one has the drawback of you know the agent to query, in additional the informix database is not 100% up to date and it is quite possible the data will not be written in a reasonable amount of time for your request.
Option two is the best option, CTI exposes real-time events that can be captured and analyzed including reason codes and wrapup data. Unfortunately, accessing the CTI service is not a trivial task if you are starting from scratch. There are only a few third party vendors (myself included) that have CTI applications built for the UCCX and can provide the information.
For your purpose, you may want to consider finding an alternative if option one does not work. Option 2 requires an investment that may be hard to justify for this one issue.
If CTI is the only way to go for your requirements please don't hesitate to reach out to myself to discuss further.
HTH
Tanner Ezell
www.ctilogic.com
Tanner Ezell
www.ctilogic.com