Implemented 3CX SBC Status in Admin GUI

  • Thread starter Thread starter Anonymous
  • Start date Start date
Status
Not open for further replies.

Anonymous

Especially with the emphasis on hosted installations, I forsee many SBC's being deployed, either hardware (Pi) or software on Windows clients. Rather than depend on the "Lost registration" notification per extension, Is it possible to treat the SBC similar to a trunk as for as visibility and notifications go? i.e. a new line item under the System Status or maybe show up in the Bridge section. The big difficulty in my mind is if 3CX tracks the SBCs differently from a 3CXPhone tunnel.

As it sits right now the only method of monitoring is status notification by extension, and that has the potential to generate mass amounts of email traffic.

Thoughts?
 
Upvote 134
Hi Troosters,

The Raspberry Pi, in particular, can be an excellent SBC - but it has some quirks that need to be addressed in order for it to be reliable. If you have the patience, you can create a provisioning formula that will let you roll out dependable SBC's. We create a standard Pi image that we know works and then we use that to create SBC's for clients as we on-board them. One specific weakness that many people encounter is that the SBC service can start up too quickly. I think this issue contributes to the opinion that the SBC's are unreliable. The service needs to be restarted after the network is up and connected for tunnel to establish itself correctly. This can be done by creating a script and adding it to the startup procedures. The steps below accomplish this.

############### SSH into the PI ####################
# make yourself a superuser for the next steps
sudo su

# create a shell script to use to fix the problem
nano /home/pi/3cxsbcrestart.sh
## script begin
sleep 10
service 3cxsbc restart
## script end

# <ctrl>x, then y, then <enter> to save the script

# set the permissions so it can be executed
chmod +x /home/pi/3cxsbcrestart.sh

# edit the list of startup scripts
nano /etc/rc.local

# add this somewhere towards the end
sudo /home/pi/3cxsbcrestart.sh &
# <ctrl>x, then y, then <enter> to save the script

##############################################
If you have any questions, feel free to email me at [email protected]

Best,

Kirk

We have been using DSXDATA's excellent restart script. We use it on both RPi and Debian based systems. After an SBC did not reconnect after an extended power outage we dug into the issue and found the client environment is not fully up for several minutes after a total power loss that drains the UPS batteries. So, we set out to modify the script to restart the 3CX SBC service only after the network is verified. I know this script will never timeout, and for our purposes, that is ok - if you see other issues please let me know. So far it has tested well, even if internet does not activate for 15 minutes or more.

We modified the 3cxsbcrestart.sh script to the following:

## script begin
while ! wget -q --tries=10 --timeout=20 --spider http://google.com; do sleep 5;done
service 3cxsbc restart
## script end

Basically, the script checks to see if the Google web page is available, and if not, it sleeps for 5 seconds and tries again. Once it succeeds it moves on to the next line, which restarts the SBC service. (We also include a line that restarts our remote control service, as it also had issues when this happened.)

Feel free to contact me directly - [email protected]
 
We have been using DSXDATA's excellent restart script. We use it on both RPi and Debian based systems. After an SBC did not reconnect after an extended power outage we dug into the issue and found the client environment is not fully up for several minutes after a total power loss that drains the UPS batteries. So, we set out to modify the script to restart the 3CX SBC service only after the network is verified. I know this script will never timeout, and for our purposes, that is ok - if you see other issues please let me know. So far it has tested well, even if internet does not activate for 15 minutes or more.

We modified the 3cxsbcrestart.sh script to the following:

## script begin
while ! wget -q --tries=10 --timeout=20 --spider http://google.com; do sleep 5;done
service 3cxsbc restart
## script end

Basically, the script checks to see if the Google web page is available, and if not, it sleeps for 5 seconds and tries again. Once it succeeds it moves on to the next line, which restarts the SBC service. (We also include a line that restarts our remote control service, as it also had issues when this happened.)

Feel free to contact me directly - [email protected]

Hi

Thanks for your feedback.
Can you update the sbc or let me know what version you are using?
YEs true - your script makes sense because there were versions of the SBC that were not detecting that the network is up. But this issue was fixed and the SBC no longer needs to be restarted when the network is lost. Lets ensure you have the latest update.
If you do, we will investigate your case.
In the meantime your fix makes sense - basically you restart the sbc once the network is healthy like this you bypass the ip detection bug and it will find network ready and connect. But this was a solved bug I remember..
 
Thanks Nicky, that is good to hear! I will check the version and get back to you.
 
Thanks @nickybrg , we appreciate any attention on this : )
 
We install ScreenConnect on all SBC units now, so we can remotely manage them without direct access or firewall rules, but if you can proxy web requests to phone web pages can be launched that would be very beneficial.

Are you deploying Windows SBCs or PI's?
 
We use Pi's on smaller installs and Debian on larger ones. The same deb ScreenConnect install works on either one, but Java jre needs to be installed on Debian first.. We have a few Windows units as well, but are not deploying new on Windows - no issues with Windows, but the Debian based SBC seems just as stable and we avoid all the Windows issues and licensing.
 
Just to update everyone, this feature is definitely going to make it into the PBX and quite soon too.
 
Thanks Nick!
 
Thank you for the update Nick this is very encouraging.
 
"add this somewhere towards the end".....

So, because I am not familiar with Linux scripts, I must ask where exactly I should put the line "sudo /home/pi/3cxsbcrestart.sh &". Below is the entire contents of /etc/rc.local. Can I put this line after "exit 0"? Anywhere in between, but obviously not preceded by a #? Anywhere so long as it is BEFORE "exit 0"?

################################################

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi

exit 0
################################################


Many thanks!
 
"add this somewhere towards the end".....

So, because I am not familiar with Linux scripts, I must ask where exactly I should put the line "sudo /home/pi/3cxsbcrestart.sh &". Below is the entire contents of /etc/rc.local. Can I put this line after "exit 0"? Anywhere in between, but obviously not preceded by a #? Anywhere so long as it is BEFORE "exit 0"?

Yes, BEFORE the exit. We normally put it the line before, as the last command to run.
 
That's great to hear, @Nick Galea, thank you for the update!
 
Will we see this in SP3?
 
@Nick Galea any updates on this? We have been rolling 3cx out on a few per week basis, but after this we plan on rolling it out in bulk . Any attention on this matter would be much appreciated!
 
  • Like
Reactions: accentlogic
Almost 2 years in progress, this should be a focus update.

Also with all the Cloud based 3CX servers
 
  • Like
Reactions: OCWI and 3CXDude
The latest pi sbc update has helped with reliability with it not requiring so many restarts. However deploying that was very costly as about 21% of our units required an onsite visit. I think with the tools mentioned here that would not have been the case.

We look forward to the added value this idea will bring to the product line. Is there any updates as to the status of its development or is there anything we can assist with in any way that would help?
 
  • Like
Reactions: accentlogic
+1 Was this ever implemented? If not, any timeline?

I would love if the SBC could also monitor the quality of the connection --- even if just a simple PING or some latency check between 3cx server and SBC.

Thanks!
 
  • Like
Reactions: accentlogic
I think SBC is based off this framework: https://www.resiprocate.org/
I wonder if there are any 3rd party monitoring solutions.... anybody know of the resiprocate.org libraries?
 
Status
Not open for further replies.