Whilst in theory using 2 codecs could work, although I’ve not tested myself. It would be better to run as much as possible on the same codec to avoid transcoding which, unless you have a transcoding card, will put pressure on the PBX for no reason. So all the phones, IAX trunks and external trunks just use a single codec.