Get IP address by Phone Device DN

Version 1
    This document was generated from CDN thread

    Created by: Vladimir Banker on 06-08-2009 03:59:53 PM
    Hi!
    I need to find IP address of device by it DN.
    I know, that it is possible to find IP address using RisPort and selectcmdevice.
    1.But how I can find Device DN from Device Name?
    2.Additional question, after a lot of posts I still don't inderstood how I can get more then 200 results in selectcmdevice query?
    Thanks

    Subject: RE: Get IP address by Phone Device DN
    Replied by: Stephan Steiner on 18-09-2009 03:34:43 PM
    1) you can access the sql database that call manager uses... executeSqlQuery is the command you need to make sql queries to the database.
    DNs are in the table numplan, devices in the table device, and they are linked by the table devicenumplanmap (losely corresponds to the "line" part you see when configuring a directory number).
     
    without verifying
    select dn.dnorpattern from numplan np inner join devicenumplanmap dnmp on dn.pkid = dnmp.fknumplan inner join device d on d.pkid = dnmp.fkdevice and d.name = 'SEP123'
    would get you all the numbers on device SEP123
     
    2) First you extract all devices from the sql database:
     
    select name from device where name like 'SEP%' (there are more elegant ways.. and perhaps you want to use the cups client to make calls in which case they probably count as a phone too but they are not named like that)
     
    then suppose you have 500 phones.
     
    So you make 3 selectcmdevices requests.. one with the first 200 phones, the next with phones 201 - 400 and the last one with phones 401 - 500.
     
    Annoying, yes, alternatives? no!

    Subject: RE: Get IP address by Phone Device DN
    Replied by: NIGEL WARBURTON on 28-09-2009 08:20:44 PM
    Hi, dont forget that SNMP will give you the IP address information you need including its current state.

    Subject: RE: Get IP address by Phone Device DN
    Replied by: Sanjay Mehta on 02-10-2009 04:36:00 PM
    Hi Nigel
     
    That's exactly what I am trying to do. I wish to obtain the IP address using SNMP. I see that the ccmPhoneTable has the IP address info but as this is not indexed by its DN (phone extn). Given the phone's extension which is what we have, how can I extract its IP address using SNMP?
     
    Thanks in advance for any info provided.
     
    -sm

    Subject: RE: Get IP address by Phone Device DN
    Replied by: David Staudt on 02-10-2009 08:21:03 PM
    There is the ccmPhoneExtnTable, which may give you what you need.  Note that a given extension may be a shared line, and therefore may appear on more than one device.  It looks like multi-lines is reflected in the ccmPhoneExtnTable.

    Subject: RE: Get IP address by Phone Device DN
    Replied by: Sanjay Mehta on 05-10-2009 12:25:56 PM
    Thanks David.
     
    But it looks like I have to walk the  whole table, and then in my application iterate over each row to obtain the IP address that matches the phone number that I know of.
     
    It would be nice if there is an API/mechanism to get the phone IP in one step, given its phone number.
    Thx again.
     
    -S

    Subject: RE: Get IP address by Phone Device DN
    Replied by: Chikeobi Njaka on 13-01-2012 02:53:57 PM
    There is the ccmPhoneExtnTable, which may give you what you need.  Note that a given extension may be a shared line, and therefore may appear on more than one device.  It looks like multi-lines is reflected in the ccmPhoneExtnTable.

    Hi David,
    I'd like to get the IP address of a device (phone) by name ("SEP..."). I thought the getPhoneNtp(UUID) request would return the IP address in the return tag, but I get "Item not valid: The specified PhoneNtp was not found</faultstring><detail><axlError><axlcode>5007</axlcode><axlmessage>Item not valid: The specified PhoneNtp was not found". The phone is clearly registered and has an IP address.
    By the way, dumb question... what does "NTP" mean?

    Subject: RE: Get IP address by Phone Device DN
    Replied by: Gordon Ross on 13-01-2012 03:27:15 PM

    By the way, dumb question... what does "NTP" mean?

    Network Time Protocol
    http://en.wikipedia.org/wiki/Network_Time_Protocol

    Subject: RE: Get IP address by Phone Device DN
    Replied by: David Staudt on 13-01-2012 05:36:43 PM
    As a given DN can appear on more than one phone, it isn't possible to create a function that returns IP address for a given DN directly.  You can - via AXL - get a list of all phones on which the DN appears (see above), and then use Risport SelectCmDevice to get the IP of all those phones.

    Subject: RE: Get IP address by Phone Device DN
    Replied by: David Staudt on 13-01-2012 05:41:39 PM
    The AXL request getPhone will return a lot of information about a phone, but not it's IP address - for that you need to use the Serviceability SOAP (Risport) API.  getPhoneNtp is a specialty request used to obtain information about a particular configured Network Time Protocol that provides time sync services to UCM phones.