<p dir="ltr">With SIP/SDP the invite originator offer several codecs, but leg b is the one that set the selection. </p>
<p dir="ltr">The offer by leg b, is usually based on the priority of your offer vs their highest matched codecs, so if they offer g722 as 1st priority, and you offer it as 3rd priority, they will select g722 first. </p>
<p dir="ltr">Ido <br>
</p>
<div class="gmail_quote">On Mar 6, 2016 11:50 AM, &quot;Igor Olhovskiy&quot; &lt;<a href="mailto:igorolhovskiy@gmail.com">igorolhovskiy@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Main question - why it’s ignores <span style="font-size:13px">outbound-codec-prefs on external profile and use G722 as a first avail codec in list?</span></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-06 9:51 GMT+02:00 Igor Olhovskiy <span dir="ltr">&lt;<a href="mailto:igorolhovskiy@gmail.com" target="_blank">igorolhovskiy@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi!<div>I’m getting really strange things, or I’m just missed something.</div><div>My phone is dials to freeswitch with this this line in log</div><div><br></div><div><div>2016-03-06 08:31:56.681036 [DEBUG] sofia.c:6770 Remote SDP:</div><div>v=0</div><div>o=root 1697549695 1697549695 IN IP4 &lt;EXTERNAL IP HERE&gt;</div><div>s=call</div><div>c=IN IP4 &lt;EXTERNAL IP HERE&gt;</div><div>t=0 0</div><div>m=audio 26894 RTP/AVP 9 0 8</div><div>a=rtpmap:9 G722/8000</div><div>a=rtpmap:0 PCMU/8000</div><div>a=rtpmap:8 PCMA/8000</div><div>a=ptime:20</div><div>a=nortpproxy:yes</div><div><br></div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [G722:9:8000:20:64000:1]/[G722:9:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4216 Audio Codec Compare [G722:9:8000:20:64000:1] ++++ is saved as a match</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G722:9:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4216 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G722:9:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4161 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:4216 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match</div><div>2016-03-06 08:31:56.681036 [DEBUG] switch_core_media.c:2906 Set Codec sofia/internal/<a href="mailto:10@consertis.securenetvox.net" target="_blank">10@consertis.securenetvox.net</a> G722/8000 20 ms 160 samples 64000 bits 1 channels</div></div><div><br></div><div>And when switches to external profile, I see</div><div><br></div><div><div><div>2016-03-06 08:31:56.721010 [DEBUG] sofia_glue.c:1257 sofia/external/<a href="tel:00972543279009" value="+972543279009" target="_blank">00972543279009</a> sending invite version: 1.6.6 git d2d0b32 2016-01-11 20:16:12Z 64bit</div><div>Local SDP:</div><div>v=0</div><div>o=FreeSWITCH 1457219712 1457219713 IN IP4 10.0.20.71</div><div>s=FreeSWITCH</div><div>c=IN IP4 10.0.20.71</div><div>t=0 0</div><div>m=audio 29804 RTP/AVP 9 101 13</div><div>a=rtpmap:9 G722/8000</div><div>a=rtpmap:101 telephone-event/8000</div><div>a=fmtp:101 0-16</div><div>a=rtpmap:13 CN/8000</div><div>a=ptime:20</div><div>a=sendrecv</div></div><div><br></div><div><br></div><div>The question is - why only G722 left?</div><div>Across dialplan there is no things like inherit_codec, bypass media or other codec-related stuff</div><div><br></div><div>Profiles</div><div><div>external</div><div>ext-sip-ip [10.0.20.71]</div><div>rtp-timeout-sec [300]</div><div>rtp-hold-timeout-sec [1800]</div><div>tls [false]</div><div>tls-only [false]</div><div>tls-bind-params [transport=tls]</div><div>tls-sip-port [5081]</div><div>tls-cert-dir [/usr/local/freeswitch/conf/ssl]</div><div>tls-passphrase []</div><div>tls-verify-date [true]</div><div>tls-verify-depth [2]</div><div>tls-verify-in-subjects []</div><div>tls-version [tlsv1]</div><div>tls-verify-policy [all]</div><div>odbc-dsn [pgsql://hostaddr=127.0.0.1 port=5432 dbname=freeswitch user=fusionpbx password=pass options=&#39;&#39; application_name=&#39;freeswitch&#39;]</div><div>track-calls [true]</div><div>inbound-codec-negotiation [greedy]</div><div>debug [0]</div><div>user-agent-string [FreeSWITCH]</div><div>sip-trace [no]</div><div>sip-capture [no]</div><div>rfc2833-pt [101]</div><div>sip-port [5080]</div><div>dialplan [XML]</div><div>context [public]</div><div>dtmf-duration [2000]</div><div>inbound-codec-prefs [G7221@32000h,G7221@16000h,G722,PCMU,PCMA,OPUS,SILK]</div><div>outbound-codec-prefs [PCMU,PCMA,GSM]</div><div>hold-music [local_stream://default]</div><div>zrtp-passthru [true]</div><div>rtp-timer-name [soft]</div><div>local-network-acl [localnet.auto]</div><div>manage-presence [false]</div><div>nonce-ttl [60]</div><div>auth-calls [false]</div><div>rtp-ip [10.0.20.71]</div><div>sip-ip [10.0.20.71]</div><div>ext-rtp-ip [10.0.20.71]</div><div><br></div><div>internal</div><div>tls-cert-dir [/usr/local/freeswitch/conf/ssl]</div><div>tls-passphrase []</div><div>tls-verify-date [true]</div><div>tls-verify-depth [2]</div><div>tls-verify-in-subjects []</div><div>tls-version [tlsv1]</div><div>nonce-ttl [60]</div><div>auth-calls [true]</div><div>inbound-reg-force-matching-username [true]</div><div>auth-all-packets [false]</div><div>ext-rtp-ip [10.0.20.71]</div><div>ext-sip-ip [10.0.20.71]</div><div>rtp-timeout-sec [300]</div><div>rtp-hold-timeout-sec [1800]</div><div>tls-verify-policy [all]</div><div>multiple-registrations [contact]</div><div>enable-timer [false]</div><div>dbname [share_presence]</div><div>send-presence-on-register [true]</div><div>inbound-codec-negotiation [greedy]</div><div>NDLB-force-rport [safe]</div><div>challenge-realm [auto_to]</div><div>outbound-proxy [10.0.20.70]</div><div>track-calls [true]</div><div>odbc-dsn [pgsql://hostaddr=127.0.0.1 port=5432 dbname=freeswitch user=fusionpbx password=btgJek49 options=&#39;&#39; application_name=&#39;freeswitch&#39;]</div><div>nat-options-ping [true]</div><div>liberal-dtmf [true]</div><div>all-reg-options-ping [true]</div><div>force-publish-expires [true]</div><div>unregister-on-options-fail [true]</div><div>user-agent-string [FreeSWITCH]</div><div>debug [0]</div><div>sip-trace [no]</div><div>sip-capture [no]</div><div>watchdog-enabled [no]</div><div>watchdog-step-timeout [30000]</div><div>watchdog-event-timeout [30000]</div><div>log-auth-failures [true]</div><div>forward-unsolicited-mwi-notify [false]</div><div>context [public]</div><div>rfc2833-pt [101]</div><div>sip-port [5060]</div><div>dialplan [XML]</div><div>dtmf-duration [2000]</div><div>inbound-codec-prefs [G7221@32000h,G7221@16000h,G722,PCMU,PCMA,OPUS,SILK]</div><div>outbound-codec-prefs [G7221@32000h,G7221@16000h,G722,PCMU,PCMA,OPUS,SILK]</div><div>rtp-timer-name [soft]</div><div>rtp-ip [10.0.20.71]</div><div>sip-ip [10.0.20.71]</div><div>hold-music [local_stream://default]</div><div>apply-nat-acl [nat.auto]</div><div>aggressive-nat-detection [true]</div><div>apply-inbound-acl [domains]</div><div>local-network-acl [localnet.auto]</div><div>record-path [/usr/local/freeswitch/recordings]</div><div>record-template [${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.${record_ext}]</div><div>manage-presence [true]</div><div>presence-probe-on-register [true]</div><div>manage-shared-appearance [true]</div><div>tls [false]</div><div>tls-only [false]</div></div><div><div>tls-bind-params [transport=tls]</div><div>tls-sip-port [5061]</div></div><div><br></div><div>Tried with indbound-late-negotiation=false, also not helps…</div><div>Can you please, point, what is missing? Thanks</div><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr">Best regards,<div>Igor</div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Best regards,<div>Igor</div></div></div>
</div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div>