<div><div dir="auto">We do not support this!</div><br><div class="gmail_quote"><div>On Thu, Aug 17, 2017 at 3:18 AM Tristan Dean <<a href="mailto:tristan@mocha.net.nz">tristan@mocha.net.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi animal_alpha<br>
<br>
This sounds very much like a problem I had when we upgraded from 1.4 to 1.6.<br>
In our case, the carrier was sending the initial INVITE messages with 2 m-lines. One with audio, one with image. Both had non-zero port numbers. In my testing, it seemed to be that having 2 m-lines with different port numbers upset FreeSWITCH's SDP parsing.<br>
<br>
If I set bypass_media=true and FreeSWITCH could step out of media path, the call could connect normally, but this wasn't an option for us as we needed to transcode. I can't recall if proxy_media=true worked (I.E. FreeSWITCH just proxies RTP and doesn't transcode). Our application required transcoding anyway.<br>
<br>
In the end I made a rather ugly work-around, but I'm sure there are nicer ways to manage this.<br>
I found that FreeSWITCH 1.6 could parse the SDP correctly if I rewrote the port for the m-line containing image.<br>
<br>
Since we were using mod_xml_curl for the dialplan, this was quite easy.<br>
Effectively I have a bit of perl script  parsing the SDP lines from 'variable_switch_r_sdp'.<br>
<br>
if ($line =~  /^m\=image\s+(\d+)\s+udptl\s+(.*)$/) {<br>
                        $line = "m=image 0 udptl $2";<br>
                        $rewrite_reqd = 1;<br>
                        }<br>
$line = "$line\r\n";<br>
<br>
You can insert the rewritten SDP with <![CDATA[switch_r_sdp=$rewritten_sdp]]><br>
This worked around the problem and didn't interfere with T.38 revinites from fax machines.<br>
<br>
All this being said, I am not certain that my approach would work as if I understand you correctly, your problem is with the SDP attached to the 18X message. Hopefully this might inspire some other ideas if nothing else.<br>
<br>
I am very interested to hear other's thoughts on this. I feel I'm probably missing something and there is a cleaner way of managing these SDPs.<br>
<br>
Many thanks,<br>
<br>
Tristan<br>
<br>
-----Original Message-----<br>
From: FreeSWITCH-users [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of animal_alpha<br>
Sent: Wednesday, 16 August 2017 5:57 PM<br>
To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
Subject: [Freeswitch-users] Early media + T38 in SDP = Codec negotiation error<br>
<br>
Hello everybody. Have some problem with fs.<br>
I've got codec negotiation error when i try use early_media and sdp has T38<br>
<br>
pre_answer()<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4504 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4504 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:101:8000:20:0:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:101:8000:20:0:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:101:8000:20:0:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:101:8000:20:0:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:97:8000:30:0:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:97:8000:30:0:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:97:8000:30:0:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:97:8000:30:0:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:98:8000:30:0:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:98:8000:30:0:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:98:8000:30:0:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [iLBC:98:8000:30:0:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [gsm:3:8000:20:13200:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [gsm:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [gsm:3:8000:20:13200:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [gsm:3:8000:20:13200:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [speex:99:8000:20:0:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [speex:99:8000:20:0:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [speex:99:8000:20:0:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [speex:99:8000:20:0:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4504 Audio Codec Compare [G729:18:8000:20:8000:1] ++++ is saved as a match<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[G722:9:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:100:8000:20:0:1]/[PCMA:8:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:100:8000:20:0:1]/[PCMU:0:8000:20:64000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:100:8000:20:0:1]/[G729:18:8000:20:8000:1]<br>
2017-08-16 08:50:36.337346 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:100:8000:20:0:1]/[G722:9:8000:20:64000:1]<br>
<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_media.c:4365 Set telephone-event payload to 96@8000<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_media.c:3061 Set Codec<br>
sofia/external/<a href="http://4995196123@10.34.111.140:5061" rel="noreferrer" target="_blank">4995196123@10.34.111.140:5061</a> PCMA/8000 20 ms 160 samples<br>
64000 bits 1 channels<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_codec.c:111<br>
sofia/external/<a href="http://4995196123@10.34.111.140:5061" rel="noreferrer" target="_blank">4995196123@10.34.111.140:5061</a> Original read codec set to<br>
PCMA:8<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_media.c:4708 Set telephone-event payload to 96@8000<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_media.c:4767<br>
sofia/external/<a href="http://123@10.34.111.140:5061" rel="noreferrer" target="_blank">123@10.34.111.140:5061</a> Set 2833 dtmf send payload to 96 recv payload to 96<br>
2017-08-16 08:25:36.105410 [DEBUG] switch_core_media.c:4028<br>
sofia/external/<a href="http://123@10.34.111.140:5061" rel="noreferrer" target="_blank">123@10.34.111.140:5061</a> T38 REFUSE on request<br>
2017-08-16 08:25:36.105410 [ERR] mod_sofia.c:2343 CODEC NEGOTIATION ERROR.<br>
SDP:<br>
v=0<br>
o=- 1502861170 1502861170 IN IP4 10.34.111.143<br>
s=-<br>
c=IN IP4 10.34.84.100<br>
t=0 0<br>
m=audio 53628 RTP/AVP 8 0 101 97 98 3 99 18 100 96<br>
a=rtpmap:8 PCMA/8000<br>
a=rtpmap:0 PCMU/8000<br>
a=rtpmap:101 G729/8000<br>
a=fmtp:101 annexb=yes<br>
a=rtpmap:97 iLBC/8000<br>
a=fmtp:97 mode=20<br>
a=rtpmap:98 iLBC/8000<br>
a=fmtp:98 mode=30<br>
a=rtpmap:3 gsm/8000<br>
a=rtpmap:99 speex/8000<br>
a=fmtp:99 mode=3;vbr=off<br>
a=rtpmap:18 G729/8000<br>
a=fmtp:18 annexb=no<br>
a=rtpmap:100 G729/8000<br>
a=fmtp:100 annexb=no<br>
a=rtpmap:96 telephone-event/8000<br>
a=fmtp:96 0-15<br>
m=image 41690 udptl t38<br>
a=T38FaxRateManagement:transferredTCF<br>
a=T38FaxUdpEC:t38UDPRedundancy<br>
<br>
my codecs:<br>
  <X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMA,PCMU,G729,G722"/><br>
  <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMA,PCMU,G729,G722"/><br>
<br>
Solution: dont use early media (use execute_on_answer=record_session instead of application=record_session in my case)<br>
<br>
Does not help: t38 ignore, late negotiation=false,<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/Early-media-T38-in-SDP-Codec-negotiation-error-tp7596350.html" rel="noreferrer" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/Early-media-T38-in-SDP-Codec-negotiation-error-tp7596350.html</a><br>
Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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>
<br>
<br>
---<br>
This email has been checked for viruses by AVG.<br>
<a href="http://www.avg.com" rel="noreferrer" target="_blank">http://www.avg.com</a><br>
<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">







<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p><p><b style="font-family:monospace,monospace;font-size:small"><i>Twitter: @FreeSWITCH , @briankwest</i></b></p><p><font size="2" face="monospace, monospace"><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a> <br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a></font></p><p><font size="2" face="monospace, monospace"><a href="https://freeswitch.com/appointment" target="_blank">Book a phone call (CST)</a><br><br>Allison prompts for FreeSWITCH:</font></p><table cellspacing="0" cellpadding="0" style="font-size:12.8px"><tbody><tr><td valign="baseline"><p><span><a href="https://www.gofundme.com/allison-prompts-for-freeswitch" target="_blank"><b>https://www.gofundme.com/allison-prompts-for-freeswitch</b></a></span></p></td></tr></tbody></table><p><span style="font-family:monospace,monospace;font-size:12.8px">Got Bugs? Report them </span><a href="https://freeswitch.org/jira" style="font-family:monospace,monospace;font-size:12.8px" target="_blank">here</a><span style="font-family:monospace,monospace;font-size:12.8px">! | Reddit: </span><a href="https://www.reddit.com/r/freeswitch" style="font-family:monospace,monospace;font-size:12.8px" target="_blank">/r/freeswitch</a><br></p>
<p><font size="2" face="monospace, monospace"><b>T:</b>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>Skype:</b>briankwest<br></font></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>