A SIP-based music player with DTMF IVR control. Answer incoming calls automatically and play audio tracks to the caller. Control playback via DTMF tones or GUI.
- SIP Registration: Register to any SIP server
- Auto-Answer: Automatically answer incoming calls
- Audio Playback: Play WAV audio files to SIP calls
- DTMF Control: Control playback with DTMF tones (1/2/3/4)
- Multi-Session: Support multiple concurrent calls
- Bilingual UI: English and Chinese (Simplified) interface
- Import: Convert MP3/M4A/FLAC to WAV via ffmpeg
- Python: 3.12 or higher
- uv: Fast Python package installer (recommended)
- PJSIP: 2.16+ (with pjsua2 Python bindings)
- tkinter: GUI framework
- ffmpeg: For audio format conversion (optional, for import feature)
Choose your platform below for detailed setup instructions:
- Download Python 3.12+ from python.org
- During installation, check "Add Python to PATH"
- Verify installation:
python --version
tkinter is included with Python on Windows. Verify it works:
python -c "import tkinter; print('tkinter OK')"If you get an error, reinstall Python and ensure tcl/tk is selected.
Download and install Visual Studio Community:
- During installation, select "Desktop development with C++"
- Or install Build Tools for Visual Studio
- Download SWIG from swig.org
- Extract to a path without spaces (e.g.,
C:\swigwin) - Add SWIG to PATH:
- Press Win+R, type
sysdm.cpl - Go to Advanced → Environment Variables
- Add
C:\swigwintoPath
- Press Win+R, type
Verify:
swig -versionpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"-
Download PJSIP from pjsip.org or GitHub:
git clone https://github.com/pjsip/pjproject.git cd pjproject -
Configure and build:
cd pjproject python ./configure.py -
Open the generated solution in Visual Studio:
- For Visual Studio 2022:
pjsip-apps\build\vs2022\pjsua_vc2022.sln - Build the entire solution in Release mode
- For Visual Studio 2022:
-
Build SWIG Python bindings:
cd pjsip-apps\src\swig python setup.py build python setup.py install
For audio import feature:
- Download from ffmpeg.org
- Extract and add
binfolder to PATH
cd sip-player
# Create virtual environment
uv venv
# Activate virtual environment
.venv\Scripts\activate
# Install project in editable mode
uv pip install -e .Using Homebrew:
brew install python@3.12Or download from python.org.
Verify:
python3 --versionFor Homebrew Python:
brew install python-tk@3.12For official Python installer: tkinter is included. Verify:
python3 -c "import tkinter; print('tkinter OK')"If using pyenv, reinstall with tcl-tk support:
brew install tcl-tk
export LDFLAGS="-L$(brew --prefix tcl-tk)/lib"
export CPPFLAGS="-I$(brew --prefix tcl-tk)/include"
export PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig"
pyenv install 3.12.0brew install swig ffmpegcurl -LsSf https://astral.sh/uv/install.sh | sh# Clone PJSIP
git clone https://github.com/pjsip/pjproject.git
cd pjproject
# Configure with -fPIC for shared library
./configure CFLAGS="-fPIC"
# Build (5-10 minutes)
make dep && make
# Build SWIG Python bindings
cd pjsip-apps/src/swig
make
# Install pjsua2 module
cd python
python3 setup.py installVerify installation:
python3 -c "import pjsua2; print('pjsua2 OK')"cd sip-player
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate
# Install project in editable mode
uv pip install -e .Tested on Ubuntu/Debian and Fedora/RHEL.
# Install Python, tkinter, and build tools
sudo apt update
sudo apt install -y python3 python3-tk python3-venv python3-dev build-essential swig ffmpeg curl
# Install PJSIP dependencies
sudo apt install -y libssl-dev libsrtp2-dev libopus-dev libspeex-dev libgsm1-dev
# Clone and build PJSIP
git clone https://github.com/pjsip/pjproject.git
cd pjproject
./configure CFLAGS="-fPIC"
make dep && make
# Build SWIG Python bindings
cd pjsip-apps/src/swig
make
cd python
python3 setup.py install --user
# Verify
python3 -c "import pjsua2; print('pjsua2 OK')"# Install dependencies
sudo dnf install -y python3 python3-tkinter python3-devel gcc gcc-c++ make swig ffmpeg openssl-devel opus-devel speex-devel gsm-devel curl
# Clone and build PJSIP
git clone https://github.com/pjsip/pjproject.git
cd pjproject
./configure CFLAGS="-fPIC"
make dep && make
# Build SWIG Python bindings
cd pjsip-apps/src/swig
make
cd python
python3 setup.py install --user# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and navigate to project
cd sip-player
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate
# Install project in editable mode
uv pip install -e .# Activate virtual environment first (if not already activated)
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
# Run the application
python -m srcOr use the installed command:
sip-playerDuring a call, use DTMF tones to control playback:
| Key | Action |
|---|---|
| 1 | Next track |
| 2 | Play/Pause |
| 3 | Cycle play mode |
| 4 | Previous track |
- Sequential - Play tracks in order, stop at end
- List Loop - Loop through all tracks
- Single Loop - Repeat current track
- Random - Shuffle playback
Settings are automatically saved to:
- Windows:
%APPDATA%\sip_player\settings.json - macOS:
~/Library/Application Support/sip_player/settings.json - Linux:
~/.config/sip_player/settings.json
Imported audio files are stored in:
- Windows:
%LOCALAPPDATA%\sip_player\imported_tracks\ - macOS:
~/Library/Application Support/sip_player/imported_tracks/ - Linux:
~/.local/share/sip_player/imported_tracks/
"build.mak: No such file or directory"
- Ensure you ran
./configureandmake dep && makein pjproject root
"pjsua2_wrap.cpp: No such file or directory"
- Run
makeinpjsip-apps/src/swigdirectory
"Cannot determine JDK include path"
- Safe to ignore if you only need Python bindings
If using pyenv, reinstall Python with tcl-tk support (see Step 2 above).
- Ensure Visual Studio with C++ tools is installed
- Run commands from x64 Native Tools Command Prompt
- Verify SWIG is in PATH
"Module not found" errors
- Ensure virtual environment is activated before running
- Reinstall with
uv pip install -e .
uv command not found
- Close and reopen terminal after installing uv
- Or add uv to PATH manually
MIT License - see LICENSE file.