Skip to main content

How to Remotely Reboot Yealink VoIP Phones

Recently, I have been required to find a method of manually rebooting user phones on the company network. From time to time, once they are up and running, we discover that some features are causing problems. Sometimes we cannot transfer calls, or we do not hear the person we are talking with. The causes may be numerous, but most of the time, a simple reboot of the phone solves the issues.

The problem with rebooting user phones is that the computers they are using are connected to the internet using LAN cables (for stability). The network cable is connected directly to the phone socket and then goes from the phone to the user’s computer. This saves the need for using two LAN cables; however, once the phone is restarted, the built-in switch is also restarted, hence the network connection is interrupted.

We have some apps that, when they lose network connections, will lock users and require additional action to unlock them. Hence, it is not ideal to restart the phones throughout the day.

As I checked the phones and settings, I struggled to find a simple scheduler to perform the task of restarting phones overnight, so I needed to find a different way.

Before you start, you need to know the admin password for your phone web panel. The admin password is typically set by the provider and rarely shared. However, they can also set a user password that will allow us to execute some commands.

Luckily, I got access to the admin and user password and confirmed that the method described below works for both.

Each VoIP phone, when connected to the network, downloads provider settings. These settings are called provisions.

To allow remote reboot, you may set one option through the phone web panel. However, this simple setting has one drawback, which I will describe. Because of this, by working with your provider, you can ask your supplier to add three configuration lines to the provision, which will allow you to swiftly reboot phones without issues. I will describe that as well.

Let’s begin.

Web Panel

This step requires admin access; however, you may skip it and go to the provision configuration section.

Log in to your phone web panel at https://yourPhoneIPAddress. You can find your local phone IP address by pressing the OK button on the keypad.

By going to the Features section, you will find an option for Remote Control.

Yealink T42U - Web Panel - Features - Remote Control

In the field Action URI Allow IP List, you can specify the IP addresses that are allowed to send remote control commands, such as the reboot command. You can either specify any (to allow commands from any IP) or limit it to specified IP addresses in the local network, such as 192.168.0.* (with the asterisk allowing commands from any IP within that range).

By pressing the blue Confirm button, we will apply this to the phone.

By adding this option, we are already able to send commands to our phone; however, this solution is not perfect.

The first time we send a remote command to the phone, a message will appear on the phone screen asking “Allow remote control?” to permit the execution of remote commands.

We can choose to answer “Yes” or select “Block.”

The problem is that if you have phones spread across the company, this means that, the first time you execute a remote command, you will need to physically click the approval button on each phone.

Once you confirm, any further remote commands will be executed without the need for additional confirmation.

This solution is not ideal; it would be better if we could perform this action without bothering our users or needing to physically access the phone.

Here is where your VoIP service provider can help: by adding three simple lines to the configuration (provision) that will be pushed to each phone.

Provision Configuration

To allow remote execution of commands on user phones, we can ask our provider to add the following three lines to their provision file. This should not be a problem for them, as it does not affect their end at all.

features.action_uri.enable = 1
features.show_action_uri_option = 0
features.action_uri_limit_ip = 192.168.0.*

The features.action_uri_limit_ip setting, as explained in the previous point, specifies the allowed IPs that can execute the command. In this case, it allows the entire network.

The features.action_uri.enable line is a generic setting that allows the execution of remote commands.

The features.show_action_uri_option setting removes the prompt/notification from the user’s phone asking “Allow remote control?”.

With that in place, you can execute remote commands without needing physical access to the device. For this purpose, you can use the command in the following section.

Reboot Script

To reboot the phone remotely, you need to execute the following command:

As an admin user:

https://admin:adminpassword@192.168.0.111/servlet?key=Reboot

As a normal user

https://user:userpassword@192.168.0.111/servlet?key=Reboot

Where 192.168.0.111 is replaced with the phone’s IP address.

There are a couple of ways to execute those commands.

You can simply paste it into a browser and visit it like any ordinary URL.

You may be required to accept an untrusted local certificate the first time you visit the URL.

You can implement it into the scheduler on your network devices.

For example, I use an OpenWrt router with cron functionality, which allows me to schedule commands to be executed at specific times throughout the day or night.

Crontab

00 6 * * 2-5 /bin/sh /root/voip_restart_phones

This command will run a script called voip_restart_phones at 6 AM from Monday to Friday.

voip_restart_phones

curl -l -s https://user:userpassword@192.168.0.111/servlet?key=Reboot

The file will contain a command for each phone that needs to be rebooted, with one command per line, specifying the IP address of each phone.

You may need to set execution rights for the file using chmod +x voip_restart_phones.


If you receive a 403 - User level forbidden response during execution, it means that remote command execution is not enabled. Check the previous steps to ensure that you or your provider have configured everything correctly. Restart your phone to apply the latest provision and try again.

Passwords with special characters

Sometimes passwords contain special characters. For example, p@ssword.

While it is not a problem to execute the command https://user:userp@ssword@192.168.0.111/servlet?key=Reboot in a web browser, you may encounter issues when trying to do this in the shell (bash).

In that case, you need to replace special characters with their URL-encoded equivalents. For example, the symbol @ becomes %40.

For example:

curl -l -s https://user:userp%40ssword@192.168.0.111/servlet?key=Reboot

This should work without any problems.


This way, by remotely rebooting phones, I resolved some network issues that occurred throughout the day.

Of course, to do this, you need to know the IP addresses of your phones. This is why it’s worth assigning static IPs to them based on their MAC addresses from the start.

Regards.

Share on Threads
Share on Bluesky
Share on Linkedin
Share via WhatsApp
Share via Email

Comments & Reactions

Categories