Plantronics + Polycom. Now together as Poly Logo

REST API to get list of firmware available for phone

SOLVED
Occasional Contributor

REST API to get list of firmware available for phone

The REST API to access and control our VVX 600 phones is fantastic, but it's missing one thing that would be helpful: a list of the available firmware versions (most importantly the latest version).

 

I know the phone itself can go out and query the Polycom servers to get this list in XML format via:

 

https://1.2.3.4/Utilities/softwareUpgrade/getAvailableVersions ...

Which outputs:

<PHONE_IMAGES>
  <REVISION>
    <PHONE_IMAGE>
      <VERSION>4.1.6.5734R</VERSION>
    </PHONE_IMAGE>
    ...
  </REVISION>
</PHONE_IMAGES>

 

I considered sniffing where this page actually gets its data but thought it better to ask if there is a way to get this information "officially" in one shot online, such as something like:

 

https://polycom.com/spiffy/json/list/of/firmware/versions

 

Otherwise, a way to access that list of available versions via a phone's REST API would be great.

 

I know there is a nice human-readable page that I could scrape for the info, but that's far less efficient than calling a nice REST API page or even a simple XML page.

https://support.polycom.com/content/support/north-america/usa/en/support/voice/polycom-uc/polycom-uc...

 

Message 1 of 4
3 REPLIES 3
Polycom Employee & Community Manager

Re: REST API to get list of firmware available for phone

@shdwlynx,

 

The phone does not locally maintain a list of available software; in each case when you use the Web Configuration Utility to "Check for Updates", the phone is reaching out to the Polycom Hosted Server (or Custom Server if configured) to fetch the current list.

 

To get the list of software for your phone in xml format you will need to make the same request as the phone does, to the Polycom Hosted Server.

 

This is your Request-URI:

 

http://downloads.polycom.com/voice/software/{partNumber}.xml

 

Each model phone has a part number which will be needed as part of the Request-URI, as seen above.

 

For example, the VVX 600 will send a GET request to the following URL, which returns a list of supported software for that model phone:

 

http://downloads.polycom.com/voice/software/3111-44600-001.xml

 

However, in checking the REST API Reference Manual, the part number does not appear to be something you can retrieve via REST--but the model number is.  And as luck would have it, we get the model number in the same API that returns the firmware version: Management.DeviceInfo or Management.DeviceInfo Version 2, here's what a successful response looks like for the latter:

 

{
 "data": {
 "ModelNumber": "<PHONE_MODEL>",
 "DeviceVendor": "Polycom",
 "DeviceType": "HardwareEndpoint",
 "MACAddress": "<MAC_ADDRESS>",
 "Firmware": {
 "Application": "<APPLICATION_VERSION>",
 "Updater": "<UPDATER_VERSION>",
 "BootBlock": "<BOOTBLOCK_VERSION>"
 },
 "IPAddress": "<PHONE_IP_ADDRESS>",
 "IPStack": "IPv4 Only/IPv6 Only/(Dual IPv4/IPv6 stack)",
 "PreferredNetwork": "<IPv4/IPv6>",
 "IPv6Address": "<PHONE_IPV6_ADDRESS>",
 "IPv6LinkAddress": "<LINK_LOCAL_IPV6_ADDRESS>",
 "IPv6ULAAddress": "<UNIQUE_LOCAL_IPV6_ADDRESS>",
 "UpTime": {
 "Days": "<NUMBER>"
 "Hours": "<NUMBER>",
 "Minutes": "<NUMBER>",
 "Seconds": "<NUMBER>",
 },
 "AttachedHardware": {
 "Camera": "<True/False>"
 "EM": [
 "Type": "<Paper/LCD>"
 "Version": "<EM_VERSION>"
 ]
 },
 "CanApplyShutdownRequest": "<True/False>",
 "IntendToShutdown": "<True/False>",
 "AppState": "<PHONE_STATE>",
 "ReadyToUse": "<True/False>"
},
 "Status": "2000"
}

(If you're looking to send a request as a periodic heartbeat, then this is the one.)

 

From there we need to create a dictionary of key-value pairs to resolve the model number to a part number.  Similar to this excerpt in C#:

 

protected Dictionary<string, string> _partNumbers = new Dictionary<string, string>()
        {
            { "VVX 300", "3111-46135-002" },
            { "VVX 310", "3111-46161-001" },
            { "VVX 400", "3111-46157-002" },
            { "VVX 410", "3111-46162-001" },
            { "VVX 500", "3111-44500-001" },
            { "VVX 600", "3111-44600-001" },
            { "VVX 1500", "2345-17960-001" },

            { "VVX 101", "3111-40250-001" },
            { "VVX 201", "3111-40450-001" },
            { "VVX 301", "3111-48300-001" },
            { "VVX 311", "3111-48350-001" },
            { "VVX 401", "3111-48400-001" },
            { "VVX 411", "3111-48450-001" },
            { "VVX 501", "3111-48500-001" },
            { "VVX 601", "3111-48600-001" },

            { "VVX 150", "3111-48810-001" },
            { "VVX 250", "3111-48820-001" },
            { "VVX 350", "3111-48830-001" },
            { "VVX 450", "3111-48840-001" },

            { "SoundStructure VoIP Interface", "3111-33215-001" },
            { "VVX D60", "3111-17823-001" },

            { "Trio 8500", "3111-66700-001" },
            { "Trio 8800", "3111-65290-001" },
            { "Trio Visual+", "3111-66420-001" },
        };

 

Please note: The above may not be an exhaustive list and may contain errors, I'd recommend some due diligence and would verify the part numbers based on release notes, and model numbers based on actual REST responses, when creating your own resolution table.

 

Now that we know the part number of the phone we sent our REST request to, we can make another request to fetch the list of software ourselves.  I'm sure our domain logic will deviate here, but below you will find a screenshot of a powershell core script which gives me the list of software builds available for the specified phone:

2019-08-20_19-57-43.png

 

Please note: Support is not guaranteed for any third party application.

 

The list of paths above reflect the value of device.prov.upgradeServer which is configured when you complete a software upgrade via the Web Configuration Utility -- you can check this parameter's current configuration within the device element of a phone backup.

 

Keep in mind that the list of software builds available via these files are used by the phones when checking for updates.  These files are periodically updated and software builds may be added or removed without prior notice.  Please use this information responsibly by caching the results and not hammering the resource links provided.  Abuse of this service (i.e. DDoS) may result in an IP block.

 

Best of luck!

Message 2 of 4
Occasional Contributor

Re: REST API to get list of firmware available for phone

@polyben, you win the award for absolute fastest response time and most complete answer on the first try.

 

Thanks, this is perfect!

Message 3 of 4
Highlighted
Visitor

Re: REST API to get list of firmware available for phone

@shdwlynx It is worth noting if you are using VVX600 these are now in support mode only (5.9.xxxx releases only) and no new features are being added. I don't know if your intent is to autoupdate the devices but with firmware being a major update to a device an "if it isn't broke down't fix it"  attitude is usually good. It is also good practice to read the release notes before updating as sometimes features are removed or changed, which can cause issues to a stable deployment.

Message 4 of 4