[Freeswitch-users] Codec enforcment from dialplan?

Steven Ayre steveayre at gmail.com
Fri Jun 3 23:09:07 MSD 2011


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.

-Steve



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
> dialplan.
>
> 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">
>
>   <gateways>
>
>     <X-PRE-PROCESS cmd="include" data="providers/*.xml"/>
>
>   </gateways>
>
>
>
>   <settings>
>
>     <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"/>
>
>
>
>   </settings>
>
> </profile>
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110603/9c3b16f8/attachment-0001.html 


More information about the FreeSWITCH-users mailing list