I would like to be able to reboot any of our Polycom VVX410 phones from the command line on our PBX to resolve a variety of quirky errors I’ve noticed with the phones, especially after I make configuration changes. From what I’ve found, there are two ways to do this - with the REST API or via a call to curl.
First option
Curl would be the simplest method IMO as I don’t need to rely on the REST API to be enabled on the phones. However, I’ve been unable to get this to work. I’ve tried different combinations of parameters, headers, cookie settings, etc and always get 401 Unauthorized as a response. I know the base64 encoded password works as I can log in with https:///form-submit/auth.htm and it returns hypertext. There is a session cookie being set & sent along to the call to Reboot - this cookie is set when I use the -c option in curl. Weirdly, if I use -c in the subsequent call to Reboot, I get 401 Unauthorized, but if I use -b (cookie file in read only mode), I get 403 Forbidden. I am able to reboot a phone after logging into it’s GUI and then copying the parameters from the browser over to a curl call to Reboot. There is an ‘anti-csrf-token’ parameter in the browser which is not set as a cookie - research shows that this is meant to prevent cross-site scripting. My hunch is that this is what’s preventing the reboot from working, but all I get back from the call to auth.htm is a ‘lockparams|SUCCESS|0’ message. Does anyone happen to know how to reboot a VVX410 running firmware 5.9.8.5760 from a command line?
.
Second Option
The other option is to use the REST API in the phone. This is very simple to make work from the command line, but would require me to log in to each and every phone to enable REST in the phone’s GUI, plus remember to manually do this for every new / replacement phone. Looking online, I’ve found various ways of enabling this from the provisioning server:
Unfortunately, I have been unable to get the basefile editor to add a section to any of the config files for the test template I created. The directions at the top of the basefile editor are:
Every basefile entry requires the following.
A “File”.
Needs to be the name of the file the setting will be in. ie:mac-legacy, features, etc. If you do not know what the file name is, click on an existing setting.
A “Section”.
For instance:
To add an entry to the Port_Config section, “Section” needs to be set to Port_Config (case sensitive).
To create a new section, “Section” needs to be the section it will be within (use “TOP” if it should not be in a section), PARAMETER is the new sections name, and VALUE would be “PARENT” to define it as a new section.
A “Parameter”.
This is the setting name.
A “Value”.
This is the actual setting.
I’ve followed the directions at the top in every way I can think of interpreting them, trying to add a new section, add a new parameter to an existing section, and I even tried swearing at it, but nothing I’ve done has resulted in being able to add any of the parameters I’ve found online to the basefile. About all I’m left with as far as to possibly make it work is to find where the config files are kept in the file system & manually edit them, which I’m warned not to do because the changes will be overwritten whenever the basefile editor regenerates them. While I would prefer to simply use curl instead of opening the REST API on the phones, at this point I’m willing to settle for just making it work and moving on with my life. So barring a solution to the question in the first option, how would I go about enabling the REST API on the phones in bulk from the server when they’re provisioned?