Improve debugging of RTP ports (bug #2131, heavily modified)