Hi list,
I have an issue with the negociation codec in my Freeswitch.

I followed this doc: https://wiki.freeswitch.org/wiki/Codec_Negotiation

The call flow:

1) INVITE: UAC -- (G729, PCMA) --> FS -- (G729, PCMA) --> SVI Asterisk
2) 200OK UAC <-- (G729) -- FS <-- (PCMA) -- SVI Asterisk (HOMER)

I have inherit_codec=true in my dialplan and inbound-late-negotiation true in sip-profile.
But freeswitch do not force codec learned from leg B to leg A.

LEG B (200OK):
2016-04-01 11:28:16.453784 [DEBUG] switch_core_media.c:3194 Audio Codec Compare [PCMA:8:8000:150:64000]/[G729:18:8000:20:8000]
2016-04-01 11:28:16.453784 [DEBUG] switch_core_media.c:3194 Audio Codec Compare [PCMA:8:8000:150:64000]/[PCMA:8:8000:20:64000]
2016-04-01 11:28:16.453784 [DEBUG] switch_core_media.c:3248 Audio Codec Compare [PCMA:8:8000:20:64000] ++++ is saved as a match
2016-04-01 11:28:16.453784 [DEBUG] switch_core_codec.c:111 sofia/internal/06********@HOMER Original read codec set to PCMA:8


LEG B is in G711A, OK, next:

2016-04-01 11:28:16.453784 [NOTICE] sofia.c:6727 Channel [sofia/internal/06*******@HOMER] has been answered
2016-04-01 11:28:16.453784 [DEBUG] switch_channel.c:3686 (sofia/internal/06*********@HOMER) Callstate Change DOWN -> ACTIVE
2016-04-01 11:28:16.473813 [DEBUG] switch_ivr_originate.c:412 Setting codec string on sofia/external/0326793005@1.1.1.1 to PCMA@8000h@20i

We can see, FS set the correct codec to LEG A; good ! , next...

2016-04-01 11:28:16.473813 [DEBUG] switch_core_media.c:3194 Audio Codec Compare [G729:18:8000:20:8000]/[G729:18:8000:20:8000]
2016-04-01 11:28:16.473813 [DEBUG] switch_core_media.c:3248 Audio Codec Compare [G729:18:8000:20:8000] ++++ is saved as a match
2016-04-01 11:28:16.473813 [DEBUG] switch_core_media.c:3194 Audio Codec Compare [PCMA:8:8000:20:64000]/[PCMA:8:8000:20:64000]
2016-04-01 11:28:16.473813 [DEBUG] switch_core_media.c:3248 Audio Codec Compare [PCMA:8:8000:20:64000] ++++ is saved as a match
2016-04-01 11:28:16.473813 [DEBUG] switch_core_media.c:2139 Set Codec sofia/external/0326793005@1.1.1.1 G729/8000 20 ms 160 samples 8000 bits

Why FS compare and re set a new codec (G729) ?

Next:

2016-04-01 11:28:16.613776 [ERR] mod_g729.c:145 This codec is only usable in passthrough mode!
2016-04-01 11:28:16.613776 [ERR] switch_core_io.c:1245 Codec G.729 decoder error!


normal ....

For informations:
- FreeSWITCH Version 1.5.8b+git~20140214T000311Z~fe2a4d6d47~64bit (git fe2a4d6 2014-02-14 00:03:11Z 64bit)

Is it a bug ? an configuration error ?

Thanks in advance


PS:

My dialplan:
<condition field="${destination_number}" expression="^0([1-79][0-9]{8})$" break="on-true">
<action application="export" data="codec_string=${ep_codec_string}"/>
<action application="set" data="inherit_codec=true"/>
<action application="bridge" data="sofia/internal/${destination_number}@HOMER"/>
</condition>




--
Cordialement

HUBERT Mickaël
Ingénieur VOIP - Hexanet