chan_dahdi dahdi_write: Cannot handle frames in g729 format

I have the following scenario:

phoneA               sipphoneA
     +                       +
     |                       | 
   oldpbxA -- <E1PRI> -- asteriskA --- <iax2> --- asteriskB -- <E1PRI> -- oldpbxB
                                                        +                      +
                                                        |                      |
                                                sipphoneB                      phoneB

The iax asterisk trunk is configured with g729 codec and the sipphones with GSM. If I make a call from sipphoneA to phoneB everything works fine. Calls from phoneA to sipphoneB also work ok. But if I make a call from phoneA to phoneB I get the folowing error message:

[Jun  3 10:43:42] WARNING[3293]: chan_dahdi.c:9062 dahdi_write: Cannot handle frames in g729 format
[Jun  3 10:43:42] WARNING[3293]: app_dial.c:1412 wait_for_answer: Unable to forward voice or dtmf

And the call is disconnected.

I tried changing the codec of the iax trunk but the only one that worked was ulaw, certainly because no translation is necessary.

I’m using asterisk 1.8.4.2 and dahdi 2.4.1.2. On both sides I’m using Digium E1 cards.

Does anyone has any idea how to fix that, or where the problem may be?