Local codec / Trunk Codec

I would like to configure my asterisk system to have calls from the softphones to the server to be ulaw and then have the connections to the voip trunk being in gsm. Is this possible? How would I configure this. I’ve been reading through Asterisk: The future of telephony and I’ve searched the forums and I couldn’t find anything.

look at the dissallow=all
and allow=whatever codecs you want

for each extension

[quote=“riddlebox”]look at the dissallow=all
and allow=whatever codecs you want

for each extension[/quote]

I actually tried that already.

ex.

[voip provider]
disallow=all
allow=gsm

[softphone]
disallow=all
allow=ulaw

The asterisk console showed the call being placed as a ulaw formatted call, which makes sense, but how can I tell if it was passed to the voip provider as a gsm call?
More importantly does this configuration that I’m trying to achieve make sense? I’m figuring it will help with latency. Is this right or am I going to introduce latency by transcoding?