The theory is that Sangoma is better at this. But mostly it's for AMD, and I'm not sure if you can turn off the AMD (which can be problematic as it causes a 2 second delay ...). However, if you're using AMD then sangoma could be helpful.
Set up a virtual sangoma server with a test line and see if it helps or hinders.
Also, your carrier is not likely to be altering the disconnect codes at all. It's the carriers of those you're calling. If your carrier is altering the codes in any way, you need to change carriers. Which brings up the next question inevitably: Please tell me you have three carriers at least? (Most do not charge a monthly fee, so any funds on the account will carry over forever ... excellent for testing!)