Summary:ASTERISK-18693: "rtp set debug ip" not work
Reporter:Davide Dal Frà (devil_evoxxx)Labels:
Date Opened:2011-10-08 11:53:15Date Closed:2011-11-28 08:38:13.000-0600
Versions: Frequency of
Environment:Asterisk Running on Debian 6 - Linux voip1 2.6.32-5-686-bigmem #1 SMP Fri Sep 9 21:28:24 UTC 2011 i686 GNU/Linux. 4Gb of Ram Available. The machine is virtualized on ESXi4.1.Attachments:( 0) issue18693.patch.v3
Description:In my scenario the voip server have public ip, and the phone connected to it is behind nat.

When i try to debug rtp stream, typing on asterisk cli the command: "rtp set debug ip", i cant see rtp streamon asterisk cli.
Cli say to me:
RTP Debugging Enabled for address:
Where is the ip (nat on 172.16.171.x private network) of the phone connected to the server.

I've try to dump packet with tcpdump and i can see the rtp stream, and particularly the port where rtp stream go on.
After that, i back to asterisk cli and i type in cli "rtp set debug ip" in this way i can see the rtp strem (1-way).

With asterisk 1.4.42 when i set "rtp debug ip ip-of-phone" i can see directly the rtp stream received and trasmitted to the specified ip.
P.s. asterisk 1.4.42 say: RTP Debugging Enabled for IP:   (note: no port is specified)

Davide Dal Frà
Comments:By: Robert Dailey (rdailey) 2011-10-08 12:00:44.607-0500

Having to first debug the media stream with another tool in order to find the port for debugging the media stream in Asterisk is very inconvenient.

By: Davide Dal Frà (devil_evoxxx) 2011-10-10 03:00:04.160-0500

Yes, is very inconvenient. A hint could be the ability to specify the port range, or as old version , without specifying port.

By: Leif Madsen (lmadsen) 2011-11-01 08:56:35.992-0500

Is the RTP stream actually going through Asterisk? Was it re-invited away from the Asterisk box and thus Asterisk can't see the RTP stream? I've used this command many times and never had this problem.

By: Robert Dailey (rdailey) 2011-11-01 09:33:40.080-0500

directmedia is set to no in my case.

By: Davide Dal Frà (devil_evoxxx) 2011-11-02 08:38:42.292-0500

Yes, the rtp stream goingo through Asterisk, i've seen it dumping packet on eth0. Both in my case directmedia is set to no.

By: Leif Madsen (lmadsen) 2011-11-03 13:47:59.139-0500

Confirmed. There is something going on here where it is trying to monitor just port zero and not any port. If you enable 'rtp set debug on' then you can definitely see RTP coming from the IP you're hoping to monitor, but if you specify the IP directly, then you get the <ip addr>:0 and that seems to be causing a problem.

I looked at the code to see if it was immediately obvious what to change, but I don't know enough of the internal workings of Asterisk to figure it out. You can use something like:

'rtp set debug ip' to just monitor RTP on pot 14000, but I don't really see where it is checking for a port.

Likely something changed with the way addresses are parsed, and this command wasn't updated to reflect that.

The changes done here likely need to be done for the rtcp cli command as well.

By: Stefan Schmidt (schmidts) 2011-11-28 04:49:18.605-0600

This patch removes the need to set a RTP port to enable rtp debugging for an ip.

best regards


By: Stefan Schmidt (schmidts) 2011-11-28 05:02:54.923-0600

sorry forgot about rtcp debug, its just the same problem ;)

By: Stefan Schmidt (schmidts) 2011-11-28 05:22:14.193-0600

and so a simple two lines patch becomes a little bit bigger but now the port is really optional and both options works as expected:


By: Stefan Schmidt (schmidts) 2011-11-28 06:14:43.252-0600

same code as on reviewboard

By: Stefan Schmidt (schmidts) 2011-11-28 08:38:13.328-0600

fixed in revision 346292

see review: https://reviewboard.asterisk.org/r/1600/

best regards