Trunks losing registration. Would love to log

Hey folks. I have several FreePBXs out there, But one is having issues. I think it’s 14/13. It was 13/13 and I did a rebuild because the SIP trunks were losing registration. Well, the problem is still here and I need to figure out what’s happening. I could look at the /var/log/asterisk/full, but I’ll be honest and say I don’t know what to look for (big files with lots of lines put me to sleep). So if there’s some text I can grep for, or better yet, the ability to send me an email when registration goes away, I’ll be able to help this client. The carrier cannot do a log due to the extreme amount of registrations they deal with. So any help would be a good thing.

Rather unsurprisingly,

grep -i registered /var/log/asterisk/full

would provide that info. To email them “as they happen” , try in a bash session

IFS=$’\n’; for i in $(tailf /var/log/asterisk/full|grep -i register);do echo $i|mail [email protected]; done

I tried this, but there was still too much info, so I changed the statement to ‘tail -f /var/log/asterisk/full | grep -i voip’, which showed me this, where XXXX…XXX is my SIP carrier, beginning with “voip”:

[2018-07-02 16:09:13] VERBOSE[29670] pbx_variables.c: Setting global variable ‘OUT_2’ to ‘SIP/XXXXXXXXXXXXXXXXX’
[2018-07-02 16:09:14] NOTICE[3798] chan_sip.c: Peer ‘XXXXXXXXXXXXXXXX’ is now Reachable. (22ms / 2000ms)

I’m wondering if this will be enough for me to determine a SIP trunk outage. Thoughts?

Not exactly, but if you grep for “Peer 'XXXXXXXXX” you should find out when and where you network is failing.

So I tried this:

tail -f /var/log/asterisk/full | grep -i peer

Then I went into Connectivity | Trunks and disabled one of my trunks. I saw nothing upon disable, but when I enabled it, I got this:

[2018-07-03 12:09:36] NOTICE[3798] chan_sip.c: Peer ‘XXXXXXXXXX’ is now Reachable. (21ms / 2000ms)

So clearly I’m not grepping the right thing.

“Peer” is different than “peer”. Capitalization is important in grep.

Try the case insensitive (-i)

grep -i reachable

Sorry for the delay. I was working on some projects. So I tried tail -f /var/log/asterisk/full | grep -i reachable, and I only see when the trunk comes back into service. I see nothing when it goes out. Having said this, I’m going into the GUI and disabling one SIP trunk. That might not even be a valid way to simulate an outage.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.