<div dir="ltr">

<p class="">I am using Freeswitch (1.4.8) as an SBC between our
company PABX and our ISP&#39;s Trunk (also terminating on an SBC).</p>

<p class="">My problem is that I need G729 in some cases and PCMA in
others (the majority).</p>

<p class=""> </p>

<p class="">The setup looks more or less like this:</p>

<p class="">Our PABX (192.168.102.215)=&gt;(192.168.102.102)Our SBC
(10.17.159.10)=&gt;(10.17.159.9)ISP SBC=&gt;Rest of the world</p>

<p class=""> </p>

<p class="">Since we use private addresses, Freeswitch must do RTP
proxying.<span style>  </span>No transcoding must be done!!!</p>

<p class=""> </p>

<p class="">I have set global_codec_prefs to
&quot;PCMA,G729&quot;.<span style>  </span>Then everything
to destination supporting PCMA works.<span style> 
</span>When trying to connect to a G729-only PABX, the call fails.<span style>  </span>Leg A is setup as follows</p>

<p class=""> </p>

<p class=""><span style>   
</span>192.168.102.215.5060 &gt; 192.168.102.102.5090: SIP, length: 933</p>

<p class=""><span style>   </span><span style>     </span>INVITE <a href="sip:0873611337@192.168.102.102:5090;transport=udp">sip:0873611337@192.168.102.102:5090;transport=udp</a>
SIP/2.0</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_iFGEOrlLLf</p>

<p class=""><span style>        </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-9lz36fM4mXAo</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>Contact:
&lt;<a href="sip:anonymous@192.168.102.215:5060;maddr=192.168.102.215">sip:anonymous@192.168.102.215:5060;maddr=192.168.102.215</a>&gt;</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-5nUh73XkOk</p>

<p class=""><span style>     </span><span style>   </span>Content-Type: application/sdp</p>

<p class=""><span style>       
</span>Content-Length: 288</p>

<p class=""><span style>       
</span>X-Siemens-Call-Type: ST-insecure</p>

<p class=""><span style>       
</span>Accept-Language: en;q=0.0</p>

<p class=""><span style>        </span>Allow:
REGISTER, INVITE, ACK, BYE, CANCEL, NOTIFY, REFER, INFO</p>

<p class=""><span style>        </span>Date: Wed,
01 Apr 2015 14:30:15 GMT</p>

<p class=""><span style>     </span><span style>   </span>Max-Forwards: 69</p>

<p class=""> </p>

<p class=""><span style>        </span>v=0</p>

<p class=""><span style>        </span>o=MxSIP 0
105140472 IN IP4 10.11.32.226</p>

<p class=""><span style>        </span>s=SIP Call</p>

<p class=""><span style>        </span>c=IN IP4
10.11.32.226</p>

<p class=""><span style>        </span>t=0 0</p>

<p class=""><span style>        </span>m=audio
5014 RTP/AVP 8 0 18 101</p>

<p class=""><span style>        </span>a=rtpmap:8
PCMA/8000</p>

<p class=""><span style>        </span>a=rtpmap:0
PCMU/8000</p>

<p class=""><span style>        </span>a=rtpmap:18
G729/8000</p>

<p class=""><span style>       
</span>a=rtpmap:101 telephone-event/8000</p>

<p class=""><span style>       
</span>a=silenceSupp:off - - - -</p>

<p class=""><span style>        </span>a=fmtp:18
annexb=no</p>

<p class=""><span style>        </span>a=fmtp:101
0-15</p>

<p class=""> </p>

<p class=""><span style>   
</span>192.168.102.102.5090 &gt; 192.168.102.215.5060: SIP, length: 396</p>

<p class=""><span style>        </span>SIP/2.0 100
Trying</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-5nUh73XkOk</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_iFGEOrlLLf</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;</p>

<p class=""><span style>        </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-9lz36fM4mXAo</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>User-Agent:
FreeSWITCH-mod_sofia/1.4.18+git~20150312T185523Z~4eed221b69~64bit</p>

<p class=""><span style>       
</span>Content-Length: 0</p>

<p class=""> </p>

<p class=""><span style>   
</span>192.168.102.102.5090 &gt; 192.168.102.215.5060: SIP, length: 1201</p>

<p class=""><span style>        </span>SIP/2.0 200
OK</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-5nUh73XkOk</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_iFGEOrlLLf</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;;tag=BytX6X1t7HytF</p>

<p class=""><span style>      </span><span style>  </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-9lz36fM4mXAo</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>Contact:
&lt;<a href="sip:0873611337@192.168.102.102:5090;transport=udp">sip:0873611337@192.168.102.102:5090;transport=udp</a>&gt;</p>

<p class=""><span style>        </span>User-Agent:
FreeSWITCH-mod_sofia/1.4.18+git~20150312T185523Z~4eed221b69~64bit</p>

<p class=""><span style>        </span>Accept:
application/sdp</p>

<p class=""><span style>        </span>Allow:
INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER,
NOTIFY, PUBLISH, SUBSCRIBE</p>

<p class=""><span style>        </span>Supported:
timer, path, replaces</p>

<p class=""><span style>       
</span>Allow-Events: talk, hold, conference, presence, as-feature-event,
dialog, line-seize, call-info, sla, include-session-description,
presence.winfo, message-summary, refer</p>

<p class=""><span style>       
</span>Content-Type: application/sdp</p>

<p class=""><span style>       
</span>Content-Disposition: session</p>

<p class=""><span style>       
</span>Content-Length: 226</p>

<p class=""><span style>       
</span>Remote-Party-ID: &quot;0873611337&quot; &lt;<a href="sip:0873611337@192.168.102.102">sip:0873611337@192.168.102.102</a>&gt;;party=calling;privacy=off;screen=no</p>

<p class=""> </p>

<p class=""><span style>        </span>v=0</p>

<p class=""><span style>       
</span>o=FreeSWITCH 1427881297 1427881298 IN IP4 192.168.102.102</p>

<p class=""><span style>       
</span>s=FreeSWITCH</p>

<p class=""><span style>        </span>c=IN IP4
192.168.102.102</p>

<p class=""><span style>        </span>t=0 0</p>

<p class=""><span style>        </span>m=audio
17318 RTP/AVP 8 101</p>

<p class=""><span style>        </span>a=rtpmap:8
PCMA/8000</p>

<p class=""><span style>       
</span>a=rtpmap:101 telephone-event/8000</p>

<p class=""><span style>        </span>a=fmtp:101
0-16</p>

<p class=""><span style>        </span>a=ptime:20</p>

<p class=""> </p>

<p class=""> </p>

<p class="">When I change my global_codec_prefs to
&quot;G729,PCMA&quot;, G729 is offered to our PABX by Freeswitch, then to the
ISP and then it works to destinations supporting G729.<span style>  </span>It fails to destinations not supporting
G729.<span style>  </span>Now Leg A is setup as follows:</p>

<p class=""> </p>

<p class=""><span style>  
</span>192.168.102.215.5060 &gt; 192.168.102.102.5090: SIP, length: 934</p>

<p class=""><span style>        </span>INVITE <a href="sip:0873611337@192.168.102.102:5090;transport=udp">sip:0873611337@192.168.102.102:5090;transport=udp</a>
SIP/2.0</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_8NZMvB3KNA</p>

<p class=""><span style>        </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-k6bGtU73W2Vm</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>Contact:
&lt;<a href="sip:anonymous@192.168.102.215:5060;maddr=192.168.102.215">sip:anonymous@192.168.102.215:5060;maddr=192.168.102.215</a>&gt;</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-ZO003uQGh0</p>

<p class=""><span style>       
</span>Content-Type: application/sdp</p>

<p class=""><span style>       
</span>Content-Length: 289</p>

<p class=""><span style>       
</span>X-Siemens-Call-Type: ST-insecure</p>

<p class=""><span style>       
</span>Accept-Language: en;q=0.0</p>

<p class=""><span style>        </span>Allow:
REGISTER, INVITE, ACK, BYE, CANCEL, NOTIFY, REFER, INFO</p>

<p class=""><span style>        </span>Date: Wed,
01 Apr 2015 14:27:51 GMT</p>

<p class=""><span style>       
</span>Max-Forwards: 69</p>

<p class=""> </p>

<p class=""><span style>        </span>v=0</p>

<p class=""><span style>        </span>o=MxSIP 0
1224193414 IN IP4 10.11.32.226</p>

<p class=""><span style>        </span>s=SIP Call</p>

<p class=""><span style>        </span>c=IN IP4
10.11.32.226</p>

<p class=""><span style>        </span>t=0 0</p>

<p class=""><span style>        </span>m=audio
5014 RTP/AVP 8 0 18 101</p>

<p class=""><span style>        </span>a=rtpmap:8
PCMA/8000</p>

<p class=""><span style>        </span>a=rtpmap:0
PCMU/8000</p>

<p class=""><span style>        </span>a=rtpmap:18
G729/8000</p>

<p class=""><span style>       
</span>a=rtpmap:101 telephone-event/8000</p>

<p class=""><span style>       
</span>a=silenceSupp:off - - - -</p>

<p class=""><span style>        </span>a=fmtp:18
annexb=no</p>

<p class=""><span style>        </span>a=fmtp:101
0-15</p>

<p class=""> </p>

<p class=""><span style>   
</span>192.168.102.102.5090 &gt; 192.168.102.215.5060: SIP, length: 396</p>

<p class=""><span style>        </span>SIP/2.0 100
Trying</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-ZO003uQGh0</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_8NZMvB3KNA</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;</p>

<p class=""><span style>        </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-k6bGtU73W2Vm</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>User-Agent:
FreeSWITCH-mod_sofia/1.4.18+git~20150312T185523Z~4eed221b69~64bit</p>

<p class=""><span style>       
</span>Content-Length: 0</p>

<p class=""> </p>

<p class=""><span style>   
</span>192.168.102.102.5090 &gt; 192.168.102.215.5060: SIP, length: 1224</p>

<p class=""><span style>        </span>SIP/2.0 200
OK</p>

<p class=""><span style>        </span>Via:
SIP/2.0/UDP
192.168.102.215:5060;branch=z9hG4bKSEC-a64a8c0-1e64a8c0-1-ZO003uQGh0</p>

<p class="" style><span style>        </span>From: &quot;JGD Winson&quot; &lt;<a href="sip:anonymous@anonymous.invalid">sip:anonymous@anonymous.invalid</a>&gt;;tag=snl_8NZMvB3KNA</p>

<p class=""><span style>        </span>To: &lt;<a href="sip:0873611337@192.168.102.102;user=phone">sip:0873611337@192.168.102.102;user=phone</a>&gt;;tag=g2eKXDUB6y4Hr</p>

<p class=""><span style>        </span>Call-ID:
SEC11-a64a8c0-1e64a8c0-1-k6bGtU73W2Vm</p>

<p class=""><span style>        </span>CSeq: 1235
INVITE</p>

<p class=""><span style>        </span>Contact:
&lt;<a href="sip:0873611337@192.168.102.102:5090;transport=udp">sip:0873611337@192.168.102.102:5090;transport=udp</a>&gt;</p>

<p class=""><span style>        </span>User-Agent:
FreeSWITCH-mod_sofia/1.4.18+git~20150312T185523Z~4eed221b69~64bit</p>

<p class=""><span style>        </span>Accept:
application/sdp</p>

<p class=""><span style>        </span>Allow:
INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER,
NOTIFY, PUBLISH, SUBSCRIBE</p>

<p class=""><span style>        </span>Supported:
timer, path, replaces</p>

<p class=""><span style>       
</span>Allow-Events: talk, hold, conference, presence, as-feature-event,
dialog, line-seize, call-info, sla, include-session-description,
presence.winfo, message-summary, refer</p>

<p class=""><span style>       
</span>Content-Type: application/sdp</p>

<p class=""><span style>       
</span>Content-Disposition: session</p>

<p class=""><span style>       
</span>Content-Length: 249</p>

<p class=""><span style>       
</span>Remote-Party-ID: &quot;0873611337&quot; &lt;<a href="sip:0873611337@192.168.102.102">sip:0873611337@192.168.102.102</a>&gt;;party=calling;privacy=off;screen=no</p>

<p class=""> </p>

<p class=""><span style>        </span>v=0</p>

<p class=""><span style>       
</span>o=FreeSWITCH 1427866745 1427866746 IN IP4 192.168.102.102</p>

<p class=""><span style>       
</span>s=FreeSWITCH</p>

<p class=""><span style>    </span><span style>    </span>c=IN IP4 192.168.102.102</p>

<p class=""><span style>        </span>t=0 0</p>

<p class=""><span style>        </span>m=audio
31726 RTP/AVP 18 101</p>

<p class=""><span style>        </span>a=rtpmap:18
G729/8000</p>

<p class=""><span style>        </span>a=fmtp:18
annexb=no</p>

<p class=""><span style>       
</span>a=rtpmap:101 telephone-event/8000</p>

<p class=""><span style>        </span>a=fmtp:101
0-16</p>

<p class=""><span style>        </span>a=ptime:20</p>

<p class=""> </p>

<p class="">I have tried various (hopefully all) combinations of
inbound-codec-negotiation (generous, greedy and scrooge) and
inbound-late-negotiation (true, false).<span style> 
</span>Nothing does what I want.</p>

<p class=""> </p>

<p class="">I believe Freeswitch needs to negotiate the codecs with
the endpoint and choose one from my list.<span style> 
</span>However, it seems to grab the first one in my list before checking the
endpoint.<span style>  </span>Then it offers only that codec
to the endpoint, which of course ignores / rejects it!</p>

<p class=""> </p>

<p class="">What can I do?</p>

<p class="">Regards</p>

<span style="font-size:11pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Andries</span></div>