Phone calls immediately hang up - unless headphones are connected
As a (former) iPhone 7 user with a similar problem, I presume you are also unable to record voice memos or audio in your videos. If so, I am afraid it is a common problem having to do with the sound card of your iPhone 7: https://www.consumeraffairs.com/news/apple-iphone-7-owners-report-sound-issue-011519.html Apple has previously offered cheap(er) repairs for this issue, but I am unaware if this is still the case. Be sure to contact your local Apple dealer to see if this is the case.
Otherwise, there are second-party shops which should be able to perform this repair. Your iPhone is most likely already out of warranty so there should not be significant issues with future repairs. However, Apple has previously said they will not repair items repaired outside of official Apple shops, so it might be wise to do some further research and decide if you are willing to take the risk.