Codec negotiation problem

Hello,

I have a codec negotiation problem as follows:
The sip peer i’m calling from my local sip phone only supports g723, while my local phone supports gsm, g723, alaw…
I also use pstn to dial out which only supports alaw. The codecs order in sip.conf is gsm alaw g723 and my sip phone has codecs ordered gsm alaw g723.
When i call sip peer from the local sip phone, asterisk first combines all available codecs with local phone and then dials the peer. The peer returns g723 as only available codec in the session progress message which is combined with asterisk. But when asterisk forwards the session progress to the local sip phone, it includes all codecs available from sip.conf, so local sip phone desides to go for gsm as it is the first codec of preference on both asterisk and the local sip phone. So the call cannot go through, because the peer only supports g723 which cannot be converted on asterisk.
My question is, why does asterisk offer other codecs to the local sip phone when the only codec available for connection is g723 and it has already been negotiated with the peer? Shouldn’t asterisk care at least so much, that it wouldn’t have to transcode?
The problem is the same if i set the first codec of preference to g723 in sip.conf. Then the sip peer negotiation works, but then negotiation for pstn runs to the same problem as local sip phone negotiates g723 and pstn can only go for alaw. No transcoding possible.
Can this be fixed somehow?

TIA, J.