I was able to get a good answer regarding it on Spiceworks: https://community.spiceworks.com/topic/2288618-on-site-pbx-integration-with-microsoft-teams
Basically you would need to get a SBC and a whole lot of configuration etc. and that it seems to be pretty pricey.