Random incoming calls rejected / not coming through - [fixed]

I have set up FreePBX on a Dream Plug device using the PlugPBX project. It’s working well EXCEPT for one main problem.

The system does not always accept incoming calls. It works most of the time, but random calls do not even ring our phones.

If I call our main number (from my mobile) there will be periods of about 30 seconds every few minutes where the calls do not go through at all and instead are redirected to our main VOIP provider’s voicemail service.

We haven’t had any issues with outgoing calls.

When I have the main FreePBX screen open and I dial in a call (from my mobile) that doesn’t come through, I see the CPU spike to 100% before my mobile is redirected to the VOIP provider’s voicemail. This makes me think FreePBX is seeing the call but rejecting it.

Is that possible? Or is it likely to be a keep-alive time or something? I can’t find reference to this in the settings examples I’ve seen. And I’m not sure how to trouble-shoot.

This is obviously an important issue as several calls per day are not coming through.

I am running a small office with four phone extensions all linked to one VOIP provider account, the extensions are SPA504 VOIP phones. I’m new at PBX / Asterisk and plug computers although I use a linux desktop. Any help GREATLY appreciated!

Trunk PEER details:


USER details:


What is with all the invalid and “chicken soup” of codec’s in the User Details?

Also you don’t need both user and peer details if they are identical.

I added the codecs that are set up on the phones as the defaults, these were suggested by the VOIP provider, and then thought I’d better add the non-a versions as well. G711a and g729a are the two preferred codecs from my phones I think. I figured I’d rather allow all codecs than have a call not come through.

What would be the best line then? Should I change it to:


(I don’t know what alaw and ulaw are but they are there in many examples.)

Also, what do you mean by not needing peer and user details? ‘Peer’ says outgoing so I figured I needed the ‘user’ details to get incoming calls?

(Are either of these things possible reasons why the calls aren’t answered?)

In my very limited experience, intermittent problems with incoming calls are usually either provider (SIP or Internet) or NAT related. For that reason, I would suggest the following:

  1. Try another VOIP provider.

  2. Replace your NAT/Router with a completely different model.

  3. Try using a regular SIP Phone to connect to the provider and see if the problem persists.

  4. Change your registration password with your SIP provider to prevent legacy installs and other devices from stealing your registration.

  5. Check your VOIP provider’s Call Detail Records and the FreePBX Call Details Records. You should also read the Asterisk logs.

Go to your Linux command prompt and type:

cd /var/log/asterisk
nano full

This will show you today’s logs.

CTRL-X to exit.

Yesterday’s logs will be full.1, the day before full.2, and so on. I’d guess that you’ll find that the calls that you miss are never reaching your system at all.

Do a word search (CTRL-W) for the word “UNREACH” and you’ll see every instance in the logs where your VOIP provider was unreachable. If you register multiple VOIP providers and use Qualify=yes for all of them, you should be able to get a sense of whether the problem is ISP related or provider related by whether the unreachable issues are limited to one provider or occur with both.

  1. I’d also try running a more commonly used Distro, i.e. PBX In A Flash, the FreePBX Distro, Elastix, etc., and see if that solves the problem.

  2. Try running a ping-test on your system to rule out ISP related problems. From the command prompt:

mkdir \test
cd \test
ping google.com > pingtest

If you don’t want to ping google, you could also issue this command

tracert google.com

In the tracert, find the first or second hop and substitute the IP address of that in the commands above instead of google.com

Let that run for a couple of hours, then hit CTRL-C

nano pingtest

Scroll to the bottom and see what the longest ping reply time was.

I’m sure there’s a more sophisticated way to test your internet connection, but this is how I found out that my ISP was frequently losing all connectivity for 10 seconds every few hours.

Thanks for the help - I’ll check the asterisk logs and see what they say.

Also the rest of your info is very detailed and helpful, I’ll try pinging and see what happens.

I don’t think it’s to do with the provider or router as I’ve used them for quite a while by having our phones connected directly to the VOIP provider. I’ve only just introduced asterisk as the ‘inbetween’ service so my guess is that the problem is appearing there.

You’re right - I just had a test call fail and when I check the logs it’s not mentioned. The calls that do come through are in the logs no problems.

What does this mean?

Is there a “Registration Expiry (TTL)” setting somewhere that might not be set right?

As I said above, I never had this problem when I connected my phone directly to the VOIP provider.

Actually, I just found another device that was connected directly to the VOIP provider. I suspect that device may have been registering and ‘stealing’ the registration from Asterisk.

I’ve disabled that and we’ll see how it goes.

That might be it, but wouldn’t that just cause that device to ring instead of your PBX?

I recommend that you change your passwords with your VOIP Provider. That’ll prevent any legacy devices that are trying to connect using the old passwords from getting through.

Do you have g729 CODEC even installed?

Asterisk only support CODEC type g729 (do not add Annex A) and you have to purchase licenses from Digium.

g711 and ulaw are the same thing.

Why would you need alaw, that is European standard.

Can you point me to a page that explains how to install on a Dream Plug? I’d like to try it out. All I can find on PogoPlug’s page are instructions for the Sheeva.

Is it possible to boot the Dream Plug from an ISO or a USB DVD Drive and just install the same way that I’d install on a regular PC?

Because he’s in Australia.

I used the PlugPBX project which is a bit out-of-date but worked well enough for me to get it to work with limited knowledge of Asterisk or Plug Computers.

http://www.plugpbx.org/ is the main project

http://forums.plugpbx.org/index.php/topic,270.0.html is a thread that has a few instructions specifically for the Dream Plug

I’m hoping to write my experience into a little tutorial to make it a bit easier for beginners but I haven’t got there yet.

I am in Australia, and I read on another forum that our phones use g711a by default (I think). I have no idea which codecs I’ve got installed, I definitely haven’t installed anything that didn’t come out of the box.

What are the consequences of getting this setting wrong? Eg what would be the problem with allowing alaw even if it isn’t used in my country?

You can’t use g.729 then, it is a licensed CODEC.

If you are in Australia I would use alaw and ulaw only.

So??? Did you get it fixed?

I went around like a headless chicken for 4 days because of this. Do not put any user details. And yes someone here mentioned if they peer and user details are identical you don’t need it.

Also make sure you put fromuser or else the calls will drop or you’ll get busy signal.

Also don’t forget to forward ports
5060 - 5060
10000 - 20000

I have BELKIN and it was easy to setup. You can also run firewall tests in your
freepbx gui in the SIPSTATION page.

It seems to be fixed.

Since removing the other device (a softphone on a PC that I had forgotten about) all calls seem to be coming through, although I will keep testing.

Also, I removed some of the codecs as suggested and a call came through that kept dropping out. I put the codecs back in and it hasn’t happened again, not sure if it was random or what but I don’t want to test that during office hours so it will have to wait for evenings…

Thanks for the help, I’m impressed with the speed and helpfulness of the community here. IU have a few other questions as well that aren’t as important, I’ll search around and then post some of those up too if I can’t find the answers.

I would start your search here: