You may have replied here before you saw my last email, but definitely go read the codec negotiation page on the wiki. There you will find out whether or not you need &quot;inherit_codec&quot; or something else. It all depends on exactly what you are trying to accomplish.<div>
<br></div><div>-MC<br><br><div class="gmail_quote">On Fri, Jun 3, 2011 at 12:41 PM, Dmitry Saratsky <span dir="ltr">&lt;<a href="mailto:freeswitch@simpot.com">freeswitch@simpot.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Hi Steven,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D">Thanks for your input, in that case you are right – I need to do late-negotiation.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">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…</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">As far as I do understand, I should:</span></p><p><span style="font-size:11.0pt;color:#1F497D"><span>1.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><span dir="LTR"></span><span style="font-size:11.0pt;color:#1F497D">Configure (</span>&lt;param name=&quot;inbound-late-negotiation&quot; value=&quot;true&quot;/&gt;<span style="font-size:11.0pt;color:#1F497D">) on my external profile. This is clear for me.</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"><span>2.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><span dir="LTR"></span><span style="font-size:11.0pt;color:#1F497D">Is there any limitation for (&quot;inbound-codec-negotiation&quot; value) in that case?</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"><span>3.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><span dir="LTR"></span><span style="font-size:11.0pt;color:#1F497D">Configure (</span>&lt;action application=&quot;set&quot; data=&quot;inherit_codec=true&quot;/&gt;<span style="font-size:11.0pt;color:#1F497D">) in dialplan. This is not clear… Where in dialpan? On A leg (before “transfer” DID) or on B leg (in general part before “bridge”)? </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"><span>4.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span></span><span dir="LTR"></span><span style="font-size:11.0pt;color:#1F497D">Is this enough, or I should use also additional settings in dialplan (Maybe: </span>&lt;action application=&quot;export&quot; data=&quot;codec_string=${ep_codec_string}&quot;/&gt;<span style="font-size:11.0pt;color:#1F497D">)? Where?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Thanks,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Dmitry.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Steven Ayre<br>
<b>Sent:</b> 03 Jun 2011 22:09<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] Codec enforcment from dialplan?</span></p></div><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom:12.0pt">
The default behaviour is to select the codec for an incoming call *before* it hits the dialplan.<br><br>To work around that you should enable late-negotiation on the sofia profile taking the incoming call. That&#39;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.<br>
<br>-Steve<br><br><br></p><div><div></div><div class="h5"><div><p class="MsoNormal">On 3 June 2011 18:49, Dmitry Saratsky &lt;<a href="mailto:freeswitch@simpot.com" target="_blank">freeswitch@simpot.com</a>&gt; wrote:</p>
<div><div><p class="MsoNormal">Hi All,</p><p class="MsoNormal"> </p><p class="MsoNormal">I have some codec-prefs in my FS configured globally for all profiles (In my case: &quot;global_codec_prefs=G729,PCMU,PCMA,GSM&quot;/&gt;)</p>
<p class="MsoNormal">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.</p>
<p class="MsoNormal">I can enforce needed codec from dialplan successfully for my outgoing channels by using (absolute_codec_string=&#39;PCMU,PCMA&#39;), but I’m failing to do the same for incoming channels…</p><p class="MsoNormal">
So now I’m enforcing all incoming calls from my provider to different from global order (&lt;param name=&quot;inbound-codec-prefs&quot; value=&quot;PCMU,PCMA&quot;/&gt;), instead of doing this for fax calls only…</p><p class="MsoNormal">
 </p><p class="MsoNormal">Any ideas?</p><div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm"><p class="MsoNormal"> </p></div><p class="MsoNormal"> </p><p class="MsoNormal">Relevant part of profile config:</p>
<p class="MsoNormal"> </p><p class="MsoNormal">&lt;profile name=&quot;providers&quot;&gt;</p><p class="MsoNormal">  &lt;gateways&gt;</p><p class="MsoNormal">    &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;providers/*.xml&quot;/&gt;</p>
<p class="MsoNormal">  &lt;/gateways&gt;</p><p class="MsoNormal"> </p><p class="MsoNormal">  &lt;settings&gt;</p><p class="MsoNormal">    &lt;param name=&quot;debug&quot; value=&quot;0&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;shutdown-on-fail&quot; value=&quot;true&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;auth-calls&quot; value=&quot;false&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;sip-trace&quot; value=&quot;no&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;disable-register&quot; value=&quot;true&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;rfc2833-pt&quot; value=&quot;101&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;dialplan&quot; value=&quot;XML&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;context&quot; value=&quot;providers&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;apply-inbound-acl&quot; value=&quot;013SONUS-IPS&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;hold-music&quot; value=&quot;$${hold_music}&quot;/&gt;</p><p class="MsoNormal">
    &lt;param name=&quot;stun-enabled&quot; value=&quot;false&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;stun-auto-disable&quot; value=&quot;true&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;manage-presence&quot; value=&quot;false&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;nonce-ttl&quot; value=&quot;60&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;dtmf-type&quot; value=&quot;rfc2833&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;dtmf-duration&quot; value=&quot;2000&quot;/&gt;</p>
<p class="MsoNormal"> </p><p class="MsoNormal">    &lt;param name=&quot;rtp-timer-name&quot; value=&quot;soft&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;rtp-timeout-sec&quot; value=&quot;50&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;rtp-hold-timeout-sec&quot; value=&quot;300&quot;/&gt;</p><p class="MsoNormal"> </p><p class="MsoNormal">    &lt;param name=&quot;sip-port&quot; value=&quot;$${sip_port}&quot;/&gt;</p>
<p class="MsoNormal"> </p><p class="MsoNormal">    &lt;param name=&quot;rtp-ip&quot; value=&quot;$${rtp_ip}&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;sip-ip&quot; value=&quot;$${ext_ip}&quot;/&gt;</p><p class="MsoNormal">
 </p><p class="MsoNormal">&lt;!--    &lt;param name=&quot;codec-prefs&quot; value=&quot;$${global_codec_prefs}&quot;/&gt;--&gt;</p><p class="MsoNormal">    &lt;param name=&quot;inbound-codec-prefs&quot; value=&quot;PCMU,PCMA,G729&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;outbound-codec-prefs&quot; value=&quot;$${global_codec_prefs}&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;inbound-late-negotiation&quot; value=&quot;false&quot;/&gt;</p>
<p class="MsoNormal">    &lt;param name=&quot;inbound-codec-negotiation&quot; value=&quot;greedy&quot;/&gt;</p><p class="MsoNormal">    &lt;param name=&quot;disable-transcoding&quot; value=&quot;false&quot;/&gt;</p><p class="MsoNormal">
 </p><p class="MsoNormal">  &lt;/settings&gt;</p><p class="MsoNormal">&lt;/profile&gt;</p><p class="MsoNormal"> </p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></p>
</div><p class="MsoNormal"> </p></div></div></div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>