maybe the comments on this issue will help: https://github.com/signalwire/freeswitch/issues/1340 .

On Wed, Oct 27, 2021 at 8:13 PM Rahman Duran <rahman.duran@erzurum.edu.tr> wrote:
Hi,

I am struggling tuning Freeswitch for late codec negotiation. Here is local profile settings:

<param name="inbound-late-negotiation" value="true"/>
<param name="inbound-codec-prefs" value="G722,PCMA"/>
<param name="outbound-codec-prefs" value="G722,PCMA"/>
<param name="inbound-codec-negotiation" value="greedy"/>

As you see I enabled late-negotiation and set codecs prefs to allow G722 and PCMA. My goal is to use G722 if both sides support it and fall back to PCMA if G722 is not an option for A leg or B leg.

Here is the local dial plan config where I bridge calls:

    <extension name="local_accounts_freeswitch">
      <condition regex="all">
        <regex field="destination_number" expression="^[0-9]{4}$"/>
        <regex field="${local_user_exists}" expression="^true$|^TRUE$|^True$"/>
        <regex field="${santral_kontrol}" expression="^freeswitch$"/>
        <action application="set" inline="true" data="call_pickup_group=${user_data(${destination_number}@${domain_name} var call_pickup_group)}"/>
        <action application="hash" data="insert/${domain_name}-last_dial/${caller_id_number}/${destination_number}"/>
        <action application="hash" data="insert/${domain_name}-group_pickup_last_uuid/${call_pickup_group}/${uuid}"/>
        <action application="hash" data="insert/${domain_name}-pickup_last_uuid/${destination_number}/${uuid}"/>
        <action application="log" data="ep_codec_string -- ${ep_codec_string}" />
        <action application="set" data="inherit_codec=true"/>
        <action application="export" data="nolocal:absolute_codec_string='${ep_codec_string}'"/>
        <action application="set_profile_var" data="callee_id_name=${user_data(${destination_number}@${domain_name} var effective_caller_id_name)}"/>
        <action application="set" data="hangup_after_bridge=true"/>
        <action application="set" data="continue_on_fail=true"/>
        <action application="set" data="call_timeout=30"/>
        <action application="set" data="execute_on_answer=sched_hangup +21600 alloted_timeout" />
        <action application="bridge" data="{origination_callee_id_name=${user_data(${destination_number}@${domain_name} var effective_caller_id_name)}}user/${destination_number}@${domain_name}"/>
        <action application="execute_extension" data="hata-${originate_disposition} XML hata_anonslari"/>
      </condition>
    </extension>

So I export absolute_codec_string to B leg using ep_codec_string. When I test a call from 2730->2110, the call fails with "incompetible_destination".  Call logs here: https://pastebin.freeswitch.org/view/b2978e79 The 2730 is a Cisco phone with "G722,PCMU,PCMA,G729,L16,iLBC" codec support. The 2110 is a Samsung phone that only supports "PCMA,PCMU,G729" codecs. As you see cisco invites with all codecs it supports and freeswitch sets absolute_codec_string with "G722,PCMA" as expected from the config. But as you see in the call logs Freeswitch only sends "G722" in SDP to Samsung phone so Samsung rejects the call.

Why does Freeswitch only send G722? How can I fix this? What am I doing wrong?

P.S. using debian packages: FreeSWITCH Version 1.10.6-release-18-1ff9d0a60e~64bit (-release-18-1ff9d0a60e 64bit)

Regards,

Rahman Duran
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com