Version 15 (modified by ismangil, 15 years ago) (diff)


Build and Installation

Getting the Modules

Currently we only distribute source codes and not binaries.

The Python modules source codes along with some samples are included in PJSIP distribution, in pjproject/pjsip-apps/src/python directory. No separate download is needed.

Building The Modules From the Source

Linux (and probably Unix in general)


  1. The usual requirements to build PJSIP, e.g. make, gcc, and binutils.
  2. Python: this normally should have been installed on every Linux.
  3. Python development package, to build the C extension. This might be called python-devel (e.g. on Fedora) or python2.4-dev or python2.5-dev (e.g. on Ubuntu).

Building the Module

Using Python build script:

  1. Build the PJSIP libraries first with the usual "./configure && make dep && make" commands.
  2. Go to pjsip-apps/src/python directory.
  3. Run 'sudo python ./ install' or just 'sudo make'

Sample session:

   $ cd your-pjsip-root-dir
   $ ./configure && make dep && make
   $ cd pjsip-apps/src/python
   $ sudo make



We tested this on MacOS X 10.5.3 (Leopard), using the built-in Python installation. There don't seem to be any specific requirements (except the usual gcc, make, and binutils, which should have been installed by default).

Building the Module

The build instructions should be similar to the Linux instructions. Open Terminal from Application/Utilities/Terminal?, and run this:

   $ cd your-pjsip-root-dir
   $ ./configure && make dep && make
   $ cd pjsip-apps/src/python
   $ sudo make

Microsoft Windows with Visual Studio


  1. The usual PJSIP requirements for Windows, e.g. Visual Studio along with Platform SDK and DirectX SDK.
  2. Python SDK: I personally use ActivePython-2.4.3-12 distribution from ActiveState, since it has a matching debug package.
  3. Optional: debug package: the debug package is useful if you want to debug the C extension. You can download it from

Building the Modules

Step 1: Building the C Extension:

  1. Open pjsip-apps.dsw from pjsip-apps\build directory.
  2. Select python_pjsua project as the active project.
  3. Build the project
  4. The _pjsua.pyd Python module will be placed in pjsip-apps\lib directory.

Step 2: Installing the Modules:

  1. Open Command Prompt
  2. Go to pjsip-apps\src\python directory
  3. Run python install (note that the installation script is and not

Sample session:

C:> cd your-pjsip-root-directory
C:> cd pjsip-apps\src\python
C:> python install

Microsoft Windows with MinGW

I did not try this myself since I use Visual Studio, but Adamczak Krzysztof suggested this on PJSIP mailing list to build the extensions with MinGW:

 python build_ext --compiler=mingw32 install

Common Problems

Cannot open include file: 'Python.h'

You need to install Python SDK.