You can avoid this problem by using pjsip.
“Insecure=port,invite” comes from cookbook examples but the “insecure=port” is most often unnecessary, while “insecure=invite” + “secret” has been replaced by “remotesecret=”.
So instead of using “secret=” and “insecure=port,invite”, just use “remotesecret=”
What “remotesecret” does is that it will be used when you are challenged on outgoing calls for authenticating via a 401 unauthorized message, but you won’t challenge incoming Invites.
With “secret” you also challenge incoming invites, which you turn off by insecure=invite.
So if you set “insecure=invite” and “secret”, then it’s the same as “remotesecret” only.