SIP client does not receive INVITE from FreePBX

Hi,
I’m running FreePBX 14.0.5.25 at AWS server and software sip clients(baresip).
From time to time when calling a sip client the caller receives “503 Service Unavailable” from FreePBX. After few seconds up to dozens of seconds, the target client becomes available again and I can call it.

I’ve checked traffic at the callee side with tcpdump and seen no INVITE messages from FreePBX.
After the client sends REGISTER again it becomes available for calls again.

It seems to be a timing or a NAT issue, any ideas?

FreePBX settings:
$ cat /etc/asterisk/sip_general_additional.conf 
accept_outofcall_message=yes
auth_message_requests=no
outofcall_message_context=dpma_message_context
faxdetect=no
vmexten=*97
useragent=FPBX-14.0.5.25(13.22.0)
websocket_enabled=false
language=en
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g726
allow=g722
allow=opus
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
limitonpeers=yes
tlscipher=ALL
rtpend=20000
context=from-sip-external
callerid=Unknown
rtpstart=10000
tcpenable=yes
callevents=yes
tlsprivatekey=/etc/asterisk/keys/default.key
tlscertfile=/etc/asterisk/keys/default.pem
bindport=5060
jbenable=no
checkmwi=10
maxexpiry=60
minexpiry=30
srvlookup=no
tlsenable=yes
allowguest=no
notifyhold=yes
rtptimeout=30
canreinvite=yes
tlsbindaddr=[::]:5061
rtpkeepalive=10
videosupport=no
defaultexpiry=60
notifyringing=yes
maxcallbitrate=384
rtpholdtimeout=300
g726nonstandard=no
registertimeout=20
tlsclientmethod=tlsv1
registerattempts=0
tlsdontverifyserver=yes
nat=force_rport,comedia
ALLOW_SIP_ANON=no
tlscafile=/etc/pki/tls/certs/ca-bundle.crt
externip=<our-ip-address>

Example of extensions:
$ cat /etc/asterisk/sip_additional.conf
[7541]
deny=0.0.0.0/0.0.0.0
dtmfmode=rfc2833
canreinvite=no
host=dynamic
trustrpid=yes
sendrpid=pai
type=friend
nat=force_rport,comedia
port=5060
qualify=yes
qualifyfreq=60
transport=udp,tcp,tls
avpf=no
force_avp=no
session-timers=accept
icesupport=no
encryption=no
namedcallgroup=
namedpickupgroup=
accountcode=
vmexten=
permit=0.0.0.0/0.0.0.0
defaultuser=
rtcp_mux=no
dial=SIP/7541
secret=<secret password>
context=from-internal
mailbox=7541@device
callerid=7541 <7541>
recordonfeature=apprecord
recordofffeature=apprecord
callcounter=yes
faxdetect=no
cc_monitor_policy=generic

FreePBX version: 14.0.5.25
SIP client: baresip 0.6.0 [https://github.com/alfredh/baresip]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.