06-13-2018 02:59 AM - edited 03-14-2019 06:14 PM
How can i extract first and last name of calling user once call lands on UCCX system. Our requirement is to get First name and last name of calling user and pass it to other application. I tried to use Get User field but it says- User ID is blank.
06-13-2018 03:58 AM
Take it that these are from internal calls where you have an End user in call manager?
If so you might need to do a lookup of sorts
dir_url | String | "http://xxx:8080/ccmcip/xmldirectorylist.jsp?n=" |
Where xxx is your PUB
calling_number | String | "" |
xml | Document | null |
calling_number = Get Call Contact Info (--Triggering Contact--, Calling Number)
XML = Create XML Document (URL[dir_url + calling_number])
calling_name = Get XML Document Data (xml, "//DirectoryEntry/Name")
Set Enterprise Call Info (--Trigger Contact--) Variables Used:calling_name,calling_number)
Hope this helps
07-08-2018 01:53 AM
Thanks Tom. It seems that as output, we are receiving full name but we need first name and last name in separate variable. Is there option in xml directory to use first name as variable ?
08-20-2018 06:39 AM
Hmm
Not that I can think of off the top of my head, I did some digging and I am a bit stuck to come up a solution for that requirement as well.
Maybe someone else here could advise, have to admit I am curious if that is possible as well now.
08-20-2018 09:14 AM
You have a few issues in your logic. First you will receive a "best match" of 32 directory entries from the CUCM directory if there is no explicit match on your directory number query. If none of them match, your next Get XML step will fail, because it is returning a "null" response.
Once you do have a matching response, you can parse the XML data from the array string using a Java .split().
I will try to attach the working code (not sure if the website will allow .aef attachments... but I will try.)
This is a working script, you just need to provide the inputs of your CUCM IP address and the ANI (calling number) you wish to query in the directory.
Sincerely,
Sean
02-15-2022 02:38 AM - edited 02-15-2022 02:46 AM
02-15-2022 03:29 AM
08-20-2018 02:04 PM
This is all I do - it pulls the calling name from the phone.
Set callingParty = {
java.lang.reflect.Field ciscoCallField = contact.getClass().getDeclaredField("ciscoCall");
ciscoCallField.setAccessible(true);
com.cisco.jtapi.extensions.CiscoCall ciscoCall = (com.cisco.jtapi.extensions.CiscoCall)ciscoCallField.get(contact);
return ciscoCall.getCurrentCallingPartyDisplayName();
}
Then under Select Resource, set enterprise call info and assign callingParty to a callvariable.
Internal calls are 100% reliable, but external of course rely on the carrier information that was sent.
08-21-2018 06:30 AM
09-05-2018 01:14 PM
...I had some fun working with this, and created a script with some error handling for missing first name (last name is required for a directory entry, but first name is not--which produces a "null" error when trying to extract XML data from an empty set), multiple entries found (you will need to add your own logic for what to do when there is more than one user with the same dialed number), etc.
Use the interactive debugger to see what works for your requirements.
Enjoy!
09-15-2022 07:20 AM
I realize we are a few years removed from the last response. Hoping someone can shed some light on a variation of the above request. Our Numbers are formatted as "+1 555-555-5555" obviously the space is causing the problems with the query. Is there anyway to search for "Best Match"? thinking through the logic of the script...
Capture ANI
Trim ANI to a variable that only includes the "555-555-5555"
Insert said variable at the end of the xmldirectory url with a wildcard variable (If one exists)
Anyone have any recommendations or thoughts on this?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide