I have around 20-30 softphones behind NAT  .. My sip.conf has nat=yes and they all are able to register and make calls with no problem . My voip carrier supports gsm as well as ilbc .. Server takes calls from sip phones , does call recording in between and forwards to voip carrier . My problem is that half of my softphones use ilbc and  rest use gsm and my provider supports both gsm as well as ilbc .  Now when i put allow=gsm&ilbc in my voip carrier's extension then it uses gsm ( first preference ) to send calls but half of my softphones use ilbc so asterisk does codec transcoding in between using lot of cpu ..  how ever my carrier does support ilbc tooo but when i put allow=ilbc&gsm then it uses ilbc again and does codec transcoding from gsm to ilbc for rest of softphones . How can i make asterisk to be smart in choosing codec .. and use ilbc to voip carrier if softphone is using ilbc or use gsm when softphone is using gsm ( but still should do call recording in between ) .. I am using freepbx for most of configuration btw... Any suggestions ? 
<br>