I see you also posted this on the Asterisk forum, where there has been an ongoing thread on the subject: https://community.asterisk.org/t/microsoft-teams-integration-possible/78663
You can set Opensips as a proxy, or you can modify Asterisk as described in that thread. If you’re doing anything production-level and want Microsoft’s support, stop your current effort and buy a Microsoft certified SBC appliance.
To do this with opensips, run it on a different set of ports so that it does not sit in front of Asterisk for everything, but only for your Teams traffic. You’ll have to edit opensips’ routing script too to basically proxy traffic received from Asterisk to MS, and traffic from MS to Asterisk, and throw away anything else it happens to get. (You can do all this easily from the routing script without involving any database or even the dialog module)
btw, I did exactly this, had the Teams interop working with opensips, and then abandoned it for a better solution.
Maybe the Asterisk project would accept a patch to handle the few peculiarities of the Microsoft interop requirements so that you could connect directly without custom code work or the extra SIP proxy.