Error while upgrading Asterisk to 14 - PJSIP uneclared
I am trying to upgrade asterisk 11 to 14 on Debian (8.7) and I got the following error when I do the install.
Error below
res_pjsip_transport_management.c: In function ‘monitored_transport_state_callback’:
res_pjsip_transport_management.c:190:8: error: ‘PJSIP_TP_STATE_SHUTDOWN’ undeclared (first use in this function)
case PJSIP_TP_STATE_SHUTDOWN:
^
res_pjsip_transport_management.c:190:8: note: each undeclared identifier is reported only once for each function it appears in
/root/asterisk-14.3.0/Makefile.rules:149: recipe for target 'res_pjsip_transport_management.o' failed
make[1]: *** [res_pjsip_transport_management.o] Error 1
Makefile:401: recipe for target 'res' failed
make: *** [res] Error 2
The commands I have used are as follows:
tar -zxvf asterisk-14-current.tar.gz
/etc/init.d/asterisk stop
cd asterisk-14.3.0/
./configure
rm -f /usr/lib/asterisk/modules/*
make install
I tried some solutions from the internet and it didn't fix ...
source to share
It looks like the pjsip versions don't match (maybe more than one version installed), so you want to remove all previous / existing PJSip versions. If you don't know which packages pjsip owns, you can search for them via:
apt-cache search pjsip
or
dpkg -l | grep pj
And once you know which package to remove
apt-get --purge remove <package name>
Then you want to download the latest version of pjsip (the current 2.6 according to the Asterisk site)
wget wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2
tar -xjvf pjproject-2.6.tar.bz2
You want to put pjproject in / usr / local.
cp -R pjproject-2.6 /usr/local/
Once this is done you must build / compile / install pjproject and
./configure --prefix=/usr --enable-shared CFLAGS='-O2 -DNDEBUG' //Various options (enable/disable) can be put in here. Please refer to manual
make dep
make
make install
ldconfig
Make sure pjproject is installed in target location
ldconfig -p | grep pj
Once that is done, you can navigate to the Asterisk folder and issue
./configure
and continue the installation further:
source to share
If I am not mistaken, Asterisk 13 source code comes with pjproject built in, but 14 will look for installed pjproject on the system.
Make sure it is installed (including the -dev or -devel packages containing headers) rather than trying to reconfigure the asterisk source.
./bootstrap.sh
./configure
make menuconfig
source to share