At the time of this writing, the current version of each package :

Debian : 12.8 (Linux Kernel : 6.1.0-27)

FreePBX : 17.0.19.16

Asterisk : 20.10.0

The purpose of this article is to help you to setup a system running FreePBX v17 with patched Asterisk v20 utilizing the Chan_Sip driver to work with Cisco Enterprise IP Phones.

First thing you need to do is installing a minimal version of Debian v12 without any Desktop Environments. SSH Server need to be selected and the standard system utilities.

Once installed, you should have a Debian v12 system cleanly installed with a "root" user and a standard user you created during the installation process. Assuming all the following procedures to be run under "root" privileage so that you have to enable "root" login via SSH terminal. First, login locally using "root" account and enter the following commands line by line :

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
service ssh restart

After that, you can get the IP address of your Debian box using :

ip addr

You are now good to leave the physical Debian Box or Virtual Machine alone and all the following can be done via SSH terminal connect to your newly created Debian Box.

SSH to your Debian Box using "root" account and enter this commands :

apt update && apt install subversion

The system is now prepared for the installation of Asterisk v20.

cd /usr/src
tar zxvf asterisk-20-current.tar.gz
cd /usr/src/asterisk-20*/
./contrib/scripts/get_mp3_source.sh

Then we need to install some pre-requisite for Asterisk and that will take a few minutes to run :

./contrib/scripts/install_prereq install

At this point, the source codes of Asterisk v20 has been downloaded and it is time to patch it for Cisco Phones :

cd /usr/src
cd /usr/src/asterisk-20*/
patch --strip=1 < ../cisco-usecallmanager-20.10.0.patch

The Asterisk source codes have been patched at this point and ready to be compiled and installed.

CFLAGS="-DENABLE_SRTP_AES_GCM -DENABLE_SRTP_AES_256" ./configure

At this point, you have the option to select some extra things other than the default complie settings of Asterisk using the following command. This is optional just do it according to your own need.

make menuselect

Upon saving your selection and exit, you can continue to go:

make && make install
make samples

After a few minutes, the system has Asterisk v20 patched version installed.

Now, it is time to install FreePBX v17 :

cd /usr/src
wget https://github.com/FreePBX/sng_freepbx_debian_install/raw/master/sng_freepbx_debian_install.sh
bash ./sng_freepbx_debian_install.sh --noasterisk

After a long wait, you can see FreePBX v17 has been installed and you can use your browser to go to the IP address of your newly created system and do the initial setup of your FreePBX v17 as usual.

However, you may encounter another problem that once you reboot your machine, there are three services conflicting each other: Apache2, Asterisk, FreePBX. The reason is that the boot sequence declaration of these services has a ordering cycle logic error which could be induced by the installation script of FreePBX. To fix that, login via SSH using root:

nano /lib/systemd/system/apache2.service

You will see a line which read (should be the 3rd line):

After=network.target remote-fs.target nss-lookup.target freepbx.service

Just delete / remove "freepbx.service" at the end of the line and save the file. 

Reboot the system and you are good to go.

Thanks for Gareth Palmer who created the patch and constantly update the patch for most of the Asterisk release. He can be found at : https://usecallmanager.nz

You can contact me at : 該 Email 地址已受到反垃圾郵件外掛保護。要顯示它需要在瀏覽器中啓用 JavaScript。