CCX Scripting Series – Capturing Called and Calling Number

*NOTE:  This article does not address best practices, but merely the specific tasks associated with the objective.  Refer to the Cisco Unified Contact Center Express SRND for best practices.

There are several benefits to capturing calling and/or called party info in a UCCX script.

For example, if you wanted to prioritize or redirect calls from a high profile customer, you could capture the calling number  and perform a different call treatment for the high profile customer than you would for the typical caller.

Another example would involve capturing the called number as part of Cisco’s best practice of associating multiple jtapi triggers, those that have similar call handling requirements, to a single application to reduce memory overhead on the CCX server.  You would capture the called number and perform call handling within the script based on the called number.

To accomplish this, we’ll need to create a couple of string variables and capture the calling number and called number into those string variables.   We’ll create strings sCalledNumber, sCallingNumber, and one of my favorites, sBypassNumber.  Of the three strings, only sBypassNumber will be a Paramater so that we can define the value via the parameter on the Application configuration page.


We can then reference those string variables in a Get Call Contact Info step to capture the caller info.  When you drill down into the configuration of the Get Call Contact Info step, you’ll discover fields Calling Number and Called Number which we can assign the sCallingNumber and sCallingNumber variables.

Now we have the basis of our call-by-call routing process defined, we just need to put the appropriate steps in place to handle the call to our needs.  In this instance, by dropping in and configuring a Switch step, we can evaluate the value of sCalledNumber against multiple values stored in the Switch step.


Once the Switch step is configured and you click OK, you’ll notice output branches under the Switch step.  Each of the output branches corresponds to the Connections you configured on the Switch step.  Beneath each Connection output branch is where you will configure custom call handling steps to apply to calls that match the criteria.

In the example below, we insert an If statement to check whether the call came from our high profile customer at 888-555-1212.  If it has, processing flows through to the True output branch where we redirect the call to extension 1234.  Otherwise processing continues through the False output branch to the Switch step.

There are several different methods to validate a calling number.  If you only need to look for one or two specific calling numbers, you could utilize the example above and hard code the calling number in the script; however, if you needed to validate against a large volume of numbers, with UCCx Enhanced you could store the numbers in an XML file, or with UCCx Premium you could validate the calling number against either an XML file, or one of the many supported off-box database systems identified in the SRND.


Leave a Reply

Your email address will not be published. Required fields are marked *