Send email if Trunk fails to register or is not registered

VitalPBX Community Support General Discussion Send email if Trunk fails to register or is not registered

  • Post
    CKLee
    Participant

    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
Viewing 7 replies - 1 through 7 (of 7 total)
  • Replies
    tonywhelan
    Participant
    Up
    1
    Down

    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
    Up
    0
    Down

    Special thanks to tonywhelan to share his solution. However, we will try to implement this kind of notifications through the GUI.

    0
    CKLee
    Participant
    Up
    0
    Down

    Thanks Tony. I’ll have a look when I get a minute. I also look forward to seeing this as part of the GUI as well.

     

    0
    tonywhelan
    Participant
    Up
    0
    Down

    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,UP

    The 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
    netplusnetworks.com
    Participant
    Up
    0
    Down
    have you guys implemented this in the GUI yet?
    0
    Up
    0
    Down
    @netplusnetworks.com,

    Not yet, but is something that we will include in the future!

    0
    vividtelecom
    Participant
    Up
    0
    Down
    Hi,

    It seems that the URL provided above is no longer working.

    How can we retrieve the script

    0
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.