How to – Patch Asterisk 16 or 18 for ViciDial
In this article, I will go over how to patch newer versions of Asterisk that can be used with ViciDIal. Copy and paste the lines of code that have to do with the version of Asterisk you plan to use.
Step 1 – Download the needed files for Asterisk and the patches from ViciDial
cd /usr/src/asterisk
wget https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-16.30.0.tar.gz
wget https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-18.18.1.tar.gz
tar -xzvf asterisk-16.30.0.tar.gz
tar -xzvf asterisk-18.18.1.tar.gz
cd /usr/src/asterisk/asterisk-16.30.0
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/amd_stats.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/iax2_peer_status.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/sip_logging_peer_status.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/timeout_reset_dial.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/timeout_reset_dial_app.patch
cd apps/
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/enter.h
wget http://download.vicidial.com/asterisk-patches/Asterisk-16/leave.h
yes | cp -rf enter.h.1 enter.h
yes | cp -rf leave.h.1 leave.h
cd /usr/src/asterisk/asterisk-18.18.1/
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/amd_stats-18.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/iax_peer_status-18.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/sip_peer_status-18.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/timeout_reset_dial_app-18.patch
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/timeout_reset_dial_core-18.patch
cd apps/
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/enter.h
wget http://download.vicidial.com/asterisk-patches/Asterisk-18/leave.h
yes | cp -rf enter.h.1 enter.h
yes | cp -rf leave.h.1 leave.h
Step 2 – Apply the patches to the version you chose to use
Now that we’ve got the files, lets begin patching them as shown below. After applying each patch, copy and paste the location shown below each patch line.
Asterisk 16 patches
patch < amd_stats.patch apps/app_amd.c
patch < iax2_peer_status.patch channels/chan_iax2.c
patch < sip_logging_peer_status.patch channels/chan_sip.c
patch < timeout_reset_dial_app.patch apps/app_dial.c
patch < timeout_reset_dial.patch main/dial.c
Asterisk 18 patches
patch < amd_stats-18.patch apps/app_amd.c
patch < iax_peer_status-18.patch channels/chan_iax2.c
patch < sip_peer_status-18.patch channels/chan_sip.c
patch < timeout_reset_dial_app-18.patch apps/app_dial.c
patch < timeout_reset_dial_core-18.patch main/dial.c
Step 3 – Compile Asterisk
Now to compile Asterisk after applying the necessary patches. Copy and paste the desired Asterisk version code.
Asterisk 16
cd /usr/src/asterisk/asterisk-16.30.0/
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
./configure --libdir=/usr/lib64 --with-gsm=internal --enable-opus --enable-srtp --with-ssl --enable-asteriskssl --with-pjproject-bundled --with-jansson-bundled
make menuselect/menuselect menuselect-tree menuselect.makeopts
#enable app_meetme
menuselect/menuselect --enable app_meetme menuselect.makeopts
#enable res_http_websocket
menuselect/menuselect --enable res_http_websocket menuselect.makeopts
#enable res_srtp
menuselect/menuselect --enable res_srtp menuselect.makeopts
make -j ${JOBS} all
make install
Asterisk 18
cd /usr/src/asterisk/asterisk-18.18.1/
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
./configure --libdir=/usr/lib64 --with-gsm=internal --enable-opus --enable-srtp --with-ssl --enable-asteriskssl --with-pjproject-bundled --with-jansson-bundled
make menuselect/menuselect menuselect-tree menuselect.makeopts
#enable app_meetme
menuselect/menuselect --enable app_meetme menuselect.makeopts
#enable res_http_websocket
menuselect/menuselect --enable res_http_websocket menuselect.makeopts
#enable res_srtp
menuselect/menuselect --enable res_srtp menuselect.makeopts
make -j ${JOBS} all
make install
That completes this article, make sure you restart asterisk if its running with “core restart now”
-Chris aka carpenox