[Home]

Summary:ASTERISK-12084: delayed RTP cause first sound to chop off
Reporter:Ronald Chan (loloski)Labels:
Date Opened:2008-05-26 21:55:07Date Closed:2011-06-07 14:07:19
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/RTP
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) console.txt
( 1) rtp.txt
Description:snip dialplan

[from-sip]

exten => s,1,Answer
exten => s,n,AGI(agi.php)
exten => s,n,Hangup

snip agi.php

#!/usr/bin/php -q
<?php
 ob_implicit_flush(false);
 set_time_limit(30);
 require 'class/phpagi.php';
 error_reporting(E_ALL);

  $agi = new AGI();
  $agi->answer();
  $pay_date=strtotime("2007-08-14");         /* Proof of concept code */
  $agi->exec("SayUnixTime $pay_date||bdY");  
  $agi->hangup();
?>


When playing August 14, 2007, "august" has been chopped off and you will hear only the audible "14" "2007" sound

a hack for this atm is to insert $agi->stream_file("silence/1"); before calling
the SayUnixTime * apps

/* This is a workaround */

#!/usr/bin/php -q
<?php
 ob_implicit_flush(false);
 set_time_limit(30);
 require 'class/phpagi.php';
 error_reporting(E_ALL);

  $agi = new AGI();
  $agi->answer();
  $pay_date=strtotime("2007-08-14");         /* Proof of concept code */
  $agi->stream_file("silence/1");
  $agi->exec("SayUnixTime $pay_date||bdY");  
  $agi->hangup();
?>

latency is not a problem at all since the latency between the nat UAC to UAS is 40 ms with 0% packet loss codec involve gsm, uac is ekiga softphone

this is reproducible even without the agi script

I hope i made myself clear on this.



****** ADDITIONAL INFORMATION ******

URL: http://svn.digium.com/svn/asterisk/branches/1.4
Repository UUID: 614ede4d-c843-0410-af14-a771ab80d22e
Revision: 118298
Node Kind: directory
Schedule: normal
Last Changed Author: tilghman
Last Changed Rev: 118251
Last Changed Date: 2008-05-26 00:02:04 +0800 (Mon, 26 May 2008)
Properties Last Updated: 2008-05-16 09:31:48 +0800 (Fri, 16 May 2008)
Comments:By: Joshua C. Colp (jcolp) 2008-05-27 07:31:23

Please provide an rtp debug and console output with this. Is the remote side behind NAT?

By: Ronald Chan (loloski) 2008-05-27 09:48:27

please see attached files for details, thanks

By: Ronald Chan (loloski) 2008-05-27 09:51:53

venus@venus:~$ ping 222.126.47.50
PING 222.126.47.50 (222.126.47.50) 56(84) bytes of data.
64 bytes from 222.126.47.50: icmp_seq=1 ttl=58 time=49.0 ms
64 bytes from 222.126.47.50: icmp_seq=2 ttl=58 time=48.8 ms
64 bytes from 222.126.47.50: icmp_seq=3 ttl=58 time=48.1 ms
64 bytes from 222.126.47.50: icmp_seq=4 ttl=58 time=48.6 ms
64 bytes from 222.126.47.50: icmp_seq=5 ttl=58 time=48.8 ms
64 bytes from 222.126.47.50: icmp_seq=6 ttl=58 time=48.9 ms

--- 222.126.47.50 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5000ms
rtt min/avg/max/mdev = 48.155/48.752/49.055/0.323 ms
venus@venus:~$

By: Ronald Chan (loloski) 2008-05-27 09:53:38

the uac is behind a nat, while the uas * is on the public ip address

By: Joshua C. Colp (jcolp) 2008-05-27 10:06:25

So as soon as an audio packet from the UAC reaches Asterisk you then begin hearing the audio that Asterisk is sending?

By: Ronald Chan (loloski) 2008-05-27 10:38:24

no, i don't send any audio from uac to uas yet, if you check the code snip above,
once you call the server, * is supposed to play August 14, 2007 prompt then hangup the call, but the problem is no matter what i do i just heard only 14, 2007 sound, the word "august" was chopped off.

Playing silence/1 then executing SayUnixTime apps remedy my situation. that's why i came out on a conclusion that RTP was delayed. i might be wrong too but that's what i really heard on ekiga phone.

By: Joshua C. Colp (jcolp) 2008-05-27 10:42:52

It's not delayed, at least not from Asterisk. You can clearly see it sending packets to your phone. What I'm thinking is happening is that until you send a packet to Asterisk your router/NAT setup is discarding incoming packets, causing audio to be lost.

By: Ronald Chan (loloski) 2008-05-27 10:45:01

AGI Script Executing Application: (SayUnixTime) Options: (1187020800||bdY)
   -- <SIP/5-09c65998> Playing 'digits/mon-7' (language 'en') /* This is the part i don't heard being played */

   -- <SIP/5-09c65998> Playing 'digits/h-14' (language 'en') /* OK */
   -- <SIP/5-09c65998> Playing 'digits/2' (language 'en')    /* OK */
   -- <SIP/5-09c65998> Playing 'digits/thousand' (language 'en') /* OK */
   -- <SIP/5-09c65998> Playing 'digits/7' (language 'en') /* OK */

By: Joshua C. Colp (jcolp) 2008-05-27 10:48:53

Look at the rtp.txt file you attached, it clearly shows Asterisk sending RTP packets to your IP address and port. Why don't you do a tcpdump/wireshark trace to see them actually leaving, and then a tcpdump/wireshark on the system where the softphone is to see if they are making it there.

By: Ronald Chan (loloski) 2008-05-27 10:57:48

ok, i'll do that, i forgot to mention that my linux desktop is on 802.11g this might cause the problem behind a wrt54g router, i will try to setup a linux router for this purpose maybe tomorrow to check if this is the culprit, i'll let you know asap so that we can close this report. thank you very much for your time

Best regards,

Ronald

By: Ronald Chan (loloski) 2008-05-27 22:27:48

this case can be closed, this turn out to be an ekiga softphone issue thanks for your time file.

By: Joshua C. Colp (jcolp) 2008-05-28 07:43:51

Closed per reporter.