Skip to content

Instantly share code, notes, and snippets.

@SelectLOL1
Created October 20, 2025 16:42
Show Gist options
  • Select an option

  • Save SelectLOL1/ff99c6cb2c971ead64e60f3363dcf495 to your computer and use it in GitHub Desktop.

Select an option

Save SelectLOL1/ff99c6cb2c971ead64e60f3363dcf495 to your computer and use it in GitHub Desktop.
Install PJSUA2 linux (ubuntu/raspberry pi)

Setup

  • VENV erzeugen und aktivieren
sudo apt install python3.11 python3.11-venv python3.11-dev
python3.11 -m venv sipvenv
source sipvenv/bin/activate
  • swig installieren
sudo apt install swig libasound2-dev libssl-dev libv4l-dev libsdl2-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libx264-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libavutil-dev  libavcodec-extra libopus-dev libopencore-amrwb-dev libopencore-amrnb-dev libvo-amrwbenc-dev subversion libsrtp2-dev
  • PJSIP repo klonen
git clone https://github.com/pjsip/pjproject.git
  • PJSIP konfigurieren
cd pjproject
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-shared --with-external-srtp --enable-ext-sound
  • File config_site.h öffnen
nano pjlib/include/pj/config_site.h
  • diese Zeilen einfügen:
#include "config_site_sample.h"

#define PJ_HAS_TCP 1
  • PJSIP und PJSUA2 wrapper builden (im Ordner pjproject)
make dep && make
sudo make install
cd pjsip-apps/src/swig/python
make
make install
  • python package im Virtualenv (ohne SUDO in venv!) installieren mit folgendem Kommando:
python setup.py install
  • Library path anpassen:
echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/pjsip.conf
sudo ldconfig
  • Installation verifizieren:
python
>>> import pjsua2

Jack installieren

sudo apt install jackd2
jack_control start

VS Code

in .vscode/settings.json folgende Zeilen einfügen:

{
    "python.analysis.extraPaths": [
        "./Server/pjproject/pjsip-apps/src/swig/python"
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment