› VitalPBX Community Support › General Discussion › Send email if Trunk fails to register or is not registered
- This topic has 7 replies, 5 voices, and was last updated 6 months, 1 week ago by
vividtelecom.
- Post
-
- November 14, 2018 at 8:20 pm
Hi,
Is there a way to get VitalPBX to send me an email whenever the SIP trunk is no longer registered or registration fails ?
We have encountered several incidences where the Trunk is no longer registered (for don’t know how many days) and only found out when people ring our mobiles to say they can’t ring our SIP phone number.
Thanks.
0
- Replies
-
- November 14, 2018 at 9:25 pm
This is how I do it. I make no warranties about its suitability, but people are free to have a look and try it if they want. It can be downloaded from this folder:
https://mega.nz/#F!UHZmGQKR!KsC0lhZ11ttm95ZpUOWxSg
The relevant script is called trunkcheck.sh
In the section “User-defined variables and arrays” you need to specify the email address to which messages will be sent, and the “username” of each SIP account (usually a numeric value), plus a “friendly” string for each SIP account so your email is more informative. You then set up a cron job on the asterisk box to check the trunks, say every 10 minutes.
If a trunk is down when the cron job runs, you get an email message:
Trunk 1234567 is now down DIDLOGIC 0787878787 failed to register with a sip server
and if it has changed back to being up when the next cron jobs runs then you get another email to tell you that:
Trunk 1234567 is now up DIDLOGIC 0787878787 has registered with server sip.au.didlogic.net
I make no guarantees for this script, but it works well for me.
1- November 15, 2018 at 1:53 am
Special thanks to tonywhelan to share his solution. However, we will try to implement this kind of notifications through the GUI.
0- November 15, 2018 at 10:09 pm
- November 30, 2018 at 8:25 pm
I have replaced the previous script with a modified version (same name) that logs all trunk status changes into a single log file rather than having separate log files for each trunk.
The new log file includes the trunk username and description for each line in the log. for example:
1059551,Main DID 6501234567,2018-11-30,20:17,DOWN
1059551,Main DID 6501234567,2018-11-30,20:22,UPThe log file is created in folder /usr/share/ombutel/www so it can be retrieved using a web browser – eg http://your.pbx.ip/trunklog.txt
The script is called trunkcheck.sh and can be downloaded from this folder:
https://mega.nz/#F!UHZmGQKR!KsC0lhZ11ttm95ZpUOWxSg
You just need to edit the script by entering your trunk usernames and a friendly description for each trunk. Instructions are contained within the script.
cheers
0- July 10, 2020 at 1:29 pm
- July 11, 2020 at 3:32 am
- July 11, 2020 at 9:24 pm
- You must be logged in to reply to this topic.