+
+ # Only install libsrtp if it wasn't installed via package
+ if ! test -f /usr/include/srtp/srtp.h; then
+ echo "*** Installing libsrtp ***"
+ if [ ! -d libsrtp ]; then
+ git clone https://github.com/cisco/libsrtp.git
+ cd libsrtp
+ else
+ cd libsrtp
+ git pull
+ fi
+ ./configure CFLAGS=-fPIC && make libsrtp.a && make uninstall && make install
+ cd ..
+ echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local.conf
+ /sbin/ldconfig
+ fi
+
+ # Only install pjproject if it wasn't installed via package
+ if ! test -f /usr/include/pjlib.h; then
+ echo "*** Installing pjproject ***"
+ if [ ! -d pjproject ]; then
+ git clone https://github.com/asterisk/pjproject.git
+ cd pjproject
+ else
+ cd pjproject
+ git pull
+ fi
+ ./configure --enable-shared --with-external-speex --with-external-gsm --with-external-srtp --disable-sound --disable-resample && make && make install
+ cd ..
+ echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local.conf
+ /sbin/ldconfig
+ fi