Asterisk 401 Error

Hello.

Help me please. I was tormented, I can’t solve the problem. There is an Astersik version 16.4. A trunk with a provider has been created. The trunk is working fine. Everything is good, there are incoming, there are outgoing. But if do not call for a while, an error appears. 401 - "[Aug 10 00:27:08] WARNING [8160]: res_pjsip_outbound_registration.c: 1000 handle_registration_response: ‘401’ fatal response received from ‘sip: sirena1.reconn.ru’ on registration attempt to 'sip: 749541xxxxx @ sirena1 .reconn.ru ‘, retrying in’ 30 'second ". It is necessary to restart the asterisk. After a reboot, if there are calls, again, everything is clear, everything is fine. But after the office closes, there are no calls at night, on morning again the problem repeats. At the command prompt, the output of the command “pjsip show registrations” shows “registered”. If try to disconnect “pjsip send unregister 749541xxxxx”, then the same error “401” pops up, if you try to connect to the command “pjsip send register 749541xxxxx”, again an error, and can’t connect in any way. 401 - Rejected. Calls do not go. Only reboot helps. After the reboot, everything is clear. I downloaded Astersik 16.5, everything is the same. On the provider side, he says that everything is fine and the problem is not from him … I think if there was a problem from him, then after the restart, everything would not work well either.

Thank you.

There is configuration of psjsip.conf

===

[global]
user_agent=Phone
domain=mydomain.com
allow_reload=yes

;=

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5555
external_media_address=188.xxx.226.xx
external_signaling_address=188.xxx.226.xx

;=

endpoint_reconn
type=endpoint
transport=transport-udp
context=reconn-in
dtmf_mode=rfc4733
media_encryption=no
aggregate_mwi=yes
use_avpf=no
disable_direct_media_on_nat=yes
rtcp_mux=no
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
direct_media=no
language=ru
disallow=all
allow=alaw
allow=ilbc
allow=g729
allow=gsm
allow=ulaw
allow=speex32
allow=speex16
allow=g722

[749541xxxxx]
type=registration
transport=transport-udp
outbound_auth=749541xxxxx
retry_interval=30
server_uri=sip:sirena1.reconn.ru
client_uri=sip:749541xxxxx@sirena1.reconn.ru
expiration=120
contact_user=749541xxxxx
forbidden_retry_interval=30
fatal_retry_interval=30

749541xxxxx
outbound_auth=749541xxxxx
aors=749541xxxxx
from_domain=sirena1.reconn.ru

[749541xxxxx]
type=identify
endpoint=749541xxxxx
match=sirena1.reconn.ru

[749541xxxxx]
type=aor
contact=sip:749541xxxxx@sirena1.reconn.ru:5060
max_contacts=3

[749541xxxxx]
type=auth
auth_type=userpass
username=749541xxxxx
password=:mypassword:

And even such a moment.If make command: “pjsip send unregistered 74954xxxxxx” - get error: "[Aug 10 00:27:08] WARNING [8160]: res_pjsip_outbound_registration.c: 1000 handle_registration_response: ‘401’ fatal response received from ‘sip: sirena1.reconn.ru’ on registration attempt to 'sip: 749541xxxxx @ sirena1 .reconn.ru ‘, retrying in’ 30 'second "

But if run command: “pjsip send register * all” - successfully connected.

I think, if manually it turns out to be connected with the “pjsip send register 74954xxxxxx” command, then it will be able to re-register itself after 30 seconds.