[OpenSIPS-Users] MediaProxy and redirected traffic question

Stylianos Papanastasiou stylianos at gmail.com
Tue Apr 5 21:54:36 CEST 2011


Hi everyone,

I am running opensips with mediaproxy and so the media traffic from my
two SIP terminals runs through an intermediate machine. Now, I want to
do some media traffic manipulation so I redirect the incoming traffic to
some port on the intermediate machine using iptables. Assuming my
terminals are 10.0.0.2 and 10.0.0.3 and the media-proxy is 10.0.0.1 -
and the video traffic comes from port 9078 from both terminals I give:

iptables -t nat -A PREROUTING -i eth0  -p udp -s 10.0.0.2 --sport 9078
-j REDIRECT --to-port 40000
iptables -t nat -A PREROUTING -i eth0  -p udp -s 10.0.0.3 --sport 9078
-j REDIRECT --to-port 40001

Now, I can pick up the video streams at localhost:40000 and
localhost:40001 using gstreamer and manipulate it. However, if I try to
send a new video stream from the intermediate machine back to the
terminals (i.e. send rtp traffic from 10.0.0.1 to 10.0.0.2:9078 and
10.0.0.1:9078) something happens and I do not receive packets anymore in
either port 40000 or 40001 (but not both - one of them will provide
packets, the other one suddenly stops). I have monitored traffic with
wireshark and I know that both terminals keep providing me with video
rtp segments at all times - it is just that they do not show up in port
40000.

I believe my problems have something to do with conntrack but I am not
sure what to do. Could someone more knowledgeable offer an opinion?

Thanks,
Stelios





More information about the Users mailing list