Setting codec priotity on server side for sip clients

Dear people of Asterisk

I need to be able to support both g729 and g711 on my Asterisk based sip server. How do I force clients that support g729 to make use of it instead of their default behaviour of negotiating g711 first. I would like to do this on the server side so as not to have to set up 600 phones remotely.

Kindly

in your sip account :

disallow=all
allow=g729

youd better to use sip templates