How to find number of buttons on handset

Version 1
    This document was generated from CDN thread

    Created by: Gordon Ross on 25-09-2013 02:50:51 AM
    Where in the database schema is the number of physical (ine) buttons a device has stored? (NOTE: I am not asking how many shared lines a phone has - that's easy!)

    The information in the phonetemplate table lists all the possible line buttons a phone could have (i.e. including side cards) But this is different to how many a phone currently has (i.e. if it is currently not configured with any side car)

    The Database docs for the phonetemplate table say that the "numofbuttons [is set to] the maximum allowed as specified in TypeModel"

    But the TypeModel table has no metion of the number of buttons a device can have - and doing a SELECT * on the table I can't see any field that matches the number buttons on a device.

    The best I've found so far (and it seems an ugly hack) is to take the typemodel name, replace "Cisco" with "Standard" and look that name up in the phonetemplate table. This can still product some nonsence: e.g. ATAs have 10 buttons! But it at least seems to match the number of buttons shown by CCMAdmin.

    Is this the only way to do it? Or is there a better way?

    GTG

    Subject: RE: How to find number of buttons on handset
    Replied by: Thomas Ellis on 27-11-2013 10:26:53 AM
    Hi Gordon,
    i'm not really sure on this one but I'll throw out a wild guess  In your SQL, you'll probably have to perform some JOINs.  Maybe take the device you're looking at and JOIN that device.fkcommonphoneconfig ON commonphoneconfigxml.fkcommonphoneconfig 
    and return the 'xml' field value from the commonphoneconfigxml table.  I don't really know what's in the xml but it may lead you in the right direction.  Sorry if it ends up being a waste of time.