<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Thanks Brian<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>By ‘this’, do we mean, 2 m-lines, my hack or both? ;)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> FreeSWITCH-users [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>On Behalf Of </b>Brian West<br><b>Sent:</b> Sunday, 20 August 2017 8:25 AM<br><b>To:</b> FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org><br><b>Subject:</b> Re: [Freeswitch-users] Early media + T38 in SDP = Codec negotiation error<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>We do not support this!<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, Aug 17, 2017 at 3:18 AM Tristan Dean <<a href="mailto:tristan@mocha.net.nz">tristan@mocha.net.nz</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>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" 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" 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" 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" 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" 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" target="_blank">http://www.freeswitchsolutions.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br><a href="http://www.cluecon.com" 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" 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><br>---<br>This email has been checked for viruses by AVG.<br><a href="http://www.avg.com" 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" target="_blank">http://www.freeswitchsolutions.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br><a href="http://www.cluecon.com" 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" 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><o:p></o:p></p></blockquote></div></div><div><p class=MsoNormal>-- <o:p></o:p></p></div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><p><b><i><span style='font-size:13.5pt;font-family:"Courier New"'>Brian West</span></i></b><span style='font-family:"Courier New"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span><o:p></o:p></p><p><b><i><span style='font-family:"Courier New"'>Twitter: @FreeSWITCH , @briankwest</span></i></b><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New"'><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></span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New"'><a href="https://freeswitch.com/appointment" target="_blank">Book a phone call (CST)</a><br><br>Allison prompts for FreeSWITCH:</span><o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><p><span style='font-size:9.5pt'><a href="https://www.gofundme.com/allison-prompts-for-freeswitch" target="_blank"><b>https://www.gofundme.com/allison-prompts-for-freeswitch</b></a><o:p></o:p></span></p></td></tr></table><p><span style='font-size:9.5pt;font-family:"Courier New"'>Got Bugs? Report them </span><a href="https://freeswitch.org/jira" target="_blank"><span style='font-size:9.5pt;font-family:"Courier New"'>here</span></a><span style='font-size:9.5pt;font-family:"Courier New"'>! | Reddit: </span><a href="https://www.reddit.com/r/freeswitch" target="_blank"><span style='font-size:9.5pt;font-family:"Courier New"'>/r/freeswitch</span></a><o:p></o:p></p><p><b><span style='font-size:10.0pt;font-family:"Courier New"'>T:</span></b><span style='font-size:10.0pt;font-family:"Courier New"'>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>Skype:</b>briankwest</span><o:p></o:p></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
        <tr>
        <td style="width: 55px; padding-top: 13px;"><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png" alt=""  width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
                <td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avg.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body></html>