NAT traversal
Symmetric latching learns each party's real address from the first packet it sends, so calls work through NAT and firewalls without client changes.
RTPProxy is a fast, battle-tested RTP proxy for VoIP networks. It handles NAT traversal, bridges IPv4 and IPv6, lets WebRTC clients talk to plain SIP endpoints, and records, forks and injects media on demand. OpenSIPS, Kamailio or Sippy B2BUA drive it over a simple control protocol.
# start a relay with a control socket
$ rtpproxy -f -l 203.0.113.10 -s unix:/var/run/rtpproxy.sock
# INVITE: create a session for the caller
> U a84b4c76e66710 198.51.100.7 49170 as8d7f
< 35012 203.0.113.10
# 200 OK: look up the session for the callee
> L a84b4c76e66710 192.0.2.44 51372 as8d7f 9fxced76
< 35014 203.0.113.10
# media now flows through 203.0.113.10
Capabilities
One small daemon covers NAT traversal, call recording and WebRTC. Load modules for what you need and leave the rest out.
Symmetric latching learns each party's real address from the first packet it sends, so calls work through NAT and firewalls without client changes.
The dtls_gw and ice_lite modules bridge plain RTP and DTLS-SRTP, answer ICE connectivity checks and multiplex RTCP, so browsers can talk to legacy SIP gear.
Record sessions to local files or stream copies to remote listeners in real time, a natural fit for SIPREC recorders and live transcription.
Inject pre-encoded announcements and music on hold into live streams, re-frame RTP payloads and detect DTMF digits on the fly.
Bridge media between address families and between any number of labeled interfaces, with separate advertised addresses for NAT-ed deployments.
Per-session and per-instance counters, RTCP reporting to HEP / Homer collectors and CSV accounting give you full visibility into media quality.
A simple text control protocol over Unix, UDP or TCP sockets lets SIP proxies drive many instances for load balancing and failover, or use RTP Cluster for large deployments.
librtpproxy runs multiple independent instances inside your own process. RTP.io uses it to put the RTPProxy straight into OpenSIPS, and Python applications such as Sippy B2BUA can embed it too.
In production since 2003, continuously fuzzed and tested in CI, and distributed under the permissive two-clause BSD license.
How it works
When an INVITE arrives, your SIP proxy or B2BUA sends the call-id and the caller's media address to RTPProxy, which allocates a port pair and returns it. The controller rewrites the SDP to point at the proxy.
On the 200 OK, the controller looks up the same session for the callee and rewrites that SDP as well. Both parties now send media to RTPProxy.
RTPProxy relays packets both ways. It latches onto the real source address of each side, so endpoints behind NAT just work. Idle sessions expire automatically.
Get started
Use pre-built packages and container images, or build it from source. Then point your SIP server's rtpproxy module at the control socket.
# images on Docker Hub and ghcr.io, updated on every commit
docker run --rm --network host sippylabs/rtpproxy \
-l 203.0.113.10 -s udp:127.0.0.1:22222
# grab the .deb for your release from the GitHub release page
sudo apt install ./rtpproxy_*.deb
sudo systemctl enable --now rtpproxy.socket
sudo systemctl start rtpproxy.service
pkg install rtpproxy
sysrc rtpproxy_enable=YES
service rtpproxy start
git clone -b master https://github.com/sippy/rtpproxy.git
git -C rtpproxy submodule update --init --recursive
cd rtpproxy
./configure
make
sudo make install
Integrations
OpenSIPS
rtpproxy and rtp.io modules
Kamailio
rtpproxy module
Sippy B2BUA
Built-in media control
go-b2bua
go-b2bua
Go port of the Sippy B2BUA
SIPhon
SIPhon
SIP proxy & B2BUA with Python scripting
reSIProcate B2BUA
Legacy B2BUA
Need more scale? RTP Cluster load-balances many RTPProxy nodes behind a single control endpoint.
News
Ask questions on the mailing list, report bugs on GitHub, or send a pull request. Contributions are welcome.