Cisco Support Community
Community Member

Finding Phone IP address with an ASP page.

Can someone point me in the right direction on this.

I need to find out how to find the current IP address(es) of phone(s) assoiciated to an extension.

I'm guessing that I could pull it from the SQL server.


Community Member

Re: Finding Phone IP address with an ASP page.

Yep you can get the information out of SQL, only thing is the way the IP address is stored. I think its HEX.

Community Member

Re: Finding Phone IP address with an ASP page.

Is there documentation as to the table or tables

you would need to query to find this info.


Re: Finding Phone IP address with an ASP page.

Sort of...

The Cisco IP Phones (ie 7960, 7940, etc) generally get their IP addresses via DHCP. Therefore, this information is not (to my knowledge) stored in the CCM030X database (FYI: Newer versions of CallManager have two databases, a database named CDR that holds Call Detail records and Call Diagnostic information, and a CCM030X database, where X is increased each time the CallManager is upgraded, so the exact name of the database will vary at different locations. eg: CCM0306).

Therefore, obtaining a list of actual IP addresses of all of the IP phones is not a trivial task or a simple database lookup.

The IP address (at least, the IP address assigned to that device at the time of the call) does show up in the CDR database as an integer(see the fields origIpAddr and destIpAddr), if CallDetailRecord generation is enabled. This would allow you to build a partial list.

For more info on CallDetailRecords:

Cisco IP phones have hard-coded hostnames based on their MAC addresses. For example, a phone with the MAC address 0030:94C2:9636 would have a hostname of SEP003094C29636. This is stored in the CCM030X database (as well as the extensions assigned to the phones).

To find the various phones registered on a CallManager cluster using the SQL database, look in the "name" field of the "device" table (of the CCM030X database). The tkClass field in the device table is a foreign key into the typeClass table. So, a SQL query: "SELECT * FROM device WHERE tkClass = 1;" would list all of the entries in the device table that are phones (though this would include softphones and such). Looking in the typeClass table you will see that a value of 1 corresponds to type "Phone", as a value of 2 corresponds to type "Gateway". The name field in the result of the above query would hold the phone device names (which for Cisco IP phones happen to be their hostnames. Softphones and other devices have varying names).

Another possibility is to use the AXL SOAP interface.

For more information on the AXL SOAP interface:

You can determine the IP addresses of the phones once you have the hostnames.

Check out the excellent Developer Support Central:

One final thought, is that Cisco IP phones, as all Cisco devices do, transmit CDP.

This was a longer message than I had originally intended. All of this information can be found by exploring your CallManager system or by documentation available publicly on Cisco's website. Hope this is of some help. I would be interested in any additional information or experiences others might have on the subject.


CreatePlease to create content