Showing results for 
Search instead for 
Did you mean: 

How to change Calling Number in CCX script 11.X

Hi ,

I need to change the calling number when the call goes to Agent/External number. How to change the calling # in UCCX script ?


Thanks in Advance.

R Rao.

VIP Collaborator

Do you need to do this in a script? Could you instead setup a calling party transformation in CUCM?

If you must do it in a script, you need to capture the calling party number and assign it to a variable.
Create a string varialbe - callingNumber
Get Call Contact Info (--Triggering Contact--)
- Attributes (Calling Number) - callingNumber

At this point you have captured the ANI, and can then perform whatever manipulation you want on the string variable.

I came till there. But then I was wondering if there is any way to set calling Number (modified) when call goes to Agent. I was exploring  Set Call Contact Info ; but could not figure out how to achieve this. ( I could do this in ICM/CCE). 

In this usecase we need to modify only when call comes from few numbers.



R Rao




I was really hoping you'd share something along the lines of this:

Did you come up with the calling name trick, or did you see it somewhere? If not you as the original author, I wonder if the original author could devise a way to manipulate the number. After all, CER can modify the calling number via its CTI integration.

I am sure I was not the first, but did have that on my own as far as I knew. It is part of the JTAP Dev extensions.

The JTAPI extension - CiscoCall of course has various other fields we can pull data from. getCurrentCallingAddress() should pull the ANI but its not necessary as the calling number is already sent to CCX so using the built in Get Call Contact Info should be enough as all either steps are doing is to pull data into a string variable.
For reference:

Getting the CNAME via jtapi seemed to be the only way I could find to pull that info from the call.

Then instead of the default layout, we can push the manipulated number to Finesse via the Set Enterprise Call Variable step and ECC layout. The main issue with this is the number will differ than what is presented on the phone as CUCM knows nothing of this manipulation.

Right, but I mean, and forgive me if this is ignorant, that same document has a section titled:

Modifying Calling Number

Is it not possible to tap into this JTAPI interface and do more advanced operations with it?

Thanks, that might be possible. I am not sure If I can integrate Jtapi Library with CCX scripts and call those function.  For now playing with the Calling Number transformation seems the easiest way out.


Thanks for your help.


R Rao


I think that a possible solution would be to use CURRI.

This is enabled on a DN, Translation Pattern or Route Pattern and allows manipulation of various things including calling number.

In simple terms the way it works is a call hits a number with a CURRI based external call control profile enabled, CUCM then sends a https post containing an XML file with called and calling number and decisions can be made based upon those.

The server which receives the https post responds with an XML document which contains details of how the call should be treated. Possible actions include manipulation of the called and calling names and numbers as well as blocking/diverting the call and playing a CUCM announcement.

The XML snippet in the response that modifies calling number is shown below.


<cixml version="1.0">
        <modify callingnumber=[number] callednumber=[number] callingname=[name] calledname=[name]/>
I have tested using UCCX itself as the http server that responds to the CURRI request and it worked fine (just sending a static XML response that tells CUCM to play an announcement before connecting). It should be possible to write a CXX script that would modify the calling number according to whatever rules you need (and possibly retrieving these from a database/XML or JSON file or a system with a REST API).
Alternately if you are comfortable with a lanaguage like Python you could write a script that modifies the number and use a web server like Apache to serve it.

Did you figure out how to get UCCX to read the CURRI request XML body content in UCCX?

I guess for me its a question of to what end? The OP simply asked to pass a modified calling number to the agent.
I have not personally dug into the JTAPI more than I have had to. While its in the API and the scripting allows it, there seems to be more simple methods to achieve the result.

I thought the OP mentioned displaying the calling number on the phone, and not in enterprise data, but no that I re-read the thread, I don't actually see them asking for that. I must have made that up in my head.
Content for Community-Ad