One agent is logged in and is on an outbound call, made from the IPCC line (phone only has one line) so the system sees them as not-ready (code 32762).
The customer would like to queue calls in this case, but not queue calls if the agent is in not ready for other reasons (like RNA, or lunch).
Through conventional scripting, I can see how many agents are logged in, talking, ready, not ready, etc. I can't see the reason code though for not ready agents. I beileve the database record is written after the state changes, so I don't think I could query the database for this either.
Any thoughts on how I could find this out so that I can queue those calls?
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.