Just general advice. I would suggest to try having the same codec across all devices that your trunk provider uses for uniformity and to remove the need for transcoding. So if the provider uses G.711 A-law (PCMA) for example, reprovision all the phones to have PCMA on top priority. Then go to the management console, and then Settings > General. Change the Local and External codec priority to PCMA too. Provided that all your phones as well as your trunks support this codec, no transcoding will take place hence removing one variable from the whole pipeline. Ensure also that the PBX machine has enough CPU/RAM/Storage resources and monitor it for a while if needed from the dashboard to be satisfied it's not reaching its limits. Ensure the remote sites SBCs are not affected by the internet access at the offices being fully utilized at times or that their local firewalls are not overwhelmed with traffic and causing network delays. Captures on the PBX should reveal if the network is slow anyway, you will see high latency I would expect, or lost packets
Capture can also be set up remotely without travelling to the locations, if you have access to the site over internet. You can SSH into Debian remotely or if you have remote desktop to one of their PCs on the same network use that PC to SSH into the Debian SBC.