rtpinsertsound
rtpinsertsound inserts audio into a specified RTP stream by spoofing packets. It supports mixing WAV files or tcpdump captures into live audio streams.
Description
rtpinsertsound is a tool designed to insert audio into a targeted live RTP audio stream. Created in August-September 2006, it was initially tested on Linux Red Hat Fedora Core 4 but is expected to work across various Linux distributions. The tool allows users to inject custom audio, such as a stapler sound, into ongoing RTP streams for testing or demonstration purposes.
Use cases include network audio manipulation, VoIP stream testing, and RTP protocol analysis. It requires a mono 8000 Hz WAV file or a tcpdump file with G.711 u-law RTP/UDP/IP/ETHERNET packets. Users must specify the audio file path and can target specific interfaces, IPs, and ports.
The tool handles multiple network interfaces carefully, as Linux routing may direct spoofed packets differently, potentially causing loops if packets return via the specified interface.
How It Works
rtpinsertsound captures legitimate RTP packets from the target stream using libpcap with an 'ip' filter. It spoofs new packets by incrementing sequence numbers, adjusting timestamps based on payload length multiplied by spoof factor, and incrementing IP ID. Jitter factor controls transmission timing relative to the next legitimate packet, delaying output to mimic stream timing (e.g., G.711 at 20ms intervals). Audio from WAV (PCM mono 8/16-bit 8000Hz) or tcpdump (G.711 u-law RTP) is mixed into the stream, output via raw sockets on the specified interface.
Installation
sudo apt install rtpinsertsoundFlags
Examples
rtpinsertsound /usr/share/rtpinsertsound/stapler.wav -vrtpinsertsound /path/to/audio.wav -i eth0rtpinsertsound /path/to/tcpdump.pcap -a 192.168.1.100 -A 5004rtpinsertsound audio.wav -b 10.0.0.1 -B 5004 -i eth1rtpinsertsound sound.wav -f 5 -j 50 -vrtpinsertsound file.wav -p 10rtpinsertsound /usr/share/rtpinsertsound/stapler.wav -h