After a rather long thread on the Freeswitch mailing lists I managed to get G729 passthru working on Freeswitch (svn 17048).
mod_g729 should be enabled in modules.conf.xml.
In vars.xml G729 should be added to the codec prefs, or should be the only one if you are sure the provider(s) support G729.
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=G729,PCMU,PCMA,GSM,[email protected],[email protected],G722"/> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=G729,PCMU,PCMA,GSM"/>
In the Linksys SPA, on the SIP page, the setting labelled 'G729a Codec Name:' should be changed to 'G729'. Freeswitch does not recognize the 'G729a' passed by the Sipura. To be certain only G729 will used, the Audio setting of the line 'Preferred Codec:' should be set to 'G729' and 'Use Pref Codec Only:' should be set to 'Yes'. That way calls will not go through unless G729 is working on both ends.
There are 2 parameters in internal.xml that enable allow pass thru or media bypass
<param name="inbound-proxy-media" value="true"/> and
<param name="inbound-bypass-media" value="true"/>.
In my setting inbound-proxy-media was the one that worked, inbound-bypass-media resulted in dead air.
One point to note, during my testing I assumed that doing a reloadxml would allow any changed settings to work immediately. That it didn't work - it is necessary to stop Freeswitch and start it again to ensure that changes work properly.
These tests were made with the default settings in Freeswitch, setting the provider as the default in vars.xml. The proxy-media and bypass-media are supposed to be used in the dialplan and the sip profiles respectively, where they will not be applied globally, but I am yet to test that.