SIP Trunks are de-registering up to 4 times a day!

Hello,

I have freepbx 2.5.1.2 with Asterisk 1.2.26.1 on a CentOS 5.2 base and a ZyXEL P-660H-D1 router in bridge mode, no NAT and disabled firewall. O-Bit telecom ISP and VoIP-Unlimited SIP Trunks.

I am having trouble with my three SIP Trunks de-registering periodically. They are set up as follows:

Trunk 1:
This is the main trunk which has no dial prefix.

PEER DETAILS
username=USERNAME
type=peer
secret=PASSWORD
qualify=yes
nat=no
insecure=very
host=sip.voip-unlimited.net
fromuser=USERNAME
fromdomain=sip.voip-unlimited.net
dtmf=info
disallow=allow
context=from-trunk
canreinvite=yes
allow=alaw&ulaw

USER DETAILS
type=friend
secret=PASSWORD
nat=no
insecure=very
context=from-trunk

REGISTER
USERNAME:[email protected]/USERNAME

Trunk 2 is a seperate trunk from the same provider and is set up with the same variables apart from the USERNAME and PASSWORD. This secondary trunk uses 9 as a prefix which is removed in the dial patterns by using “9|.”

Trunk 3 is an Australian DID purely for incoming calls and is not used for outgoing.

When the trunks de-register all I have to do is reboot the router and they come up fine for however long they wish! I have replaced the router 3 times in 3 weeks and have the same problems. I also swapped out the system for a fresh install which did not solve the issue. Basically I have replaced every peice of equipment down to the patch leads in order to find the culprit but to no avail. The ISP says that it is not a broadband issue (a standard response) and wireshark dumps have been taken during failure by the SIP provider (awaiting response).

Does this sound like a FreePBX issue to anyone as I have gone full circle many times and cannot figure it out.

Any ideas would be greatly appreciated along with some dye for the grey hairs that I have begun to produce.

Thank you for your time.

Why they are de-registering is hard to say but is ‘usually’ an issue with the provider. By default, Asterisk will only try to register 10 times before giving up which will result in the trunk remaining de-registered.

You can have it continue in-definitely with:

registerattempts=0

add this to sip_general_custom.conf, this may help it come back up. It’s a band-aid to the problem, you should try to resolve the root cause of why it keep de-registering. One thing you can do is obtain service from a second provider that requires registration (or find a colleague with another FreePBX system that you can register to for free). If your provider continues to de-register but the other connection remains up, that will be another big hint as to where the problem may be.

Thank you Philippe.

Would I put that in the trunk peer details or does it need to go in one of the additional.conf files?

I have registered a further SIP trunk with a seperate provider which registered straight away. I waited and waited until the trunks dropped again and they all went down at the same time.

I am actually beginning to think that it is the system somehow. I would like to try the register attempts=0 but my SIP provider may ban me for flooding their network.

Any ideas?

Thanks in advance

sorry, sip_general_custom.conf, forgot to put that in the post (now edited).

If the registration is not successful, it is probably never making it to your provider. The registrations will only occur as long as it is not registered and in any event, the system re-registers regularly anyhow. There is another parameter that you can look up (I don’t recall off the top of my head) that can set how long to wait before sending each new attempt until it registers.

If you found with another provider that both de-registered, it sounds like an issue with your internet service somewhere. You may want to run a ‘ping’ to the provider’s IP address (or to somewhere else like google.com) continuously and see if the network is going down at the time it de-registers.

The other thing you could try to do, although a bit of a shot in the dark, is to put a ‘qualify=yes’ in the trunk configuration which will send an ‘OPTIONS’ message (a sort of “SIP” ping) regularly to the server. There is a chance that the regular nature of the probing might help keep things up. (However, I would want to find the root cause of why the network continue to go down like you describe - whether your ISP or your equipment).

I did have qualify=yes in there as I had read in SIP Trunk setup posts that this could help to maintain the connection.

I have now put in a fresh install of FreePBX 2.5.1.2 on CentOS 5.3 with Asterisk 1.4.24.1 and the system has been up since 7th May. I have no idea what caused these issues but I have saved the hard drive and will add to the post if I find the cause.

Once again thank you for your assistance.