cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
464
Views
2
Helpful
6
Replies

SQL for Last Known IP

tryingtodomyjob
Level 1
Level 1

Hi, I am trying to write a SQL query for the device name, last active, and last known IP address. However, IP address is not showing. The phones do show their IP addresses in CUCM. What can I do to fix this?

tryingtodomyjob_0-1701708463176.png

 

6 Replies 6

dstaudt
Cisco Employee
Cisco Employee

AFAIK the registrationdynamice table is only supposed to work for IP addresses as of CUCM 12.5SU2+ (corrected)..even so I have not had much luck in getting it to show more than a few phone IPs.

The Risport70 web API is designed for this kind of registration/IP query, and would be the route I would recommend, since it's supported for all extant CUCM versions: https://developer.cisco.com/docs/sxml/#!risport70-api

Some samples in this repo: https://github.com/CiscoDevNet/serviceability-python-zeep-samples

Ah, you are correct...I've edited my post.

tryingtodomyjob
Level 1
Level 1

I don't see Risport70 web API able to search by and display the DevicePool information.

This is true...you would need to use AXL <getPhone> to obtain the device pool of a given phone: https://pubhub.devnetcloud.com/media/axl-schema-reference/docs/Files/AXLSoap_getPhone.html#Link698
The AXL <listPhone> request allows searching for phone by device pool: https://developer.cisco.com/docs/axl-schema-reference/
So the workflow could be something like:
* Obtain a list of phones for a particular device pool via AXL <listPhone>
* Retrieve the RIS status of the devices via Risport70 <SelectCmDeviceExt>, with <SelectBy>Name</SelectBy> providing each phone device name as an <Item> entry

I have used the CLI commands "show risdb query [phone|gateway|sip]" and then scraped what I needed from the text output. That worked for me on CUCM 10.5 and 12.5.