Search code examples
pythonsippjsip

failing pjsua python module


I try to use pjsua module for Python on Ubuntu 16.04. When I try to call AccountConfig, it will return with following error message:

>>> import pjsua
>>> t=pjsua.AccountConfig()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pjsua.py", line 802, in __init__
    self._cvt_from_pjsua(default)
  File "pjsua.py", line 859, in _cvt_from_pjsua
    for cred in cfg.cred_info:
MemoryError

Compiled pjsip with following:

sudo apt-get install build-essential python-dev libpjsua2
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
sudo rm -fr pjproject-2.7.2
tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-shared  --disable-sound  && make dep && make
cd pjsip-apps/src/python/
sudo python setup.py install

I would appreciate any idea, what am I doing wrong.


Solution

  • Compile with following solved the issue:

    sudo apt-get update
    sudo apt-get -y install build-essential python-dev libpjsua2 libssl-dev libasound2-dev
    wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
    tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
    export CFLAGS="$CFLAGS -fPIC"
    ./configure && make dep && make
    cd pjsip-apps/src/python/
    sudo python setup.py install