This is not a general application recipe, you have to adapt each setting to the characteristics of your network. And please stay away from chan_sip, it will be difficult to get updated help if you use a protocol that is deprecated.
Maybe your Asterisk configuration have not changed and that is the problem, looks like there is a change on the Network or one of the carrier, an external change that you didn’t realize, because things don’t stop working just because they do. And now you need to adapt Asterisk to your new network environment or carrier change.
externip cannot be set here and it certainly shouldn’t be the same as host. I don’t understand why you have an in and an out for the trunk, when they seem to have the same host address, but inconsistent parameters.
You need to have a disallow=all before your allow’s. This breaks some 2022 versions of Asterisk and can create SIP requests which are too big to handle.
username doesn’t mean what you presumably think it means and isn’t useful here.