Register doesn't work properly in Asterisk Realtime - not ringing calls

I have an Asterisk server 13.18.5 installed in an Ubuntu 16.04 LTS in an Amazon cloud behind the NAT that was working properly, until I try to enable the Asterisk Realtime to use Mysql database.

I made a lot of tests, in many situations work properly, but sometimes I lost the register of the client and the calls are not delivered, and in the server return it:

[2018-02-09 09:32:23] WARNING[6142]: chan_sip.c:4072 retrans_pkt: Retransmission timeout reached on transmission 5aa7afc34fa9290b5b4967a966462a91@ for seqno 102 (Critical Request) -- See

I already use rtpcachefriends=yes and rtsavesysname=yes. When I didn’t use RealTime I solved it with register=>4701006:password@ now when I use this command the calls was not delivered and say that the phone is in loop detected:

 -- Got SIP response 482 Loop Detected back from IP_OF_MY_SERVER
 -- SIP/BuyDIDHub-0000069e is circuit-busy
 == Everyone is busy/congested at this time (1:0/1/0)

And then the call down.

Anyone can help me?

I was using the parameter rtcachefriends wrong, wrote rtpcachefriends when the correct is rtcachefriends.