DEVICE_STATE does not work with a new webrtc extension

Hello. My greetings to all.
.When I create a new extension in the database, webrct records, makes and receives calls, but DEVICE_STATE does not reflect the status of the device unless I do module reload res_pjsip.so. After that, DEVICE_STATE works for the extension normally.

exten => _3700,1,NoCDR
same => n,Set(STATUSWEBRTC=${DEVICE_STATE(PJSIP/${EXTEN})})
same => n,NoOp(TEANS extension status is ${STATUSWEBRTC})
same => n,GotoIf($[“${STATUSWEBRTC}” = “UNAVAILABLE”]?unavailable)
same => n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},120,rTt)
same => n,Hangup()

if I remove the device state check the extension works perfectly.

Yes, I am using realtime. I only have this problem with the webrtc extensions. I am using Asterisk 20. Does the problem also occur in the new version of Asterisk 22? Will it be resolved if I update?

It’s how it works. The links I gave include an explanation I wrote previously.