Getting a device mac address via AXL/SNMP

Version 1
    This document was generated from CDN thread

    Created by: David Robinson on 26-03-2012 12:51:48 PM
    Hey all,
     
    In my current system, I am making several AXL requests to a Cisco PBX in order to obtain various information about a device.  I am using things like listPhone requests to get a majority of the information for a list of devices.  I am also making a RIS request (SelectCmDeviceInfo) to obtain a couple more things.  In a completely seperate process, I have some SNMP requests that also obtain data from a device.  One piece of data acquired from the SNMP requests is the mac address.  I am using the "phone index" to return the correct mac address value from a given device.
     
    My first question should probably be something simple, like what is the best way to obtain the mac address of a device from the PBX?  It seems to be that the best way is via an SNMP request.  This leads into my second question.  Can the mac be obtained from an AXL request that I may have missed?  Depending on the answers to the previous questions, I will throw this out there as well.  Is there a way to obtain the "phone index" via some AXL request?  If I had the phone index, I could easily make an SNMP request to get the mac address of a device.
     
    While I am integrating with multiple versions of Cisco PBX's right now, lets start with answers pertaining to version 8.x.
     
    Thanks in advance.
    David

    Subject: RE: Getting a device mac address via AXL/SNMP
    Replied by: David Staudt on 26-03-2012 01:19:47 PM
    The MAC of a hardware phone is almost always included in the device's name, e.g.: SEP123456789012 or SEP
     
    In listPhone response, this will be the /return/phone/name element. 
     
    One caveat is that for things like IP Communicator - a PC soft phone that appears to UCM as a normal telephone device - the name is 'free form' as entered manually by the admin, and could contain something that does not include the MAC, e.g. CIPC-dstaudt.  Sometimes users will provision IPC device names with a MAC by convention.
     
    The 'phone index' as below is particular to the SNMP implementation, and is not available via AXL.

    Subject: RE: Getting a device mac address via AXL/SNMP
    Replied by: David Robinson on 26-03-2012 02:41:59 PM
    David (since you have the same name as me, this could get confusing!),
    Currently the system uses the name field to obtain the mac address, but the problem with that is the exact thing you metioned.  Since it is an editable field for softphones, if an admin changes the name, we no longer have a accurate way to obtain the mac.  This approach isn't going to work.
    I guess an SNMP request may be our best option, even if we have to walk through a table of data and use a little logic.  I would prefer if we could just use a simple query, but it doesn't seem like that is readily available. 
    Is there some other more widely acceptable way to obtain the mac address that I am missing?
     
     

    Subject: RE: Getting a device mac address via AXL/SNMP
    Replied by: David Staudt on 26-03-2012 03:05:51 PM
    The UCM database does not contain the MAC - other than if embedded in the device name as described - so I'm afraid AXL won't be of assistance.  The MAC as reported via SNMP might be more accurate in some cases, and as you say you will likely just need to walk the table periodically. 
     
    It might be interesting to review exactly what you are using the MAC for...in the case of IPC, which can connect over multiple network connections (each NIC having a different MAC), MAC is not necessarily tied to device 1-to-1...