Sharing a full system phone reboot script

Status
Not open for further replies.

seankann

New Member
Mar 18, 2024
3
0
1
43
The idea was taken from the script installed on the system, but I made it fully automated and will reboot all the phones. This is good if you are using it for multi-tenant.


It has two Python files. The only real difference between them is the vendors. One script has one vendor, whereas the other has a bunch of them.

It was tested on Debian and Ubuntu.

**Credit goes to the Fusion PBX team for creating the base of this script. I just took their idea and automated it. Credit goes to them**
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,500
414
83
Be careful running this kind of script on a big system, you may want to consider dividing groups of endpoints into chunks and put in a small delay between each chunk for two reasons:

1. You don't want to create an sustained outbound SIP message load that may saturate mod_sofia.

2. If you run a phone provisioning service, you don't want all of the endpoints to hit your server at the same time.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,500
414
83
@seankann Yes, you get the idea, probably no need to sleep after every endpoint, maybe every 10 or every 100, see code snippet below. And as I said you only really need to worry about this if there are a large number of endpoints.

Python:
import time

i = 1
while True:
    i += 1
    if i > 10:
        time.sleep(3)
        i = 1
    print(i)
 
Status
Not open for further replies.