Hi mate,
Sorry for the delay — sometimes work gets in the way 
But I managed to fix it!
For anyone trying to solve this issue, the solution is actually very easy, but also a bit tricky to discover. I figured it out using Wireshark and after accidentally creating a new extension in FreePBX.
Scenario
Your setup looks like this:
Home Assistant ⇄ FreePBX ⇄ IP Phones (Polycom or other SIP phones)
The Problem
If you configure FreePBX from the beginning to allow only the OPUS codec, you will run into a problem.
This was confusing because Home Assistant communicates with FreePBX using OPUS, but IP phones often cannot properly handle the audio stream in this situation, even if OPUS is configured as the first codec on the phone. ( you need to select! also uLaw (G.711 µ-law) als first codec or second)
The result is:
- No uplink audio
- No downlink audio
In short: HA hears you, but you dont hear him.
The Solution
You must enable another codec in FreePBX, specifically:
uLaw (G.711 µ-law)
It should be configured as either the first or second allowed codec.
What Happens After the Fix
Once uLaw is enabled, the call flow works correctly:
- Home Assistant → FreePBX using OPUS
- FreePBX transcodes OPUS → uLaw
- FreePBX → IP Phone using uLaw
After that, everything works perfectly:
- Audio uplink works
- Audio downlink works
- No more sound issues
Bonus Tip (Polycom Phones + Home Assistant)
By the way, since Polycom phones have an integrated micro web server, I created a small HTML file and connected Home Assistant to the phone using the HA API.
Now, when I open the web server on the phone (basically like opening a webpage in a browser, but directly on the phone), I can see a Home Assistant dashboard.
The dashboard:
- Updates automatically every 10 seconds
- Shows live Home Assistant entities
- Displays MJPEG streams
So the phone basically acts like a small Home Assistant monitoring panel