Help! randomly cant call out every AM until restart

I’ve been trying to track this down for months now. For some reason randomly in the mornings an AsteriskNOW server I built using FreePBX wont allow calls out until I stop wanrouter, stop asterisk, then restart both. I get ‘all circuits are busy now’. I have two POTS lines going into a Sangoma FXO card. Can anyone please point me in the right direction? i’m stumped. Its completely random as to when it happens. Its roughly once a week though :roll:

Any ideas?

Btw, I just looked in the Dahdi section, and it looks like both POTS lines are assigned to group 1, so there is only Zap/g0 in my trunks section. Outbound routes are set only to use Zap/g0

(thank you so much for your help on this by the way.) I’m very new to asterisk/pbx.

This is a curious one.
I’d be tempted to try the line next time it fails, insomuch, have an analogue phone handy, and when you find calls can’t be made out of the PBX, unplug one (or both) of the lines from the Sangoma card, plug it into the phone, and see if you dial out and complete the call.

If it does, the problem exists in PBX/card.
If it doesn’t, then you might need to get the lines repatched on the patch panel.

Make sure it is an analogue phone - digital or SIP phones won’t work, in case you weren’t aware.

I know it’s not much, but it might help you identify where the problem actually exists.

Two things I might suggest then;

  1. Double check the molex power cable to the FXO card is fully inserted into the card.

  2. Look at the outbound route, scroll down to Trunk Sequence for Matched Routes, and you probably have Zap/g0 listed as 0 and Zap/g1 listed as 1.
    Try swapping them round, so g1 is the first line to be used, then g0.

The main culprits I’m looking at here are power leakage on the line or potentially a faulty port on the card.

Wait one… I’ve just re read your original post.
You mention you have to reboot the wanrouter in order to get the calls working again.
Are you running the lines from a Cisco router, or a router with a PSTN module in it ?
Or are these lines coming from the MDF to the patch panel on your floor ?

There are no routers inbetween. Both lines go straight from the 66 block in the basement into the Sangoma FXO card, and from there all of the Polycom phones attach to the office switch

Can you clarify what you mean? Are you asking if when the lines give the ‘i’m sorry, all circuits are busy now’ error if i can make phone calls in from an external phone number?

Also, there are no other external devices on this phone system. the POTS lines go straight to the FXO card (internal PCI). I had a cron script running for a while to try and remedy this but it actually seemed to cause more problems as time went on. This script was set to run every morning at 7am before they got in the office.

I dont believe the phone lines are setup in a cascading lines. Can you tell me what configs I would need to get you in order to determine this?

/etc/init.d/asterisk stop;
sleep 30
/etc/init.d/wanrouter stop;
sleep 30
/etc/init.d/wanrouter start;
sleep 60
/etc/init.d/asterisk start;
sleep 20
/etc/init.d/ntpd start;

Ahh, sorry, I should have clarified. Remove any external hardware, such as any caller id units, cordless phones,etc that are not part of the PBX off the POTS line, and see if you still have issues.

Cascading lines are unlikely to be an advantage for you at this point, but I needed to verify how they were setup. It’s really for fax server setups and the like.

One thing you didn’t mention, when the lines go idle, are you able to place calls into the PBX via the PSTN (POTS)lines ?

And is this an internal Sangoma card, or a USB version ?

Thanks for your response magpye. You’ll have to excuse me because i’m pretty new to all asterisk/pbx in general (i’m a cisco guy primarily.) Are you referring to external caller id’s etc? or are you referring to the software based caller-ID within asterisk/freepbx?

Currently the POTS lines are configured as two independent lines as far as I know. Would a stepdown/cascade have an advantage? Thanks


Sounds like you might have more devices on your POTS line than the current supports. Extra devices like Caller ID units, etc can have a vampiric effect on the line. Remove anything extra and see if it continues.

Alternatively, you could swap the lines around - if your primary POTS line is not getting enough current, it might be enough to not carry a call without alerting FreePBX to the fact it’s inoperable.

Do you have the lines configured in a stepdown/cascade manner, or are they treated as two independent lines ?