Having to randomly restart Asterisk service throughout the day

I have a FreePBX install running. I have had a couple of test endpoints running for a few weeks now just to test calling in/out etc. Everything seemed good so I deployed it across our school district the other night. Everything is going pretty good but I am having one HUGE problem. Randomly through out the day all new calls STOP. External can call into an IVR and get the IVR. I found out I can run service asterisk restart and within a minute everything comes back up.

I am fairly new to FreePBX and Asterisk and have no clue on the best place to start troubleshooting. Can anyone lend me some advice?

So your extensions are failing?

I’m not sure I’m clear on which part of the system you’re having trouble with. I recognize there’s a problem, I’m just not clear on which part.

Can you describe more this section : “all new calls STOP. External can call into an IVR and get the IVR.”

Hey everyone,

Sorry I am just now responding back to the questions.

My internal phones are failing. If I have an external number directed towards an IVR it will go through, if you go through the IVR and finally hit an option that calls an actual phone then it will just sit in dead space, no ringing, or anything. No internal calls will work and you can not call out.

I can restart Asterisk and within a minute everything will come back up. My voip gateway from my ISP is sip port 5080 and my internal phones are pjsip 5060. Im wondering if it is a pjsip issue. I honestly do not know where to begin.

it sounds like your phones are dropping offline. are you using the FreePBX firewall? and if yes is your internal network listed as a trusted network?

I am not using the FreePBX firewall.

it still begs the question about your phones dropping offline. when you can’t make an call, are your phones still showing as registered?

I will feel stupid but I can not answer that. The next time everything locks up I will check my desk phone.

the easiest way to check it is to use the FreePBX gui. go to reports, asterisk info then peers

Ok, I finally had a chance to check this. The phones are in fact unregistering. I also looked at CPU and it is maxing out completely. Whats odd is I have two devices registered with chan_sip and when this happens I can still call from one to the other but 2 way audio does not work.

Naturally, as soon as I restart asterisk the CPU level drops back down to a normal level. Looking at the CPU history it goes from 33% utilization to 87% in just under a minute.

ok, now some basic info.

you say you are running freepbx. what level? did you load it from a distro or did you roll your own?

Im running it from the distro online. It is running on VMWare ESXI with 8 quad core 2.00GHz processors and 16GB of ram.

which distro?

I downloaded the FULL ISO Stable 10.13.666-64bit version from freepbx.org/downloads

This sounds suspiciously like Fail2Ban seeing too many reregistration attempts and locking the host out.

Since F2B is just part of the firewall solution, would it be possible for you to configure and enable the firewall? It sounds like you have a system “in the wild” so a good firewall is essential to your financial well-being.

The CPU maxing out completely is troubling as well. Normally, the Load Average for the servers I run is in the low "1"s, maybe as high as ‘2’. What are your Load Average numbers (the command is ‘w’). If you have ‘top’, try running that in a console window and see what your processor is so interested in.

Currently I have f2b turned off but everything is behind our Fortigate Firewall. I turned f2b off because it kept blocking my phones even though they were registering fine, which this could be a whole other problem.

I am new and trying to educate myself on all of this, I want to apologize now if I am going about this all wrong.

Just to add to what I am finding out. I have been doing good for a couple of hours with no asterisk/CPU spike. I created a new extension and registered the device and within seconds the CPU spiked and phones became unregistered. Restart asterisk and I go back to normal operation.

um - there is clearly something wrong with your system. if i were in your shoes i would be tempted to reload from scratch.

i have not idea why f2b would be banning your phones - whitelist the phone subnet in f2b.

1 Like

That, as we say in the business, is darned odd.

There is something seriously amiss on your system. There is nothing inherent in any management function that would cause the system to just high-speed spin to death.

As I recommended before, the ‘top’ command from the machine console might be of some help. If the program that going nuts is Asterisk, we know it’s something in your configuration (or we’d be seeing a lot more of this). If it’s somewhere else, we can troubleshoot from there.

Let me make a suggestion to you. You have a business that depends on this system. You made an invest in the server so clearly the phone system is a critical role.

Have you thought of engaging FreePBX supports?

This may also be a more strategic issue better suited to the Sangoma Partner’s such as ourselves that can look at your entire deployment and support the system.

In either event I would engage some external resources before your management team tires of the solution.

If I can be of any assistance please don’t hesitate to call.

Micro Advantage, Inc.
Sangoma Gold Integration Partner
www.microadv.com