<div>Actually,</div>
<div> </div>
<div>I tougth it was working but it is not.</div>
<div>If when I answer the call and stay in silence everything works ok. But if I say something or there is any noise in the room shows in the freeswitch console the [WARNING] mod_sofia.c:999 and the call starts to get choppy. </div>

<div> </div>
<div>The command that I am running in the freeswitch console is this:</div>
<div>bgapi originate {ignore_early_media=true,originate_timeout=60}sofia/gateway/nettophone/18197713136 &amp;playback(/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-sample_submenu.wav)</div>
<div> </div>
<div>Reading the debug of the call what I could understand is while the ptime of the call is in 20ms everything works good, but when it changes to 30ms the call starts to get choppy. And it gets changed after the warning. </div>

<div> </div>
<div> On the file vars.xml I also tried this configuration:</div>
<div><span lang="EN">&lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;outbound_codec_prefs=PCMU@20i,PCMA@20i&quot;/&gt;</span></div>
<div><span lang="EN">But after the warning it still changes the ptime to 30 and the call starts to get choppy.</span></div>
<div><span lang="EN"></span> </div>
<div><span lang="EN">Does anyone knows what else I could do ? Thanks for any ideas.</span></div>
<div> </div>
<div>Here is the debug of the call:<br></div>
<div>2010-04-30 21:40:09.656257 [DEBUG] mod_sofia.c:140 sofia/external/18197713136 SOFIA ROUTING<br>2010-04-30 21:40:09.656257 [DEBUG] switch_ivr_originate.c:66 (sofia/external/18197713136) State Change CS_ROUTING -&gt; CS_CONSUME_MEDIA<br>
2010-04-30 21:40:09.656257 [DEBUG] switch_core_session.c:1022 Send signal sofia/external/18197713136 [BREAK]<br>2010-04-30 21:40:09.656257 [DEBUG] switch_core_state_machine.c:341 (sofia/external/18197713136) State ROUTING going to sleep<br>
2010-04-30 21:40:09.656257 [DEBUG] switch_core_state_machine.c:314 (sofia/external/18197713136) Running State Change CS_CONSUME_MEDIA<br>2010-04-30 21:40:09.656257 [DEBUG] switch_core_state_machine.c:360 (sofia/external/18197713136) State CONSUME_MEDIA<br>
2010-04-30 21:40:09.656257 [DEBUG] switch_core_state_machine.c:360 (sofia/external/18197713136) State CONSUME_MEDIA going to sleep<br>send 1085 bytes to udp/[66.33.157.119]:5060 at 02:40:09.657682:<br>   ------------------------------------------------------------------------<br>
   INVITE <a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a> SIP/2.0<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;rport;branch=z9hG4bKBB4KpNNHQUFyS<br>   Max-Forwards: 70<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222468 INVITE<br>   Contact: &lt;sip:gw+nettophone@10.1.1.1:5080;transport=udp;gw=nettophone&gt;<br>
   User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-<br>   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY<br>   Supported: timer, precondition, path, replaces<br>   Allow-Events: talk, hold, refer<br>
   Content-Type: application/sdp<br>   Content-Disposition: session<br>   Content-Length: 270<br>   X-FS-Support: update_display<br>   Remote-Party-ID: &lt;<a href="mailto:sip%3A0000000000@66.33.157.119">sip:0000000000@66.33.157.119</a>&gt;;party=calling;screen=yes;privacy=off</div>

<div>   v=0<br>   o=FreeSWITCH 1272653081 1272653082 IN IP4 10.1.1.1<br>   s=FreeSWITCH<br>   c=IN IP4 10.1.1.1<br>   t=0 0<br>   m=audio 28528 RTP/AVP 0 8 101 13<br>   a=rtpmap:0 PCMU/8000<br>   a=rtpmap:8 PCMA/8000<br>
   a=rtpmap:101 telephone-event/8000<br>   a=fmtp:101 0-16<br>   a=rtpmap:13 CN/8000<br>   a=ptime:20<br>   ------------------------------------------------------------------------<br>2010-04-30 21:40:09.656257 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [calling][0]<br>
recv 411 bytes from udp/[66.33.157.119]:5060 at 02:40:09.703164:<br>   ------------------------------------------------------------------------<br>   SIP/2.0 100 Trying<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;branch=z9hG4bKBB4KpNNHQUFyS;received=10.1.1.1;rport=5080<br>
   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>
   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222468 INVITE<br>   Contact: &lt;sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a>&gt;<br>   Server: Net2Phone Carrier<br>   Content-Length: 0</div>

<div>   ------------------------------------------------------------------------<br>recv 657 bytes from udp/[66.33.157.119]:5060 at 02:40:11.008062:<br>   ------------------------------------------------------------------------<br>
   SIP/2.0 183 Session Progress<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;branch=z9hG4bKBB4KpNNHQUFyS;received=10.1.1.1;rport=5080<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222468 INVITE<br>   Contact: &lt;sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a>&gt;<br>
   Server: Net2Phone Carrier<br>   Content-Length: 203<br>   Content-Type: application/sdp</div>
<div>   v=0<br>   o=44952 713620800 713620800 IN IP4 169.132.188.43<br>   s=SIP Call<br>   c=IN IP4 169.132.188.43<br>   t=0 0<br>   m=audio 22696 RTP/AVP 0 101<br>   a=rtpmap:0 PCMU/8000<br>   a=rtpmap:101 telephone-event/8000<br>
   a=fmtp:101 0-11<br>   ------------------------------------------------------------------------<br>2010-04-30 21:40:11.008120 [INFO] sofia.c:662 Update Callee ID to &quot;18197713136&quot; &lt;18197713136&gt;<br>2010-04-30 21:40:11.008120 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [proceeding][183]<br>
2010-04-30 21:40:11.008120 [DEBUG] sofia.c:4183 Remote SDP:<br>v=0<br>o=44952 713620800 713620800 IN IP4 169.132.188.43<br>s=SIP Call<br>c=IN IP4 169.132.188.43<br>t=0 0<br>m=audio 22696 RTP/AVP 0 101<br>a=rtpmap:0 PCMU/8000<br>
a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-11</div>
<div>2010-04-30 21:40:11.008120 [DEBUG] sofia_glue.c:3674 Audio Codec Compare [PCMU:0:8000:20]/[PCMU:0:8000:20]<br>2010-04-30 21:40:11.008120 [DEBUG] sofia_glue.c:2372 Set Codec sofia/external/18197713136 PCMU/8000 20 ms 160 samples<br>
2010-04-30 21:40:11.008120 [DEBUG] sofia_glue.c:3607 Set 2833 dtmf send payload to 101<br>2010-04-30 21:40:11.008120 [DEBUG] sofia_glue.c:2612 AUDIO RTP [sofia/external/18197713136] 10.1.1.1 port 28528 -&gt; 169.132.188.43 port 22696 codec: 0 ms: 20<br>
2010-04-30 21:40:11.008120 [DEBUG] switch_rtp.c:1346 Starting timer [soft] 160 bytes per 20ms<br>2010-04-30 21:40:11.012070 [DEBUG] sofia_glue.c:2818 Set 2833 dtmf send payload to 101<br>2010-04-30 21:40:11.012070 [DEBUG] sofia_glue.c:2823 Set 2833 dtmf receive payload to 101<br>
2010-04-30 21:40:11.012070 [NOTICE] sofia_glue.c:3227 Pre-Answer sofia/external/18197713136!<br>recv 681 bytes from udp/[66.33.157.119]:5060 at 02:40:18.227385:<br>   ------------------------------------------------------------------------<br>
   SIP/2.0 200 OK<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;branch=z9hG4bKBB4KpNNHQUFyS;received=10.1.1.1;rport=5080<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Allow: ACK,BYE,CANCEL,INVITE,OPTIONS<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>
   CSeq: 130222468 INVITE<br>   Contact: &lt;sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a>&gt;<br>   Server: Net2Phone Carrier<br>   Content-Length: 203<br>   Content-Type: application/sdp</div>
<div>   v=0<br>   o=44952 713620800 713620800 IN IP4 169.132.188.43<br>   s=SIP Call<br>   c=IN IP4 169.132.188.43<br>   t=0 0<br>   m=audio 22696 RTP/AVP 0 101<br>   a=rtpmap:0 PCMU/8000<br>   a=rtpmap:101 telephone-event/8000<br>
   a=fmtp:101 0-11<br>   ------------------------------------------------------------------------<br>2010-04-30 21:40:18.227023 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [completing][200]<br>2010-04-30 21:40:18.227023 [DEBUG] sofia.c:4180 Duplicate SDP<br>
v=0<br>o=44952 713620800 713620800 IN IP4 169.132.188.43<br>s=SIP Call<br>c=IN IP4 169.132.188.43<br>t=0 0<br>m=audio 22696 RTP/AVP 0 101<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-11</div>

<div>send 429 bytes to udp/[66.33.157.119]:5060 at 02:40:18.228604:<br>   ------------------------------------------------------------------------<br>   ACK sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a> SIP/2.0<br>
   Via: SIP/2.0/UDP 10.1.1.1:5080;rport;branch=z9hG4bKcmXcrg6mm45gN<br>   Max-Forwards: 70<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222468 ACK<br>   Contact: &lt;sip:gw+nettophone@10.1.1.1:5080;transport=udp;gw=nettophone&gt;<br>
   Content-Length: 0</div>
<div>   ------------------------------------------------------------------------<br>2010-04-30 21:40:18.227023 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [ready][200]<br>2010-04-30 21:40:18.227023 [NOTICE] sofia.c:4696 Channel [sofia/external/18197713136] has been answered<br>
2010-04-30 21:40:18.228967 [DEBUG] switch_ivr_originate.c:3210 Originate Resulted in Success: [sofia/external/18197713136]<br>2010-04-30 21:40:18.228967 [DEBUG] mod_commands.c:2870 (sofia/external/18197713136) State Change CS_CONSUME_MEDIA -&gt; CS_EXECUTE<br>
2010-04-30 21:40:18.228967 [DEBUG] switch_core_session.c:1022 Send signal sofia/external/18197713136 [BREAK]<br>2010-04-30 21:40:18.228967 [DEBUG] switch_core_state_machine.c:314 (sofia/external/18197713136) Running State Change CS_EXECUTE<br>
2010-04-30 21:40:18.228967 [DEBUG] switch_core_state_machine.c:348 (sofia/external/18197713136) State EXECUTE<br>2010-04-30 21:40:18.228967 [DEBUG] mod_sofia.c:233 sofia/external/18197713136 SOFIA EXECUTE<br>2010-04-30 21:40:18.228967 [DEBUG] switch_core_state_machine.c:157 sofia/external/18197713136 Standard EXECUTE<br>
EXECUTE sofia/external/18197713136 playback(/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-sample_submenu.wav)<br>2010-04-30 21:40:18.229973 [DEBUG] switch_ivr_play_say.c:1152 Codec Activated <a href="mailto:L16@8000hz">L16@8000hz</a> 1 channels 20ms<br>
2010-04-30 21:40:18.287128 [DEBUG] switch_rtp.c:2446 Correct ip/port confirmed.<br>2010-04-30 21:40:18.486993 [WARNING] mod_sofia.c:999 We were told to use ptime 20 but what they meant to say was 30<br>This issue has so far been identified to happen on the following broken platforms/devices:<br>
Linksys/Sipura aka Cisco<br>ShoreTel<br>Sonus/L3<br>We will try to fix it but some of the devices on this list are so broken who knows what will happen..<br>2010-04-30 21:40:18.486993 [DEBUG] sofia_glue.c:2301 Changing Codec from <a href="mailto:PCMU@20ms">PCMU@20ms</a> to <a href="mailto:PCMU@30ms">PCMU@30ms</a><br>
2010-04-30 21:40:18.486993 [DEBUG] switch_rtp.c:1232 RE-Starting timer [soft] 240 bytes per 30000ms<br>2010-04-30 21:40:18.486993 [DEBUG] sofia_glue.c:2372 Set Codec sofia/external/18197713136 PCMU/8000 30 ms 240 samples<br>
send 1081 bytes to udp/[66.33.157.119]:5060 at 02:40:18.487972:<br>   ------------------------------------------------------------------------<br>   INVITE sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a> SIP/2.0<br>
   Via: SIP/2.0/UDP 10.1.1.1:5080;rport;branch=z9hG4bKDXp5SBQrHDv3g<br>   Max-Forwards: 70<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222469 INVITE<br>   Contact: &lt;sip:gw+nettophone@10.1.1.1:5080;transport=udp;gw=nettophone&gt;<br>
   User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-<br>   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY<br>   Supported: timer, precondition, path, replaces<br>   Content-Type: application/sdp<br>
   Content-Disposition: session<br>   Content-Length: 249<br>   X-Broken-PTIME: Adv=20;Sent=30<br>   X-FS-Support: update_display<br>   Remote-Party-ID: &lt;<a href="mailto:sip%3A0000000000@66.33.157.119">sip:0000000000@66.33.157.119</a>&gt;;party=calling;screen=yes;privacy=off</div>

<div>   v=0<br>   o=FreeSWITCH 1272653081 1272653083 IN IP4 10.1.1.1<br>   s=FreeSWITCH<br>   c=IN IP4 10.1.1.1<br>   t=0 0<br>   m=audio 28528 RTP/AVP 0 101<br>   a=rtpmap:0 PCMU/8000<br>   a=rtpmap:101 telephone-event/8000<br>
   a=fmtp:101 0-16<br>   a=silenceSupp:off - - - -<br>   a=ptime:30<br>   ------------------------------------------------------------------------<br>2010-04-30 21:40:18.486993 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [calling][0]<br>
2010-04-30 21:40:18.517050 [DEBUG] switch_core_io.c:896 Engaging Write Buffer at 480 bytes to accommodate 320-&gt;480<br>recv 681 bytes from udp/[66.33.157.119]:5060 at 02:40:18.534493:<br>   ------------------------------------------------------------------------<br>
   SIP/2.0 200 OK<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;branch=z9hG4bKDXp5SBQrHDv3g;received=10.1.1.1;rport=5080<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Allow: ACK,BYE,CANCEL,INVITE,OPTIONS<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>
   CSeq: 130222469 INVITE<br>   Contact: &lt;sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a>&gt;<br>   Server: Net2Phone Carrier<br>   Content-Length: 203<br>   Content-Type: application/sdp</div>
<div>   v=0<br>   o=44952 713620800 713620800 IN IP4 169.132.188.43<br>   s=SIP Call<br>   c=IN IP4 169.132.188.43<br>   t=0 0<br>   m=audio 22696 RTP/AVP 0 101<br>   a=rtpmap:0 PCMU/8000<br>   a=rtpmap:101 telephone-event/8000<br>
   a=fmtp:101 0-11<br>   ------------------------------------------------------------------------<br>send 429 bytes to udp/[66.33.157.119]:5060 at 02:40:18.534747:<br>   ------------------------------------------------------------------------<br>
   ACK sip:<a href="http://66.33.157.119:5060">66.33.157.119:5060</a> SIP/2.0<br>   Via: SIP/2.0/UDP 10.1.1.1:5080;rport;branch=z9hG4bKe6FyU67Uepjpc<br>   Max-Forwards: 70<br>   From: &quot;&quot; &lt;<a href="mailto:sip%3Acust_USERNAME@66.33.157.119">sip:cust_USERNAME@66.33.157.119</a>;transport=udp&gt;;tag=BBvj27gt2ZFQB<br>
   To: &lt;<a href="mailto:sip%3A18197713136@66.33.157.119">sip:18197713136@66.33.157.119</a>&gt;;tag=ccid-713620800-1-574<br>   Call-ID: b36e59ea-cf6d-122d-0a9c-0026b97cdbb8<br>   CSeq: 130222469 ACK<br>   Contact: &lt;sip:gw+nettophone@10.1.1.1:5080;transport=udp;gw=nettophone&gt;<br>
   Content-Length: 0</div>
<div>   ------------------------------------------------------------------------<br>2010-04-30 21:40:18.534975 [DEBUG] sofia.c:4172 Channel sofia/external/18197713136 entering state [ready][200]<br>2010-04-30 21:40:18.534975 [DEBUG] sofia.c:4180 Duplicate SDP<br>
v=0<br>o=44952 713620800 713620800 IN IP4 169.132.188.43<br>s=SIP Call<br>c=IN IP4 169.132.188.43<br>t=0 0<br>m=audio 22696 RTP/AVP 0 101<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-11<br>
</div>