I have an OpenSIPS server which listens on multiple IPs. If I route the calls back out to the next point, I want to ensure all signalling and media come from the IP the call originally landed on (I don't want the caller and callee to know each other's IP addresses).
I believe what I need for this something like RTPProxy.
My question is do I need one RTPProxy server per IP address, or can I route multiple IPs through a single server? Is there a better solution?
I'm going to try this myself, but I'm struggling to get the RTPProxy server running correctly (my ignorance rather than necessarily any issues with RTPProxy). I asked ahead of time just to see if anyone knew if I was wasting my time setting it up or not.
[UPDATE]
For anyone interested, this is how I got it working, though I'm not sure I want to run with this as the final solution. Needs more testing. For 2 IPs, with topology hiding and RTP proxying. Along with the answer below, I hope it helps someone.
Load the rtpproxy processes -
rtpproxy -l _your_public_ip_1_ -s udp:localhost:7722
rtpproxy -l _your_public_ip_2_ -s udp:localhost:7723
Then mod the kamailio.cfg file -
loadmodule "/usr/local/lib64/kamailio/modules/topoh.so"
modparam("topoh", "mask_key", "Your_key_here")
modparam("topoh", "mask_ip", "10.0.0.1")
The next bit creates two groups for RTP proxy - 1 & 2 -
#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "1 == udp:127.0.0.1:7722")
modparam("rtpproxy", "rtpproxy_sock", "2 == udp:127.0.0.1:7723")
then in the NAT section of the standard (shipped) config, you select which group to use in the proxying based on the IP the inbound call landed on. rtp_proxy_manage is a very high level version of the force_ and unforce_ commands. Basically it just fires up and does everything for you -
route[NATMANAGE] {
#!ifdef WITH_NAT
....
if($Ri=="X.X.X.1")
set_rtp_proxy_set("1");
if($Ri=="X.X.X.2")
set_rtp_proxy_set("2");
rtpproxy_manage("",$Ri);