[Freeswitch-users] Codec enforcment from dialplan?

Dmitry Saratsky freeswitch at simpot.com
Fri Jun 3 23:41:45 MSD 2011

Hi Steven,


Thanks for your input, in that case you are right - I need to do

I have already tried to work with late-negotiation, but I was failed
probably because I still not understand enough about configuring this in
right way.

As far as I do understand, I should:

1.       Configure (<param name="inbound-late-negotiation" value="true"/>)
on my external profile. This is clear for me.

2.       Is there any limitation for ("inbound-codec-negotiation" value) in
that case?

3.       Configure (<action application="set" data="inherit_codec=true"/>)
in dialplan. This is not clear. Where in dialpan? On A leg (before
"transfer" DID) or on B leg (in general part before "bridge")? 

4.       Is this enough, or I should use also additional settings in
dialplan (Maybe: <action application="export"
data="codec_string=${ep_codec_string}"/>)? Where?






From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Steven
Sent: 03 Jun 2011 22:09
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Codec enforcment from dialplan?


The default behaviour is to select the codec for an incoming call *before*
it hits the dialplan.

To work around that you should enable late-negotiation on the sofia profile
taking the incoming call. That'll delay selecting a codec until media starts
for a bridge. The codec will then match the bleg if possible, and otherwise
will pick the preferred codec from your lists. The alternative would be to
have multiple profiles with different codec preferences on each.


On 3 June 2011 18:49, Dmitry Saratsky <freeswitch at simpot.com> wrote:

Hi All,


I have some codec-prefs in my FS configured globally for all profiles (In my
case: "global_codec_prefs=G729,PCMU,PCMA,GSM"/>)

In addition, I need to provide for some specific incoming channels other
codec order (PCMU,PCMA) that destined to FS itself. I can identify those
channels by destination number of incoming call (fax service) in my

I can enforce needed codec from dialplan successfully for my outgoing
channels by using (absolute_codec_string='PCMU,PCMA'), but I'm failing to do
the same for incoming channels.

So now I'm enforcing all incoming calls from my provider to different from
global order (<param name="inbound-codec-prefs" value="PCMU,PCMA"/>),
instead of doing this for fax calls only.


Any ideas?



Relevant part of profile config:


<profile name="providers">


    <X-PRE-PROCESS cmd="include" data="providers/*.xml"/>




    <param name="debug" value="0"/>

    <param name="shutdown-on-fail" value="true"/>

    <param name="auth-calls" value="false"/>

    <param name="sip-trace" value="no"/>

    <param name="disable-register" value="true"/>

    <param name="rfc2833-pt" value="101"/>

    <param name="dialplan" value="XML"/>

    <param name="context" value="providers"/>

    <param name="apply-inbound-acl" value="013SONUS-IPS"/>

    <param name="hold-music" value="$${hold_music}"/>

    <param name="stun-enabled" value="false"/>

    <param name="stun-auto-disable" value="true"/>

    <param name="manage-presence" value="false"/>

    <param name="nonce-ttl" value="60"/>

    <param name="dtmf-type" value="rfc2833"/>

    <param name="dtmf-duration" value="2000"/>


    <param name="rtp-timer-name" value="soft"/>

    <param name="rtp-timeout-sec" value="50"/>

    <param name="rtp-hold-timeout-sec" value="300"/>


    <param name="sip-port" value="$${sip_port}"/>


    <param name="rtp-ip" value="$${rtp_ip}"/>

    <param name="sip-ip" value="$${ext_ip}"/>


<!--    <param name="codec-prefs" value="$${global_codec_prefs}"/>-->

    <param name="inbound-codec-prefs" value="PCMU,PCMA,G729"/>

    <param name="outbound-codec-prefs" value="$${global_codec_prefs}"/>

    <param name="inbound-late-negotiation" value="false"/>

    <param name="inbound-codec-negotiation" value="greedy"/>

    <param name="disable-transcoding" value="false"/>





FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110603/3ded8fdf/attachment-0001.html 

More information about the FreeSWITCH-users mailing list