Codecs for some internal calls

Hello everyone! This is my first post in this forum, so hope it goes ok! (excuse my english, please!)

I have a setup whith a PBX in central office, and some extensions are located in branch offices. I have VPN’s connecting this branch offices with central site, and have succesfully installed this extensions through the VPN. I’m having problems with quality of calls between one of the sites and some extensions in the central site. So I have two questions:

First is about debugging: How can I determine wich codec is being used in a particular call between extensions.
Second is about configuration: How can I force a codec for selected calls.

Thanks for any help in advance!!!