Asterisk Now Available With Bundled Pjproject!

Home » Uncategorized » Asterisk Now Available With Bundled Pjproject!
Uncategorized 8 Comments

The current Asterisk 13 and master git branches have a new feature that will be included in 13.8.0: The ability to compile and run Asterisk with a bundled version of pjproject.
​​

Why would you want to do this? Several reasons:

– Predictability: When built with the
​bundled
pjproject, you’re always certain of the version you’re running against,
no matter where it’s installed.
– Scalability: The default pjproject configuration is optimized for
client applications. The bundled version’s configuration is optimized for
server use.
– Usability: Several feature patches, which have been submitted
upstream to pjproject but not yet released, have been included in the
bundled version.
– Safety: If a security or critical issue is identified in pjproject,
it can be patched and made available with a new release of Asterisk instead
of
​having to ​
waiting for a new release of pjproject
​​
.
– Maintainability: You don’t need to build and install separate
packages.
– Supportability: When asking others for help, there’s no question
about which version of pjproject you’re using and what options it was
compiled with.
– Compatibility: This is especially important from a development
perspective because it means we can be sure that new pjproject APIs that
have been introduced
​,​
or old ones that have been deprecated
​,​
are handled and tested appropriately in Asterisk.
– Reliability: You can be sure that Asterisk was tested against the
bundled version.

So now that you’re sold, here’s how you use it:

All you have to do is add the “–with-pjproject-bundled” option to your
./configure command line and remove any other “–with-pjproject” option you may have specified. The configure and make processes will download the correct version of pjproject, patch it, configure it, build it and finally link Asterisk to it statically. No changes in runtime configuration are required.

Still not sold? The default behavior hasn’t changed so as long as you haven’t specified “–with-pjproject-bundled”, your build and deploy process remains as is.

PLEASE TRY THIS!! I’d love some feedback BEFORE 13.8.0 is released.

8 thoughts on - Asterisk Now Available With Bundled Pjproject!

  • –LjwiMpDVxtaiToe87xu9UejDuMo4jVv4h Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Hi,

    Le 07/03/2016 09:28, George Joseph a écrit :

    I have tried GIT-master-ee5a944M on my Fedora 23 test server, and got:

    [pjproject] Unpacking /tmp/pjproject-2.4.5.tar.bz2
    [pjproject] Applying patches and custom files
    [pjproject] Configuring with –prefix=/opt/pjproject
    –with-external-speex –with-external-gsm –with-external-srtp
    –with-external-pa –disable-video –disable-v4l2 –disable-sound
    –disable-resample –disable-opencore-amr –disable-ilbc-codec
    –without-libyuv –disable-g7221-codec –enable-epoll aconfigure: error: Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS
    env var to set the include/lib paths Makefile:57: recipe for target ‘build.mak’ failed make: *** [build.mak] Error 1
    failed

    So I installed portaudio-devel (it was not needed before), and then compilation / installation were ok. When restarting Asterisk, SELinux blocked an access to /usr/bin/portaudio.

    Can’t we simply disable portaudio? I have changed –with-external-pa to
    –disable-pa in third-party/pjproject/Makefile.rules, and it seems to compile / work fine.

    I have a question for servers without Internet access : is it enough to copy pjproject-2.4.5.tar.bz2 to /tmp or will there be other dependencies?

    I made a couple of test calls without problem (with or without portaudio).

    Thanks for your work,

  • ​Good catch on PortAudio. I’ll add the –disable-pa,​

    ​No other dependencies. Putting it in /tmp should be fine.​

    ​Thanks for testing!​

  • –G9J4B2uhiSTfL04B1EBcFFTRkLg437u7K
    Content-Type: text/plain; charset=windows-1252
    Content-Transfer-Encoding: quoted-printable

    Hi George,

    Le 07/03/2016 12:53, George Joseph a

  • This is one of the best ideas you could have. Especially with Debian as the underlying distribution, the default libraries are quite old in many cases. I had to download and compile recent versions of pjsip, spandsp and a bunch of other libraries before being able to compile and use recent Asterisk versions.

    The other arguments you have named (safety and so on) are equally important.

    Since I have begun using Asterisk, I even have wished you could bundle *all* external libraries and components that way (just dreaming – I think there are several dozens or even hundreds of them).

    Regards and thanks,

    Recursive

  • Right now I use the install_prereq script to install PJSIP
    dependencies and I have automated the process. Will you be removing the PJSIP related dependencies from this script to avoid conflitcs with the new included version?


    Telecomunicaciones Abiertas de México S.A. de C.V. Carlos Chávez dCAP #1349
    +52 (55)9116-91161

  • ​Thanks for the feedback!​

    Yep, there are a number of them and it wouldn’t be practical to include them all. The reason pjproject made sense to bundle was that it’s a highly complex and very specific library that we depend on. In fact, Asterisk references almost 500 different pjproject functions or data structures. 🙂

  • Good question. I’m going to remove the code in install_prereq that downloads and installs it from source this week. I’ll leave the package install for a while. At least until there’s good acceptance of the change.

  • –6SGdX3mBVMDnEFmebQujxbEgbxutWICED
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    Hi George,

    It seems configure with –disable-pa, and configuration “#define PJSIP_MAX_PKT_LEN 6000” did not make it to 13.8.0-rc1, do you still intend to add include these modifications?

    Thanks,