From 066ffe546a3482c5a0e1ed62d042be98f64afa72 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 7 Apr 2026 18:04:34 +0000 Subject: [PATCH 01/10] Use one condition to overwrite the branch Simplifies the code by removing multiple conditions for the trixie codename --- debian/resources/switch/source-release.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index 03c946d..b9ffaf8 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -35,6 +35,12 @@ if [ ."$os_codename" = ."trixie" ]; then apt install -y python3-distutils-extra plocate fi +#use master branch for Debian 13 for now +if [ ."$os_codename" = ."trixie" ]; then + switch_version=1.10.13 + switch_branch=master +fi + # additional dependencies apt install -y sqlite3 unzip @@ -42,7 +48,7 @@ apt install -y sqlite3 unzip CWD=$(pwd) #install the following dependencies if the switch version is greater than 1.10.0 -if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ] || [ ."$os_codename" = ."trixie" ]; then +if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then # libks build-requirements apt install -y cmake uuid-dev @@ -60,7 +66,7 @@ if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') # sofia-sip cd /usr/src - if [ ."$sofia_version" = ."master" ] || [ ."$os_codename" = ."trixie" ]; then + if [ ."$sofia_version" = ."master" ]; then git clone https://github.com/freeswitch/sofia-sip.git sofia-sip cd sofia-sip else @@ -77,7 +83,7 @@ if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') cd /usr/src git clone https://github.com/freeswitch/spandsp.git spandsp cd spandsp - if [ ."$sofia_version" != ."master" ] && [ ."$os_codename" != ."trixie" ] && [ ."$switch_branch" != ."master" ]; then + if [ ."$sofia_version" != ."master" ] && [ ."$switch_branch" != ."master" ]; then git reset --hard 0d2e6ac65e0e8f53d652665a743015a88bf048d4 fi #/usr/bin/sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' /usr/src/spandsp/configure.ac @@ -91,7 +97,7 @@ fi cd /usr/src #check for master -if [ ."$os_codename" = ."trixie" ] || [ ."$switch_branch" = ."master" ]; then +if [ ."$switch_branch" = ."master" ]; then #master branch echo "Using version master" rm -r /usr/src/freeswitch @@ -107,7 +113,7 @@ if [ ."$os_codename" = ."trixie" ] || [ ."$switch_branch" = ."master" ]; then fi #check for stable release -if [ ."$switch_branch" != ."master" ] && [ ."$os_codename" != ."trixie" ] && [ ."$switch_branch" = ."stable" ]; then +if [ ."$switch_branch" != ."master" ] && [ ."$switch_branch" = ."stable" ]; then echo "Using version $switch_version" #1.8 and older if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then From d2e2579bdfaf3f85234ecf0ee72ff8b5cf43cff5 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 7 Apr 2026 12:21:47 -0600 Subject: [PATCH 02/10] Add unzip package to the install --- debian/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/install.sh b/debian/install.sh index 36c1be6..a30493f 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -11,8 +11,8 @@ cd "$(dirname "$0")" # removes the cd img from the /etc/apt/sources.list file (not needed after base install) sed -i '/cdrom:/d' /etc/apt/sources.list -#Update to latest packages -verbose "Update installed packages" +#Update to the latest packages +verbose "Update installed packages." apt-get update && apt-get upgrade -y #Add dependencies @@ -25,6 +25,7 @@ apt-get install -y dialog apt-get install -y nano apt-get install -y net-tools apt-get install -y gpg +apt-get install -y unzip #SNMP apt-get install -y snmpd From 9da8998fee972e9e408e891da6dc8ee13383f902 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 7 Apr 2026 12:24:27 -0600 Subject: [PATCH 03/10] Add unzip package to the install --- ubuntu/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ubuntu/install.sh b/ubuntu/install.sh index 8ed06cf..eb1ab89 100755 --- a/ubuntu/install.sh +++ b/ubuntu/install.sh @@ -11,8 +11,8 @@ cd "$(dirname "$0")" # removes the cd img from the /etc/apt/sources.list file (not needed after base install) sed -i '/cdrom:/d' /etc/apt/sources.list -#Update to latest packages -verbose "Update installed packages" +#Update to the latest packages +verbose "Update installed packages." apt-get update && apt-get upgrade -y #Add dependencies @@ -25,6 +25,7 @@ apt-get install -y dialog apt-get install -y nano apt-get install -y nginx apt-get install -y build-essential +apt-get install -y unzip #SNMP apt-get install -y snmpd From b8666cb2bb835f45aead8efb26c3ac503bfcae2c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 7 Apr 2026 17:10:23 -0600 Subject: [PATCH 04/10] Checkout the correct branch --- debian/resources/switch/source-release.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index b9ffaf8..6bc75ba 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -37,8 +37,8 @@ fi #use master branch for Debian 13 for now if [ ."$os_codename" = ."trixie" ]; then - switch_version=1.10.13 - switch_branch=master + switch_branch=master + switch_version=1.10.13 fi # additional dependencies @@ -48,7 +48,7 @@ apt install -y sqlite3 unzip CWD=$(pwd) #install the following dependencies if the switch version is greater than 1.10.0 -if [ ."$switch_version" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then +if [ ."$switch_branch = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then # libks build-requirements apt install -y cmake uuid-dev @@ -106,7 +106,7 @@ if [ ."$switch_branch" = ."master" ]; then git remote add fusionpbx https://github.com/fusionpbx/freeswitch.git git fetch fusionpbx - git checkout -b $switch_version + git checkout 1.10.12 git rebase fusionpbx/master ./bootstrap.sh -j @@ -122,18 +122,22 @@ if [ ."$switch_branch" != ."master" ] && [ ."$switch_branch" = ."stable" ]; then cd /usr/src/freeswitch-$switch_version # Reset repo just-in-case we are rebuilding - git reset --hard HEAD && git clean -fdx + #git reset --hard HEAD && git clean -fdx fi #1.10.0 and newer if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then - + # Get the source code using git git clone https://github.com/fusionpbx/freeswitch freeswitch-$switch_version + # Change the working directory cd /usr/src/freeswitch-$switch_version + # Get the stable branch + git checkout $switch_version + # Reset repo just-in-case we are rebuilding - git reset --hard origin/master && git clean -fdx + #git reset --hard origin/master && git clean -fdx #wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip #unzip freeswitch-$switch_version.-release.zip From cf10439e57ac1dde81625f99667ea56d911b3891 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 7 Apr 2026 17:50:53 -0600 Subject: [PATCH 05/10] Fix the switch_branch condition --- debian/resources/switch/source-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index 6bc75ba..ed260c7 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -48,7 +48,7 @@ apt install -y sqlite3 unzip CWD=$(pwd) #install the following dependencies if the switch version is greater than 1.10.0 -if [ ."$switch_branch = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then +if [ ."$switch_branch" = ."master" ] || [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then # libks build-requirements apt install -y cmake uuid-dev From 733a33f231b87b3d404f7c14281c71a23f76370a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 8 Apr 2026 10:13:38 -0600 Subject: [PATCH 06/10] Direct install of the sounds and music --- debian/resources/switch/source-sounds.sh | 43 ++++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/debian/resources/switch/source-sounds.sh b/debian/resources/switch/source-sounds.sh index 420c6c1..5f57a15 100755 --- a/debian/resources/switch/source-sounds.sh +++ b/debian/resources/switch/source-sounds.sh @@ -1,20 +1,41 @@ #!/bin/sh -#move to script directory so all relative paths work +# Move to script directory so all relative paths work cd "$(dirname "$0")" -#includes +# Includes . ../config.sh . ../environment.sh -# change the working directory -cd /usr/src/freeswitch-$switch_version +# Change the working directory +cd /usr/share/freeswitch/sounds -# compile and install the sounds -make sounds-install moh-install -make hd-sounds-install hd-moh-install -make cd-sounds-install cd-moh-install +# Array of sample rates +sample_rates="48000 32000 16000 8000" -#move the music into music/default directory -mkdir -p /usr/share/freeswitch/sounds/music/default -mv /usr/share/freeswitch/sounds/music/*000 /usr/share/freeswitch/sounds/music/default +# Loop through each sample rate +for sample_rate in $sample_rates; do + # Download the file + wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" + + # Extract the file + tar xvzf "freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" +done + +# Change to directory to the music directory +cd /usr/share/freeswitch/sounds/music + +# Loop through each sample rate +for sample_rate in $sample_rates; do + # Download the file + wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" + + # Extract the file + tar xvzf "freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" +done + +# Move the music to the default directory +mv music default + +# Remove the tar.gz files +rm /usr/share/freeswitch/sounds/music/*.tar.gz From 2e68b248cb63e5c9bb617c57599360fc98c52007 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 10 Apr 2026 02:55:00 +0000 Subject: [PATCH 07/10] Specify full paths for wget and tar commands Make sure wget is installed --- debian/resources/switch/source-sounds.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/debian/resources/switch/source-sounds.sh b/debian/resources/switch/source-sounds.sh index 5f57a15..d2ad211 100755 --- a/debian/resources/switch/source-sounds.sh +++ b/debian/resources/switch/source-sounds.sh @@ -10,16 +10,19 @@ cd "$(dirname "$0")" # Change the working directory cd /usr/share/freeswitch/sounds +# Make sure wget is installed +apt-get install -y wget + # Array of sample rates sample_rates="48000 32000 16000 8000" # Loop through each sample rate for sample_rate in $sample_rates; do # Download the file - wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" + /usr/bin/wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" # Extract the file - tar xvzf "freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" + /usr/bin/tar xvzf "freeswitch-sounds-en-us-callie-${sample_rate}-1.0.53.tar.gz" done # Change to directory to the music directory @@ -28,14 +31,14 @@ cd /usr/share/freeswitch/sounds/music # Loop through each sample rate for sample_rate in $sample_rates; do # Download the file - wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" + /usr/bin/wget "https://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" # Extract the file - tar xvzf "freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" + /usr/bin/tar xvzf "freeswitch-sounds-music-${sample_rate}-1.0.52.tar.gz" done # Move the music to the default directory -mv music default +/usr/bin/mv music default # Remove the tar.gz files -rm /usr/share/freeswitch/sounds/music/*.tar.gz +/usr/bin/rm /usr/share/freeswitch/sounds/music/*.tar.gz From c97579ab695f109227e894fb717aa684e8612929 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Fri, 10 Apr 2026 18:11:43 -0400 Subject: [PATCH 08/10] Implement move result code check for recordings (#467) Add error handling for file move operation. --- debian/resources/maintenance/call_recordings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/resources/maintenance/call_recordings.php b/debian/resources/maintenance/call_recordings.php index 74f860e..b5a1153 100644 --- a/debian/resources/maintenance/call_recordings.php +++ b/debian/resources/maintenance/call_recordings.php @@ -156,7 +156,13 @@ crontab -e if (!file_exists($new_path)) { system('mkdir -p '.$new_path); } $command = "mv ".$old_path."/".$record_name." ".$new_path."/".$record_name; if ($debug) { echo $command."\n"; } - system($command); + system($command, $move_result_code); + + //skip the database update if the move failed + if ($move_result_code !== 0) { + if ($debug) { echo "mv failed with exit code ".$move_result_code.", skipping database update.\n"; } + continue; + } } //update the database to the new directory From f0154a9db843350c7f74cd047f6cc96d93151aa8 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Sat, 11 Apr 2026 14:19:18 -0400 Subject: [PATCH 09/10] Bug Fix: on $action_name = 'both' there was no comma (#466) No command when action_name was set to 'both' causing the SQL statement to be invalid --- debian/resources/maintenance/call_recordings.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/resources/maintenance/call_recordings.php b/debian/resources/maintenance/call_recordings.php index b5a1153..8558bae 100644 --- a/debian/resources/maintenance/call_recordings.php +++ b/debian/resources/maintenance/call_recordings.php @@ -166,13 +166,14 @@ crontab -e } //update the database to the new directory - $sql = "update v_xml_cdr set \n"; + $set_clauses = []; if ($action_name == 'move' || $action_name == 'both') { - $sql .= "record_path = '".$new_path."' \n"; + $set_clauses[] = "record_path = '".$new_path."'"; } if ($action_name == 'convert' || $action_name == 'both') { - $sql .= "record_name = '".$path_parts['filename'].".mp3'\n"; + $set_clauses[] = "record_name = '".$path_parts['filename'].".mp3'"; } + $sql = "update v_xml_cdr set " . implode(", ", $set_clauses) . " \n"; $sql .= "where xml_cdr_uuid = '".$row['xml_cdr_uuid']."';\n"; if ($debug) { echo $sql."\n"; } $database->execute($sql); From ba8f6260587815bf702cee8903d74d2cf38ed4e2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 11 Apr 2026 18:22:53 +0000 Subject: [PATCH 10/10] Update call_recordings.php --- debian/resources/maintenance/call_recordings.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/resources/maintenance/call_recordings.php b/debian/resources/maintenance/call_recordings.php index 8558bae..6d81ba3 100644 --- a/debian/resources/maintenance/call_recordings.php +++ b/debian/resources/maintenance/call_recordings.php @@ -165,15 +165,17 @@ crontab -e } } - //update the database to the new directory - $set_clauses = []; + //set the sql update params + $sql_params = []; if ($action_name == 'move' || $action_name == 'both') { - $set_clauses[] = "record_path = '".$new_path."'"; + $sql_params[] = "record_path = '".$new_path."'"; } if ($action_name == 'convert' || $action_name == 'both') { - $set_clauses[] = "record_name = '".$path_parts['filename'].".mp3'"; + $sql_params[] = "record_name = '".$path_parts['filename'].".mp3'"; } - $sql = "update v_xml_cdr set " . implode(", ", $set_clauses) . " \n"; + + //update the database to the new directory + $sql = "update v_xml_cdr set " . implode(", ", $sql_params) . " \n"; $sql .= "where xml_cdr_uuid = '".$row['xml_cdr_uuid']."';\n"; if ($debug) { echo $sql."\n"; } $database->execute($sql);