Skip to content

oornnery/pyphone

Repository files navigation

PyPhone

TUI softhone using Python3 and PJSIP.

Getting Started

Pjproject guide to build PJSUA and PJSUA2: Guide

Install

Install dependencies (Ubuntu 22.04 LTS).

sudo apt update
sudo apt install swig build-essential python3-dev libasound2-dev \
    libssl3 libssl-dev ffmpeg libv4l-dev libv4l-0 \
    alsa-base alsa-oss libyuv0 libyuv-dev libsdl2-2.0-0 libsdl2-dev \
    libx264-163  libx264-dev

Build PJSIP.

./install.sh

Manual Build PJSIP

# Clone the pyphone repository
git clone https://github.com/oornnery/pyphone.git
cd pyphone
# Clone the pjproject repository
# git clone https://github.com/pjsip/pjproject.git
# unzip the pjproject
tar -xvf pjproject-2.14.1.tar.gz
cd pjproject-2.14.1
# Build PJSIP
./configure ./configure --disable-video --disable-v4l2 CFLAGS="-fPIC" CXXFLAGS="-fPIC"
make dep && make
sudo make install

Build PJSUA2 to python3.

# Build to python
cd pjsip-apps/src/swig/python
make
sudo make install
# Poetry alternative
# poetry add .

Test import pjsua to python firstly.

python3 -c "import pjsua2"

Settings and Configuration

Edit the .env file to configure you SIP credentials.

USERNAME=''
PASSWORD=''
DOMAIN=''
PORT=0

Running

python pyphone/_pjsip.py

References

About

Softphone by pjsip

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published