rtpmixsound
rtpmixsound mixes pre-recorded audio in real-time with the audio in a specified target RTP stream. It spoofs RTP packets to inject the mixed audio into the live stream.
Description
rtpmixsound is a tool designed to mix pre-recorded audio files into live RTP audio streams over the network. It supports specific WAV file formats with constraints like mono channel, 8000 Hz sample rate, and PCM/uncompressed encoding, or tcpdump-formatted files containing G.711 u-law RTP/UDP/IP/ETHERNET packets. This enables real-time audio manipulation for testing or demonstration purposes in VoIP environments.
Use cases include injecting custom audio into ongoing RTP sessions, such as mixing sound effects or voices into conference calls or media streams. The tool targets specific source and destination IP/port combinations, allowing precise control over the injection process. It handles packet timing, sequence numbers, and timestamps to blend spoofed packets seamlessly with legitimate traffic.
Operators must consider network interface selection and routing tables, as Linux may route spoofed packets differently than specified. Verbose output aids in monitoring the process, and parameters like spoof and jitter factors fine-tune packet generation and timing to avoid detection.
How It Works
rtpmixsound monitors a target RTP stream using libfindrtp with pcap filters for IP traffic. Upon detecting legitimate RTP packets from specified source/destination IP and ports, it generates spoofed RTP packets by mixing audio from the input file. It increments sequence numbers, adjusts timestamps based on payload length multiplied by spoof factor, and increments IP ID. Jitter factor controls transmission timing relative to the next expected legitimate packet, delaying output to mimic natural stream behavior. Packets are injected via the specified interface, supporting G.711 u-law or constrained WAV formats.
Installation
sudo apt install rtpmixsoundFlags
Examples
rtpmixsound /usr/share/rtpmixsound/stapler.wav -vrtpmixsound /path/to/audio.wav -i eth0rtpmixsound /path/to/tcpdump.pcap -a 192.168.1.100 -A 5004rtpmixsound /path/to/audio.wav -b 192.168.1.200 -B 5004 -vrtpmixsound /path/to/audio.wav -f 5 -j 50rtpmixsound /path/to/audio.wav -p 10rtpmixsound /path/to/audio.wav -h