Listen I created this account just to say that I had the same problem on my iPhone 7 last year and finaly gave up and bought a new phone. Today about a year later I decided to try to repair it again and since the only solution that seemed to work for some people was to keep “soft reseting” the phone again and again until it worked. So I did that and after about 1 hour of doing that, NOW IT WORKS!!!
If you still have this problem just keep doing the soft reset and call someone after each reset, if the speaker icon is still greyed out, do it again until it works. It might take you a while tho, maybe hours but !&&* if you're short on money and can’t buy a new phone just do it. It’s worth it.