Phone becomes unreachable randomly

Hi everyone, I have a new FreePBX instance hosted in AWS. The phone will randomly become unreachable. If there is a pattern it seems to become unreachable right before the phone should ring. I have NAT set to Yes (force_rport,comedia) The local site has a Sonicwall Firewall, Constant NAT is enabled and SIP settings/Transformations are off. There is no firewall in AWS to configure. From the logs it looks like a NAT issue but I cannot seem track it odwn.

[2017-01-09 16:35:53] NOTICE[2004] chan_sip.c: Peer ‘5011’ is now Reachable. (46ms / 2000ms)
[2017-01-09 16:35:54] SECURITY[2036] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“2017-01-09T16:35:54.763-0500”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7fde2c1445c8”,LocalAddress=“IPV4/TCP/0.0.0.0/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/34823”,UsingPassword=“0”,SessionTV=“2017-01-09T16:35:54.763-0500”
[2017-01-09 16:35:54] SECURITY[2036] res_security_log.c: SecurityEvent=“RequestBadFormat”,EventTV=“2017-01-09T16:35:54.961-0500”,Severity=“Error”,Service=“AMI”,EventVersion=“1”,SessionID=“0x7fde2c1445c8”,LocalAddress=“IPV4/TCP/0.0.0.0/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/34823”,RequestType=“Action: DPMALicenseStatus”,SessionTV=“2017-01-09T16:35:54.763-0500”,AccountID=“admin”
[2017-01-09 16:35:56] NOTICE[2004] chan_sip.c: Peer ‘5012’ is now Reachable. (51ms / 2000ms)
[2017-01-09 16:35:58] NOTICE[2004] chan_sip.c: Peer ‘5010’ is now Reachable. (48ms / 2000ms)
[2017-01-09 16:36:01] SECURITY[2036] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“2017-01-09T16:36:01.881-0500”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7fde2c684048”,LocalAddress=“IPV4/TCP/0.0.0.0/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/34824”,UsingPassword=“0”,SessionTV=“2017-01-09T16:36:01.881-0500”
[2017-01-09 16:36:01] SECURITY[2036] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“2017-01-09T16:36:01.890-0500”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7fde2c495f38”,LocalAddress=“IPV4/TCP/0.0.0.0/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/34825”,UsingPassword=“0”,SessionTV=“2017-01-09T16:36:01.890-0500”
[2017-01-09 16:36:01] SECURITY[2036] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“2017-01-09T16:36:01.909-0500”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7fde2c0d3598”,LocalAddress=“IPV4/TCP/0.0.0.0/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/34826”,UsingPassword=“0”,SessionTV=“2017-01-09T16:36:01.909-0500”
[2017-01-09 16:36:46] NOTICE[2004] chan_sip.c: Peer ‘4432’ is now Reachable. (44ms / 2000ms)
[2017-01-09 16:36:57] NOTICE[2004] chan_sip.c: Peer ‘5011’ is now UNREACHABLE! Last qualify: 46
[2017-01-09 16:37:00] NOTICE[2004] chan_sip.c: Peer ‘5012’ is now UNREACHABLE! Last qualify: 51

look at the udp session times on the SonicWALL. increase the udp session timeout and your problem will probably go away

I think this did the trick. I had increased the time out from 30seconds to 45 seconds and didn’t seem to help. But I increased it again to 75 seconds (15 seconds more than the qualify frequency) and seems to be stable. I’m not sure if 75 seconds was a coincidence or if it is connected to the qualify frequency. Either way thank you for the help.

you want to set it to be at least as high as the qual time. i usually set it to 180 seconds. the issue is that the router closes the port when the timer expires if there is no traffic on the port.

It is recommended to change SIP Media inactivity time out (seconds): to 120 as per http://wiki.freepbx.org/display/PPS/Router+Configuration however I turn OFF the option to “Enable consistent NAT” and “Enable SIP Transformations” under VOIP > Settings in Sonicwalls