Is it possible to force G729 for outbound calls to a peer?


I’ve got the following setup:

AGENTS using SIP softphone that has G711 ulaw codec.

I’ve got a SIP trunk that supports both G729 and G711 ulaw.

The outbound peer has been setup in sip.conf (static realtime)


Asterisk has G729 codec installed, and this is visible in “sip show translation”.

Yet, when we make a call - it only matches on the user and always sends the call out using G711 ulaw.

What I want to do is force the outbound calls to always transcode and using G729 to the SIP gateway.

As you can see from the outbound peer configuration, even setting only allow=g729 (no other codecs) does not work. It always matches on the user and as the only compatible codec between the SIP gateway and the user is G711, that is what is used.

I’ve set canreinvite=no both globally, and for the user, and the RTP is definately going through Asterisk.

Surely this would be a great feature that a lot of users would require - using a high bandwidth codec on the fast LAN (g711 ulaw) and the less bandwidth intensive G729 codec on the WAN link to the SIP gateway.

Does anyone know if it’s possible to do what I’ve just described? Am I missing something obvious?


hey man,
Everything is not free as it seems :cry:.
G729 requires a license .

Please read my post again, especially this line.

Asterisk has G729 codec installed, and this is visible in “sip show translation”.

I’ve resolved the issue, although it’s not matching on my peer when I make an outbound call (why? surely we should match on incoming AND outgoing calls - this would make more sense and would pickup our specific settings for each peer).

I’ve set sip.conf (static realtime) to


We are now making calls to our peer using g729, and also falling back to ulaw.