Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

IPCCX cti screen pop using http URL...

I would like to search a SQL DB in my IPCCX script so that it will do the following:

Get calling ANI in a variable. Parse the ANI so as to include "-" like this: '520-295-1111'

Then, run a SQL query and against stored ANI in new format to find a matching record against the table.

SQL query: select locationid from locations where phone = 'callingANI' (this is the calling ANI obtained earlier but don't know how to pass an IPCCX variable to the SQL query..)

If there's a match, grab the "LocationID" vlue for the matching number, place it in a variable.

Send a CTI screen popup using the following HTTP page on the connected agent computer:

the LocationID of 9846 would have been the value learned from the matching calling ANI...

so, high level: get ANI, Parse ANI, querey SQL column against ANI, store "locationID" value if there's a match. send http open to client containing the URL which references the value found from the LocationID...

VIP Super Bronze

Re: IPCCX cti screen pop using http URL...

To insert the value of a scalar variable within the script in your SQL query, you would represent it as $variable. If I use your example, it would be:

SELECT locationid FROM locations WHERE phone = $callingANI

Within the Success branch of your DB Read step, you should then have a DB Get step. If more than one row was returned, you would process each row by executing the DB Get command repeatedly. This is where you map the SQL field value back into CCX script variables.

After that, this is a basic Enterprise Data discussion to get the information into CAD. CAD Workflows would open the URL for the agent. Both of these have been covered on the forum many times; just search for them.

PS- Do not forget to release your database connection as soon as you are done using it!

Community Member

Re: IPCCX cti screen pop using http URL...

Thank you. Is there any easy way to parse the ANI so that the ANI format is xxx-xxx-xxxx?

Community Member

Re: IPCCX cti screen pop using http URL...

FYI, the variable i'm trying to insert is a CCX Variable; Not a SQL variable...

VIP Super Bronze

Re: IPCCX cti screen pop using http URL...

Yes there is; use an If step with the .matches() method to evaluate your variable. It includes the ^ and $ automatically.

Example of matching an E.164 number's area code

If (callingANI.matches("+1"..........))


----Set callingNPA = callingANI.substring(2,5)

----Set callingNXX = callingANI.substring(5,8)

----Set callingLine = callingANI.substring(8,12)



Keep nesting If statements as needed. Note you may need to test my substring(x,y) values; I'm not positive I have them correct for this example.

Community Member

Re: IPCCX cti screen pop using http URL...

thank you and sorry for all these questions.

how do I pass an IPCCX varialbe into the SQL select query? When I try "$xxx" it complains.

Furthermore, do you have a quick link to on of the guides which shows how to setup the cti screen pop after the variable is updated?

I created a workflow that will be triggered if the "LocationID" variable int eh script is not null and if not null, then the action is to do an http get... I may have it correctly but my script is complaining of something...

thank you

VIP Super Bronze

Re: IPCCX cti screen pop using http URL...

Using $ is the correct method of passing a script variable into your SQL query. The example within the DB Read step and the Step Reference Guide shows this as well. You need to be much more specific than "it complains" if this is not working.

Cisco Unified Contact Center Express Scripting and Development Series: Volume 2, Editor Step Reference 7.0(1)

Enterprise Data setup has been explained by many people on the forum. Here is mine:

The "screen pop" (CAD Workflow) is an entirely separate operation. I would not configure this until AFTER you have the needed Enterprise Data successfully appearing within CAD when a call arrives. The CDA Administrator guide covers workflow setup.

Cisco Desktop Administrator User Guide for CAD 6.6 for Unified CM

Community Member

Re: IPCCX cti screen pop using http URL...

Thank you. Not sure how to step through a debug to see what's going on but within the script, when trying to obtain the last 4 digits from the ANI, callingLine, it appears not to extract the last 4 digits and store that number in a variable.

When I explicitly fill in the variable with the last 4 digits, the cti screen pop appears to work - shows up in CAD integrated browser.

Here is what I'm trying to do - the ANI coming in is 10 digit (e.g., 5863333333).

set var_callingLine = var_OrigCallerANI.substring(6,var_OrigCallerANI.length())

Also tried

set var_callingLine=var_OrigCallerANI.substring(6,4)

can you see anything wrong with this set command? Am I missing something?

CreatePlease to create content