Problems With PJSIP Install On UBUNTU 14.04

Home » Asterisk Users » Problems With PJSIP Install On UBUNTU 14.04
Asterisk Users 34 Comments

I’ve built PJSIP a few months ago on a server that was 12.04 and can’t remember how I got past this same issue. I’ve looked at the links I’ll put below and the comments section where others had the issue, but those tips aren’t helping either.

Basically everything seems to compile and install correctly, but then the “ldconfig -p | grep pj” doesn’t show anything. So ldconfig when ran by itself isn’t picking up on the install of pjsip. Also when going into the process of menuselect it shows that it’s not available as a resource.

https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject

https://www.ringroost.com/blog/installing-asterisk-13-from-source-on-ubuntu-14/

34 thoughts on - Problems With PJSIP Install On UBUNTU 14.04

  • Ryan, Travis wrote:

    Do you have the pkg-config package installed? That is what the build system uses for finding the right stuff.

    Also what does the following show:

    ls /usr/lib/libpj*.so ls /usr/local/lib/libpj*.so

    And what did you pass to the configure script for pjproject?

  • [Ryan, Travis]
    travis@pcimphone1:~$ ls /usr/lib/libpj*.so ls: cannot access /usr/lib/libpj*.so: No such file or directory travis@pcimphone1:~$ ls /usr/local/lib/libpj*.so ls: cannot access /usr/local/lib/libpj*.so: No such file or directory travis@pcimphone1:~$ ls /usr/lib/libpj*.so lib/ lib64/
    travis@pcimphone1:~$ ls /usr/lib64/libpj*.so
    /usr/lib64/libpjlib-util.so /usr/lib64/libpjmedia-codec.so /usr/lib64/libpjmedia-videodev.so /usr/lib64/libpjsip-simple.so /usr/lib64/libpjsip-ua.so /usr/lib64/libpjsua2.so
    /usr/lib64/libpjmedia-audiodev.so /usr/lib64/libpjmedia.so /usr/lib64/libpjnath.so /usr/lib64/libpjsip.so /usr/lib64/libpj.so /usr/lib64/libpjsua.so

    As you can see it put them in the lib64 folder. I’ve done the command and recompiled so many times with the following attempts….

    ./configure –prefix=/usr –enable-shared –disable-sound –disable-resample –disable-video –disable-opencore-amr CFLAGS=’-O2 -DNDEBUG’
    ./configure
    ./configure –prefix=/usr
    ./configure –libdir=/usr/lib64 –prefix=/usr –enable-shared –disable-sound –disable-resample –disable-video –disable-opencore-amr

    [Ryan, Travis]

  • Now for some reason they are showing after running the usual .configure from the wiki. I swear to God it wasn’t working last night. SMH
    [Ryan, Travis]

  • Ok so now I’m getting this when doing a make in asterisk…

    travis@pcimphone1:~/downloads/asterisk-13.5.0$ make
    [LD] chan_pjsip.o pjsip/dialplan_functions.o -> chan_pjsip.so
    /usr/bin/ld: /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a(sip_inv.o): relocation R_X86_64_32S against `.rodata’ can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[1]: *** [chan_pjsip.so] Error 1
    make: *** [channels] Error 2

  • Ryan, Travis wrote:

    It has picked up an install of pjproject which was not built with
    “–enable-shared”. You need to remove all instances on your system to return it to a known state and then rebuild pjproject and install it.

    ./configure CFLAGS=”-DNDEBUG -DPJ_HAS_IPV6=1″ –enable-shared
    –with-external-speex –with-external-gsm –with-external-srtp
    –disable-sound –disable-resample –prefix=/usr

    Those are the options I use normally on Ubuntu 14.04.

  • Not really, that’s the exact configure line I use. You may have to do a
    “make distclean” on both pjproject and asterisk.

  • Getting constant segfaults now…

    [ 157.894809] asterisk[1424]: segfault at c ip 00007f8b2fbcfd04 sp 00007f8b91722010 error 4 in res_hep_pjsip.so[7f8b2fba2000+45000]
    [ 481.101031] asterisk[1581]: segfault at c ip 00007ff4805f0d04 sp 00007ff4ba438010 error 4 in res_hep_pjsip.so[7ff4805c3000+45000]
    [ 1151.182223] asterisk[1787]: segfault at c ip 00007f3a29ef7d04 sp 00007f3a7fdec010 error 4 in res_hep_pjsip.so[7f3a29eca000+45000]
    [ 1289.185181] asterisk[1974]: segfault at c ip 00007f039bb8ed04 sp 00007f03fda21010 error 4 in res_hep_pjsip.so[7f039bb61000+45000]
    [ 2434.066780] asterisk[2082]: segfault at c ip 00007ff49a69ad04 sp 00007ff4c7ffe010 error 4 in res_hep_pjsip.so[7ff49a66d000+45000]
    [ 2618.073360] asterisk[2390]: segfault at c ip 00007fb93f391d04 sp 00007fb9a11fd010 error 4 in res_hep_pjsip.so[7fb93f364000+45000]

  • You are linking to a *static* version of the PJPROJECT library. That is guaranteed to cause crashes. You must remove the static build of PJPROJECT from your system.

    Richard

  • DQpGcm9tOiBhc3Rlcmlzay11c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb20gW21haWx0bzph c3Rlcmlzay11c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb21dIE9uIEJlaGFsZiBPZiBSaWNo YXJkIE11ZGdldHQNClNlbnQ6IFdlZG5lc2RheSwgU2VwdGVtYmVyIDIzLCAyMDE1IDY6NTIgUE0N
    ClRvOiBBc3RlcmlzayBVc2VycyBNYWlsaW5nIExpc3QgLSBOb24tQ29tbWVyY2lhbCBEaXNjdXNz aW9uDQpTdWJqZWN0OiBSZTogW2FzdGVyaXNrLXVzZXJzXSBwcm9ibGVtcyB3aXRoIFBKU0lQIGlu c3RhbGwgb24gVUJVTlRVIDE0LjA0DQoNCg0KDQpPbiBXZWQsIFNlcCAyMywgMjAxNSBhdCA1OjQz IFBNLCBSeWFuLCBUcmF2aXMgPFJ5YW5UQG9zY2Fyd2luc2tpLmNvbTxtYWlsdG86UnlhblRAb3Nj YXJ3aW5za2kuY29tPj4gd3JvdGU6DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4g RnJvbTogYXN0ZXJpc2stdXNlcnMtYm91bmNlc0BsaXN0cy5kaWdpdW0uY29tPG1haWx0bzphc3Rl cmlzay11c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb20+IFttYWlsdG86YXN0ZXJpc2stdXNl cnMtPG1haWx0bzphc3Rlcmlzay11c2Vycy0+DQo+IGJvdW5jZXNAbGlzdHMuZGlnaXVtLmNvbTxt YWlsdG86Ym91bmNlc0BsaXN0cy5kaWdpdW0uY29tP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W92ZSB0aGUgc3RhdGljDQpidWlsZCBvZiBQSlBST0pFQ1QgZnJvbSB5b3VyIHN5c3Rl bS4NCg0KUmljaGFyZA0KDQpbUnlhbiwgVHJhdmlzXQ0KSeKAmW0gbm90IHN1cmUgd2hhdCB0aGF0
    IG1lYW5zLiAgSSBqdXN0IGJ1aWx0IGl0IGhvdyB0aGUgd2lraSBzYXlzIHRvbywgYW5kIGVhcmxp ZXIgbWVzc2FnZXMgaW4gdGhpcyB0aHJlYWQuIOKYug0KDQo

  • The instructions also say you must remove any other built installations of the PJPROJECT
    because they are likely static libraries (*.a libraries). The linker is finding the static library first.

    Richard

  • It means not all instances of PJSIP were removed from your system before rebuilding and installing it. It could also mean that you had old Asterisk modules installed and did not remove them before installing the new Asterisk. Essentially res_hep_pjsip is using a self contained copy of PJSIP which is in an undefined state.

  • [Ryan, Travis]
    I ran all the uninstall commands and the rm commands. Made sure that ldconfig -p had no pj stuff in it.

    That’s not enough? What did I miss?

    Thanks

  • “make uninstall” uses the configure parameters. You can do:

    updatedb locate libpj

    To find all remaining libraries.

    You should also ensure old Asterisk modules don’t exist by doing rm -rf
    /usr/lib/asterisk/modules

    And re-running make install in Asterisk afterwards

  • Same problem. Asterisk was built against static instead of shared. What’s the output of:

    ls -al /usr/lib/libpj*
    pkg-config –libs libpjproject

    And from the pjproject source directory:
    grep “aconfigure” config.status

  • I could bet it could be something in pkg-config. How do I get that to reset? I never changed anything in there.

    —–Original Message—

  • Your pkg-config file is specifying /usr/local/lib – are there any remaining libpj files in there?

    ls -al /usr/local/lib/libpj*.so ls -al /usr/local/lib/libpj*.a

  • Ryan, Travis wrote:

    You can delete libpjproject.pc from the places it currently exists and then reinstall pjproject. That should put a proper pkg-config file in. Then doing a make distclean and make of Asterisk may work.

  • Did something change DB-wise with PJSIP and realtime between 13.3.2 and 13.5.0? I’m getting an unknown column error and unsure where I need that column and the type it needs to be.

    Thanks!

    [Sep 24 15:32:41] — Attempted to remove non-existent contact ‘sip:312@10.1.1.201:5060’ from AOR ‘312’ by request
    [Sep 24 15:33:53] WARNING[27948]: res_odbc.c:649 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.5.44-0ubuntu0.14.04.1]Unknown column ‘qualify_timeout’ in ‘field list’ (104)
    [Sep 24 15:33:53] WARNING[27948]: res_odbc.c:661 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to pcim [pcim]…
    [Sep 24 15:33:53] WARNING[27948]: res_odbc.c:765 ast_odbc_sanity_check: Connection is down attempting to reconnect…
    [Sep 24 15:33:58] NOTICE[27948]: res_odbc.c:1528 odbc_obj_connect: Connecting pcim
    [Sep 24 15:33:58] NOTICE[27948]: res_odbc.c:1567 odbc_obj_connect: res_odbc: Connected to pcim [pcim]
    [Sep 24 15:33:58] WARNING[27948]: res_odbc.c:649 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.5.44-0ubuntu0.14.04.1]Unknown column ‘qualify_timeout’ in ‘field list’ (104)
    [Sep 24 15:33:58] WARNING[27948]: res_odbc.c:661 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to pcim [pcim]…
    [Sep 24 15:33:58] WARNING[27948]: res_odbc.c:765 ast_odbc_sanity_check: Connection is down attempting to reconnect…
    [Sep 24 15:34:03] NOTICE[27948]: res_odbc.c:1528 odbc_obj_connect: Connecting pcim
    [Sep 24 15:34:03] NOTICE[27948]: res_odbc.c:1567 odbc_obj_connect: res_odbc: Connected to pcim [pcim]
    [Sep 24 15:34:03] ERROR[27948]: res_pjsip_registrar.c:504 rx_task: Unable to bind contact ‘sip:312@10.1.1.201:5060’ to AOR ‘312’

  • will cause alembic to upgrade the tables.

    No idea, alembic is not something we wrote and I’m not that familiar with it.