Summary:ASTERISK-03629: RTP stack doesn't see incoming packets unless outgoing packet is sent
Reporter:Andrey S Pankov (casper)Labels:
Date Opened:2005-03-04 12:38:55.000-0600Date Closed:2005-03-31 14:46:26.000-0600
Versions:Frequency of
Environment:Attachments:( 0) sip_rtp.log.txt
Description:I attach a log with 'sip debug' and 'rtp debug' turned on with comments inline. tcpdump of the call shows clearly that RTP stream is started as expected after "183 Session Progress" but is not seen by Asterisk. I've tested the same configuration terminating call to a cisco ATA and everything was just fine. It seems like the problem exists only when signalling and media addresses differ.


Not sure about category... maybe SIP only related problem.
Comments:By: Andrey S Pankov (casper) 2005-03-04 12:41:54.000-0600

Asterisk is @a.b.c.d
SIP proxy is @p.r.s.t
Terminating gateway is @w.x.y.z

By: Brian West (bkw918) 2005-03-04 14:34:24.000-0600

get a sip debug too.


By: Kevin P. Fleming (kpfleming) 2005-03-05 22:13:39.000-0600

Are you absolutely 100% positive that you do not have _any_ sort of firewall running on the box where Asterisk is running? This sounds exactly like what a connection-tracking firewall would do... drop incoming packets until the outgoing packet establishes a "connection".

By: duaner (duaner) 2005-03-07 01:40:57.000-0600

If you're saying that you need to send a packet out first before receiving one from the remote party, then that's completely expected.  Most firewalls will not allow an inbound connection until a packet is first sent to the remote party (for UDP).  This is by design.  If you're using ICE, or something similar, it's recommended that all parties send a heart beat (or STUN) packet immediately upon connecting just for this reason.

By: Terry Wilson (twilson) 2005-03-07 12:10:03.000-0600

I was under the impression that Asterisk used the incoming RTP as a timing source for sending outbound RTP?  Is this not correct?  I've noticed this behavior when trying to do testing  with sipp <http://sipp.sourceforge.net> which can echo back any RTP that is sent to it for testing purposes.  No RTP is ever sent, because asterisk won't send RTP to something that doesn't first send it RTP (or so I've gathered).

Yeah, found this bounty listed on the wiki: http://www.voip-info.org/wiki-Asterisk+bounty+rtp+timing

edited on: 03-07-05 12:53

By: Kevin P. Fleming (kpfleming) 2005-03-07 15:17:47.000-0600

Yes, in general Asterisk does use the incoming RTP stream to clock the outgoing stream (except for music-on-hold and other related processes).

Since we haven't gotten a response from the original poster, we're going to assume for the moment that this is a firewall-related issue and close this bug in a few days without any other input.

By: Andrey S Pankov (casper) 2005-03-09 10:33:57.000-0600

This is 100% NOT firewall related.

The problem is only in Asterisk RTP stack and maybe SIP channel driver. As I mentioned in the description "tcpdump of the call shows clearly that RTP stream is started as expected after "183 Session Progress" but is not seen by Asterisk". This means that incoming RTP stream exists and RTP packets come to Asterisk box. But Asterisk does not see them unless outgoing packet is sent (please see sip_rtp.log.txt)!

By: Mark Spencer (markster) 2005-03-10 02:50:16.000-0600

Do you have an ethereal capture *from the asterisk box* (raw)?

By: Mark Spencer (markster) 2005-03-10 02:52:44.000-0600

Also, how do you determine that Asterisk "is not seeing" the RTP traffic?

By: Andrey S Pankov (casper) 2005-03-10 09:57:15.000-0600

Yes, my tcpdump (ethereal) capture is from the asterisk box.

I determined it by the absence of "Got RTP packet from..." messages and ast_waitfor() failures in WaitForSilence (please see the log attached with this report).

By: duaner (duaner) 2005-03-10 10:14:12.000-0600

I sounds like a firewall problem..  Just because you open a socket doesn't mean you're going to get data on it..  If you have to send data out before receving any data -- IT IS A FIREWALL PROBLEM. If you fire up ethereal, you will not see packets coming in. If that happens always with asterix, it should be modified to ALWAYS send a packet at the start of a conversation.  Just encode one frame of silence, or send a STUN packet.

By: Andrey S Pankov (casper) 2005-03-10 10:30:42.000-0600

duaner: If I fire up ethereal, I SEE PACKETS COMING IN. That's why this is NOT FIREWALL PROBLEM. Did you read my posts BTW? Did you read the description?

By: duaner (duaner) 2005-03-10 11:24:46.000-0600

I'd like to see the ethereal trace..I didn't get from your earlier posts that you saw RTP coming in..  You can post it here I believe.

By: Mark Spencer (markster) 2005-03-30 01:10:56.000-0600

Please test with latest CVS and again, please *attach* not only the sip debug (yes, an updated one would be nice) but also the actual ethereal capture of the traffic.

By: Kevin P. Fleming (kpfleming) 2005-03-31 14:46:18.000-0600

No response from original poster for 20 days; closing bug. Can be reopened with new evidence of the problem if it is reproducable.