If you use RTPProxy, you need one RTPProxy server for each IP address. You can specify the IP to listen with the '-l' parameter:
# /usr/sbin/rtpproxy -l 10.10.10.10 -s unix:/var/run/rtpproxy/rtpproxy1.sock -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy1.pid &
You will need to match this with independent instances of opensips / openser / kamailio:
listen=udp:10.10.10.10:5060 ... loadmodule "rtpproxy.so" modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy1.sock") ... unforce_rtp_proxy(); ... force_rtp_proxy();
and
listen=udp:10.10.10.11:5060 ... loadmodule "rtpproxy.so" modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy2.sock") ... unforce_rtp_proxy(); ... force_rtp_proxy();
If you have experience with C, you may be modifying the rtpproxy module to be aware of multiple rtpproxy instances.
In addition, if the thought of relaying RTP through user space bothers you, MediaProxy is an alternative.
Instead of a user space demonstrator transmitting RTP traffic, your openser / opensips / kamailio tells python MediaDispatcher via a JSON web message to contact an available MediaRelay to configure the linux kernel level conntrack traffic forwarding record.
The disadvantage of this approach is that the current python media dispatcher and the reading media relay /etc/mediaproxy/config.ini - you need to hack python to accept the configuration parameter so that you can have multiple configurations. ini, one for each instance, to configure the correct redirection.
An example / etc / mediaproxy / config.ini might look like this:
[Relay] dispatchers = 10.10.10.10:25060 [Dispatcher] socket_path = /var/run/mediaproxy/dispatcher.sock listen = 10.10.10.10:25060 listen_management = 10.10.10.10:25061 [OpenSIPS] socket_path = '/var/run/opensips/socket'
And in your opensips configuration file:
modparam("mi_datagram", "socket_name", "/var/run/opensips/socket") ... loadmodule "mediaproxy.so" # ----- mediaproxy params ----- modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock") #modparam("mediaproxy", "disable", 1) #modparam("mediaproxy", "natping_interval", 60) ... engage_media_proxy(); ... end_media_session();
It looks like you might be lucky with rtpproxy for your specific needs.