Can a specific CoDec be forced through a dialplan context?

Is there a way to force using a specigic CoDec through a dialplan context? For instance, my ATA is configured with a G729 CoDec and it works just fine. However, some VoSPs only support G711 CoDec. So, I would like to include in a dialplan contaxt for those particular VoSPs to use a G711 CoDec. Can this be done?