Sometime i can't connect to asterisk for a while

I’ve a vps with Centos 6.3 where i installed Asterisk 11, sometimes happens that my spa122 and my smartphone with sipdroid are unable to connect to asterisk, and they says time out.

if i connect to asterisk console and type sip show peers i get this:

Name/username        Host                               Dyn Forcerport ACL Port     Status      Description

2000/2000            ****************                       D   A          A  1123     OK (47 ms)
2001/2001            ****************                       D   A          A  62066    OK (49 ms)
2100/2100            ****************                       D   A             7738     OK (106 ms)
...
other stuff, providers, ecc...
...

2000 and 2001 are connected with my ata adapter spa122
2100 with sipdroid

after about 5 minutes, console prints:

[Jan  7 07:56:19] NOTICE[6298]: chan_sip.c:14941 sip_reg_timeout:    -- Registration for '******@callcentric.com' timed out, trying again (Attempt #3)
    -- Registered SIP '2000' at *************:1123
    -- Registered SIP '2001' at **************:62066
[Jan  7 07:56:20] NOTICE[6298]: chan_sip.c:27449 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2100
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 7ff9c640-e51cae7@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 7ff9c640-e51cae7@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 7ff9c640-e51cae7@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 7ff9c640-e51cae7@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 7ff9c640-e51cae7@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Jan  7 07:56:25] WARNING[6298]: chan_sip.c:4164 retrans_pkt: Retransmission timeout reached on transmission 3036923-162c537d@192.168.0.50 for seqno 101 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response

and all back to work properly (192.168.0.50 is spa122 address)

in my sip.conf:

[general]	
	directmedia=no
	nat=comedia
	localnet=127.0.0.1/255.0.0.0
	localnet=10.0.2.87/255.255.240.0
	bindaddr=***********(public ip)
	srvlookup=yes
	realm=voip.eutelia.it

...
other stuff, registry, accounts ecc...
...

[2000]             ; spa122
	type=friend
	host=dynamic
	secret=*************
	context=casa
	qualify=yes
	deny=0.0.0.0/0
	permit=myhomeip/255.255.255.0


[2100]		; sipdroid
	type=friend
	host=dynamic
	secret=**********
	context=casa
	qualify=yes

Looks like a network problem, rather than an Asterisk one.

Maybe… but in the same vps i’ve a TeamSpeak 3 server running 24/7, and it works fine, also when asterisk doesn’t work.

Can any misconfigured device like spa122 cause this? What is the correct value for "Register expires"
I’m using 4 providers:

[code]register => :@sip.telbo.com/**
register => :@voip.eutelia.it/**
register => :@callcentric.com/**
register => :@sip.messagenet.it:5061/**
register => #:@sip.messagenet.it:5061/**#

[eutelia]
type=peer
context=chiamate-ingresso
username=***
fromuser=***
secret=***
host=voip.eutelia.it
fromdomain=voip.eutelia.it
qualify=yes
insecure=invite,port

[telbo]
type=peer
context=chiamate-uscita
username=***
fromuser=***
secret=***
host=sip.telbo.com
fromdomain=sip.telbo.com
qualify=yes
insecure=invite,port

[messagenet]
type=peer
username=***
fromuser=***
secret=***
host=sip.messagenet.it
port=5061
qualify=yes
insecure=invite,port

[messagenet-#]
type=peer
username=***#
fromuser=***#
secret=***
host=sip.messagenet.it
port=5061
qualify=yes
insecure=invite,port

[callcentric]
type=peer
fromdomain=callcentric.com
fromuser=***
host=callcentric.com
insecure=port,invite
secret=***
qualify=yes
defaultuser=***
disallowed_methods=UPDATE
[/code]

can a deprecated command cause this?

The fact that Asterisk is retransmitting to the correct address tends to suggest that Asterisk is OK. The actual retransmitted packet might give some clues.

The default registration timeout is 20. You will have to ask the ITSP about their preferred values. I can’t find any reference to “register expires” in the code.

“Register expires” is in SPA122 settings… i set it to 60 sec…
Maybe asterisk block me because i request 3 registrations every minute?

I removed callcentric from sip.conf and seems to work fine now…