Added optional applications.sh scripts.
Added call_recordings.php script for wav - mp3 conversion. Updated ubuntu\resources\fusionpbx\config.conf to add entry for setting the event socket password and a comment at the top to direct admins to where they can find more configuration options for this file. Updated config.sh to add switch_token entry as well as some version changes to make the installer Ubuntu 24.04 compatible. Added on the Optional applications entries as well. Updated environment.sh to include setting the PATH just in case. Updated finish.sh to include output of db username and password to save a few steps when setting up. Added freeswitch-acl.conf from the Debian side as more security is important. Updated fail2ban.sh to reflect installing freeswitch from source. Updated jail.local to include freeswitch-acl as well as turning several items on by default (security should always be the default). Updated install.sh to include some missing dependencies (nginx and build-essential) Added ioncube for php compatibility. Updated php.sh, and nginx.sh to include 8.1, 8.2 and 8.3 Swapped plocate for mlocate in dependency install in ubuntu\resources\switch\source-release.sh, uncommented ./bootstrap.sh -j line for git compatibility, removed duplicate $switch_version from sed commands, added sed command to disable mod_av. Added environment.sh include to switch.sh Added monit files for freeswitch perms etc.
This commit is contained in:
parent
020d191e23
commit
39f5c3a69c
|
|
@ -23,7 +23,8 @@ apt-get install -y systemd-sysv
|
|||
apt-get install -y ca-certificates
|
||||
apt-get install -y dialog
|
||||
apt-get install -y nano
|
||||
|
||||
apt-get install -y nginx
|
||||
apt-get install -y build-essential
|
||||
#SNMP
|
||||
apt-get install -y snmpd
|
||||
echo "rocommunity public" > /etc/snmp/snmpd.conf
|
||||
|
|
@ -47,6 +48,9 @@ resources/nginx.sh
|
|||
#Postgres
|
||||
resources/postgresql.sh
|
||||
|
||||
#Optional Applications
|
||||
resources/applications.sh
|
||||
|
||||
#FreeSWITCH
|
||||
resources/switch.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
#move to script directory so all relative paths work
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
#includes
|
||||
. ./config.sh
|
||||
|
||||
#optional applications
|
||||
cd /var/www/fusionpbx/app
|
||||
if [ .$application_transcribe = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-transcribe.git transcribe
|
||||
fi
|
||||
if [ .$application_speech = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-speech.git speech
|
||||
fi
|
||||
if [ .$application_device_logs = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-device_logs.git device_logs
|
||||
fi
|
||||
if [ .$application_dialplan_tools = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-dialplan_tools.git dialplan_tools
|
||||
fi
|
||||
if [ .$application_edit = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-dialplan_tools.git edit
|
||||
fi
|
||||
if [ .$application_sip_trunks = .'true' ]; then
|
||||
git clone https://github.com/fusionpbx/fusionpbx-app-sip_trunks.git sip_trunks
|
||||
fi
|
||||
chown -R www-data:www-data /var/www/fusionpbx
|
||||
|
|
@ -7,11 +7,12 @@ system_branch=5.2 # master, 5.2
|
|||
|
||||
# FreeSWITCH Settings
|
||||
switch_branch=stable # master, stable
|
||||
switch_source=true # true or false
|
||||
switch_package=false # true or false
|
||||
switch_version=1.10.11 # only for source
|
||||
switch_source=true # true (source compile) or false (binary package)
|
||||
switch_package=false # true (binary package) or false (source compile)
|
||||
switch_version=1.10.11 # which source code to download, only for source
|
||||
switch_tls=true # true or false
|
||||
|
||||
switch_token= # Get the auth token from https://signalwire.com
|
||||
# Signup or Login -> Profile -> Personal Auth Token
|
||||
# Sofia-Sip Settings
|
||||
sofia_version=1.13.17 # release-version for sofia-sip to use
|
||||
|
||||
|
|
@ -19,12 +20,20 @@ sofia_version=1.13.17 # release-version for sofia-sip to use
|
|||
database_name=fusionpbx # Database name (safe characters A-Z, a-z, 0-9)
|
||||
database_username=fusionpbx # Database username (safe characters A-Z, a-z, 0-9)
|
||||
database_password=random # random or a custom value (safe characters A-Z, a-z, 0-9)
|
||||
database_repo=system # PostgreSQL official, system, 2ndquadrant
|
||||
database_version=13 # requires repo official
|
||||
database_repo=official # PostgreSQL official, system
|
||||
database_version=16 # requires repo official
|
||||
database_host=127.0.0.1 # hostname or IP address
|
||||
database_port=5432 # port number
|
||||
database_backup=false # true or false
|
||||
|
||||
# General Settings
|
||||
php_version=7.4 # PHP version 5.6 or 7.0, 7.1, 7.2
|
||||
php_version=8.3 # PHP version 5.6 or 7.0, 7.1, 7.2
|
||||
letsencrypt_folder=true # true or false
|
||||
|
||||
# Optional Applications
|
||||
application_transcribe=true # Speech to Text
|
||||
application_speech=true # Text to Speech
|
||||
application_device_logs=true # Log device provision requests
|
||||
application_dialplan_tools=false # Add additional dialplan applications
|
||||
application_edit=false # Editor for XML, Provision, Scripts, and PHP
|
||||
application_sip_trunks=false # Registration based SIP trunks
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ cpu_name=$(uname -m)
|
|||
cpu_architecture='unknown'
|
||||
cpu_mode='unknown'
|
||||
|
||||
#set the environment path
|
||||
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
#check what the CPU and OS are
|
||||
if [ .$cpu_name = .'armv7l' ]; then
|
||||
# RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf
|
|||
cp fail2ban/jail.local /etc/fail2ban/jail.local
|
||||
|
||||
#update config if source is being used
|
||||
#if [ .$switch_source = .true ]; then
|
||||
# sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
||||
#fi
|
||||
if [ .$switch_source = .true ]; then
|
||||
sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
||||
fi
|
||||
|
||||
#restart fail2ban
|
||||
/usr/sbin/service fail2ban restart
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
# Fail2Ban configuration file
|
||||
#
|
||||
|
||||
[Definition]
|
||||
|
||||
# Option: failregex
|
||||
# Notes.: regex to match the password failures messages in the logfile. The
|
||||
# host must be matched by a group named "host". The tag "<HOST>" can
|
||||
# be used for standard IP/hostname matching and is only an alias for
|
||||
# (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
|
||||
# Values: TEXT
|
||||
#
|
||||
#2021-02-03 16:27:57.292697 [WARNING] sofia_reg.c:2353 IP 62.210.78.91 Rejected by register acl "domains"
|
||||
failregex = \[WARNING\] sofia_reg.c:\d+ IP <HOST> Rejected by register acl
|
||||
|
||||
# Option: ignoreregex
|
||||
# Notes.: regex to ignore. If this regex matches, the line is ignored.
|
||||
# Values: TEXT
|
||||
#
|
||||
ignoreregex =
|
||||
|
|
@ -10,7 +10,7 @@ findtime = 7200
|
|||
bantime = 86400
|
||||
|
||||
[freeswitch]
|
||||
enabled = false
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = freeswitch
|
||||
|
|
@ -22,32 +22,44 @@ findtime = 600
|
|||
bantime = 3600
|
||||
# sendmail-whois[name=FreeSwitch, dest=root, sender=fail2ban@example.org] #no smtp server installed
|
||||
|
||||
[freeswitch-acl]
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = freeswitch-acl
|
||||
logpath = /var/log/freeswitch/freeswitch.log
|
||||
#logpath = /usr/local/freeswitch/log/freeswitch.log
|
||||
action = iptables-allports[name=freeswitch-acl, protocol=all]
|
||||
maxretry = 900
|
||||
findtime = 60
|
||||
bantime = 86400
|
||||
|
||||
[freeswitch-ip]
|
||||
enabled = false
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = freeswitch-ip
|
||||
logpath = /var/log/freeswitch/freeswitch.log
|
||||
#logpath = /usr/local/freeswitch/log/freeswitch.log
|
||||
action = iptables-allports[name=freeswitch-ip, protocol=all]
|
||||
maxretry = 1
|
||||
maxretry = 3
|
||||
findtime = 30
|
||||
bantime = 86400
|
||||
|
||||
[auth-challenge-ip]
|
||||
enabled = false
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = auth-challenge-ip
|
||||
logpath = /var/log/freeswitch/freeswitch.log
|
||||
#logpath = /usr/local/freeswitch/log/freeswitch.log
|
||||
action = iptables-allports[name=auth-challenge-ip, protocol=all]
|
||||
maxretry = 1
|
||||
maxretry = 3
|
||||
findtime = 30
|
||||
bantime = 86400
|
||||
|
||||
[sip-auth-challenge]
|
||||
enabled = false
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = sip-auth-challenge
|
||||
|
|
@ -59,7 +71,7 @@ findtime = 30
|
|||
bantime = 7200
|
||||
|
||||
[sip-auth-failure]
|
||||
enabled = false
|
||||
enabled = true
|
||||
port = 5060:5091
|
||||
protocol = all
|
||||
filter = sip-auth-failure
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ echo " Use a web browser to login."
|
|||
echo " domain name: https://$domain_name"
|
||||
echo " username: $user_name"
|
||||
echo " password: $user_password"
|
||||
echo " db username: $database_username"
|
||||
echo " db password: $database_password"
|
||||
echo ""
|
||||
echo " The domain name in the browser is used by default as part of the authentication."
|
||||
echo " If you need to login to a different domain then use username@domain."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
# You can find variables that you can configure for this file in fusionpbx/app/switch/resources/scripts/resources/functions/config.lua
|
||||
#database system settings
|
||||
database.0.type = pgsql
|
||||
database.0.host = {database_host}
|
||||
|
|
@ -33,6 +33,13 @@ switch.recordings.dir = /var/lib/freeswitch/recordings
|
|||
switch.storage.dir = /var/lib/freeswitch/storage
|
||||
switch.voicemail.dir = /var/lib/freeswitch/storage/voicemail
|
||||
switch.scripts.dir = /usr/share/freeswitch/scripts
|
||||
# If you change switch.event_socket.password here, you MUST change it in /etc/freeswitch/autoload_configs/event_socket.conf.xml
|
||||
# Additionally you must update/create an /etc/fs_cli.conf file with at minimum the following lines (uncommented)
|
||||
# [default]
|
||||
# host => 127.0.0.1
|
||||
# port => 8021
|
||||
# password => <whatever you set the password below to>
|
||||
switch.event_socket.password = ClueCon
|
||||
|
||||
#switch xml handler
|
||||
xml_handler.fs_path = false
|
||||
|
|
|
|||
|
|
@ -0,0 +1,243 @@
|
|||
LICENCE AGREEMENT FOR THE IONCUBE PHP LOADER, PROVIDED TO ENABLE THE USE
|
||||
OF IONCUBE ENCODED FILES AND AS PART OF THE IONCUBE24 SERVICE (ioncube24.com)
|
||||
|
||||
YOU SHOULD CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS BEFORE USING THE
|
||||
LOADER SOFTWARE. THE INSTALLATION AND/OR USE OR COPYING OF THE IONCUBE PHP
|
||||
LOADER SOFTWARE INDICATES YOUR ACCEPTANCE OF THIS LICENCE AGREEMENT. IF YOU
|
||||
DO NOT ACCEPT THE TERMS OF THIS LICENCE AGREEMENT, DO NOT INSTALL, COPY
|
||||
AND/OR USE THE LOADER SOFTWARE.
|
||||
|
||||
DEFINITIONS
|
||||
|
||||
The following definitions shall apply in this document:
|
||||
|
||||
LOADER shall mean the ionCube PHP Loader software package or collection
|
||||
of Loaders, including any modifications or upgrades to the software, used for
|
||||
executing PHP scripts previously encoded with the ionCube PHP Encoder
|
||||
software to render them non-humanly readable, and any associated
|
||||
documentation or electronic or online materials relating to the software.
|
||||
|
||||
ENCODER shall mean any ionCube PHP Encoder software or service used for the
|
||||
purpose of producing non-humanly readable encoded files from PHP scripts.
|
||||
|
||||
ENCODED FILE shall mean a non-humanly readable file produced by the
|
||||
Encoder and being derived from humanly readable PHP script source.
|
||||
|
||||
PROVIDER shall mean ionCube Ltd.
|
||||
|
||||
USER/YOU shall mean any entity who has downloaded or obtained through any
|
||||
other means a version of the Loader software.
|
||||
|
||||
|
||||
1 LICENSE ENTITLEMENT
|
||||
|
||||
1.1 The Loader is provided without charge. Title to the Loader does not pass
|
||||
to the user in any circumstances. The Loader is supplied as object code.
|
||||
|
||||
1.2 The provider grants a personal, non-transferable, non-exclusive licence to
|
||||
use the Loader in accordance with the terms and conditions of this Licence
|
||||
Agreement.
|
||||
|
||||
1.3 The installation or downloading and use of the Loader entitles the user
|
||||
to install and use the Loader for its own internal lawful purposes.
|
||||
|
||||
|
||||
2 DISTRIBUTION
|
||||
|
||||
2.1 The Loader may be freely distributed to third parties alone or as
|
||||
part of a distribution containing other items provided that this license
|
||||
is also included.
|
||||
|
||||
2.2 The Loader may under no circumstances be branded as another product,
|
||||
whether distributed or not.
|
||||
|
||||
2.3 Distribution as part of a commercial product is permitted provided such
|
||||
distribution is in accordance with clauses 2.1 and 2.2 with respect to the
|
||||
Loader.
|
||||
|
||||
|
||||
3 ANALYSIS / REVERSE ENGINEERING / MODIFICATION
|
||||
|
||||
Except insofar as the user is permitted to do so in accordance with applicable
|
||||
law:
|
||||
|
||||
3.1 Any analysis of the Loader and embedded data by any means and by
|
||||
any entity whether human or otherwise and including but without limitation to
|
||||
discover details of internal operation, to reverse engineer, to de-compile
|
||||
object code, or to modify for the purposes of modifying behaviour is
|
||||
forbidden.
|
||||
|
||||
3.2 Any analysis of encoded files by any means and by any entity whether human
|
||||
or otherwise and including but without limitation to discover details of file
|
||||
format or for the purposes of modifying behaviour or scope of their usage is
|
||||
forbidden.
|
||||
|
||||
|
||||
4 WARRANTY
|
||||
|
||||
THE LOADER SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
|
||||
WARRANTIES INCLUDING BUT WITHOUT LIMITATION THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. THE PROVIDER DOES NOT WARRANT THAT THE LOADER IS UNINTERRUPTED
|
||||
OR ERROR FREE, NOR THAT THE OPERATION OF THE LOADER WILL FUNCTION IN
|
||||
CONJUNCTION WITH ANY OTHER PRODUCT.
|
||||
|
||||
|
||||
5 LIMITATION OF LIABILITY
|
||||
|
||||
5.1 IN NO EVENT WILL THE PROVIDER OF THE LOADER BE LIABLE TO THE USER OR ANY
|
||||
PARTY FOR ANY DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR OTHER
|
||||
CONSEQUENTIAL DAMAGES ARISING DIRECTLY OR INDIRECTLY FROM THIS LICENCE
|
||||
AGREEMENT OR ANY USE OF THE LOADER OR ENCODED FILES, EVEN IF THE PROVIDER IS
|
||||
EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
5.2 THE LOADER IS PROVIDED ON AN "AS IS" BASIS. THE PROVIDER EXCLUDES ALL
|
||||
WARRANTIES, CONDITIONS, TERMS, UNDERTAKINGS AND REPRESENTATIONS (EXCLUDING
|
||||
FRAUDULENT MISREPRESENTATION) OF ANY KIND, EXPRESS OR IMPLIED, STATUTORY OR
|
||||
OTHERWISE IN CONNECTION WITH THE LOADER TO THE FULLEST EXTENT PERMITTED BY
|
||||
LAW.
|
||||
|
||||
5.3 DOWNLOADING THE LOADER IS AT YOUR OWN RISK AND THE PROVIDER DOES NOT
|
||||
ACCEPT LIABILITY FOR ANY DIRECT OR INDIRECT LOSS OR DAMAGE HOWSOEVER CAUSED AS
|
||||
A RESULT OF ANY COMPUTER VIRUSES, BUGS, TROJAN HORSES, WORMS, SOFTWARE BOMBS
|
||||
OR OTHER SIMILAR PROGRAMS ARISING FROM YOUR USE OF THE LOADER. WHILST THE
|
||||
PROVIDER WILL DO ITS BEST TO ENSURE THAT THE LOADER IS FREE FROM SUCH
|
||||
DESTRUCTIVE PROGRAMS, IT IS YOUR RESPONSIBILITY TO TAKE REASONABLE PRECAUTIONS
|
||||
TO SCAN FOR SUCH DESTRUCTIVE PROGRAMS DOWNLOADED FROM THE INTERNET.
|
||||
|
||||
5.4 THE PROVIDER'S MAXIMUM LIABILITY FOR ANY LOSS OR DAMAGE ARISING FROM THIS
|
||||
LICENCE AGREEMENT SHALL IN ANY EVENT BE LIMITED IN THE SOLE DISCRETION OF THE
|
||||
PROVIDER TO THE REPLACEMENT OF THE LOADER PRODUCT.
|
||||
|
||||
5.5 DUE TO THE NATURE OF THE INTERNET, THE PROVIDER CANNOT GUARANTEE THAT ANY
|
||||
E-MAILS OR OTHER ELECTRONIC TRANSMISSIONS WILL BE SENT TO YOU OR RECEIVED BY
|
||||
THE PROVIDER OR THAT THE CONTENT OF SUCH TRANSMISSIONS WILL BE SECURE DURING
|
||||
TRANSMISSION.
|
||||
|
||||
|
||||
6 BUG FIXING AND PRODUCT SUPPORT
|
||||
|
||||
6.1 The provider will use reasonable endeavours to provide support to users.
|
||||
The provider will at their discretion only provide support for the latest
|
||||
release.
|
||||
|
||||
6.2 Support comprises of fault reporting via tickets and fault diagnosis,
|
||||
recommendations on workarounds, and where reasonably possible a timely
|
||||
resolution.
|
||||
|
||||
6.3 The user accepts that on occasion the ability of the provider to meet
|
||||
anticipated or published support schedules may be impaired due to, but without
|
||||
limitation, Internet service provider failures or software failures that
|
||||
affect the ability to communicate for an indeterminate period.
|
||||
|
||||
6.4 The provider reserves the right to refuse to provide support at any time.
|
||||
|
||||
6.5 The provider wishes to maintain and offer a product of the highest
|
||||
possible quality, and accordingly may from time to time and at its discretion
|
||||
make product changes for the purpose of correcting behaviour in variance to
|
||||
the published specification or the user's reasonable expectations.
|
||||
|
||||
6.6 The provider reserves the right to charge for support where the user does
|
||||
not have a valid support plan in place, or where the support offered exceeds
|
||||
the scope of the active support plan.
|
||||
|
||||
|
||||
7 PRODUCT UPGRADES
|
||||
|
||||
7.1 The provider may from time to time release product upgrades. These will
|
||||
be provided free of charge and attempts made to provide a timely notification
|
||||
to customers of the existence of any new release.
|
||||
|
||||
|
||||
8 ERRORS AND OMISSIONS
|
||||
|
||||
Whilst reasonable endeavours are made to ensure the accuracy of documentation
|
||||
concerning the details of the Loader, the user accepts the possibility of
|
||||
inaccuracies in information presented in any format, including email
|
||||
communications and online services. The provider shall under no circumstances
|
||||
be liable for any events that arise as a result of unintentional inaccuracies
|
||||
or omissions.
|
||||
|
||||
|
||||
9 USER INDEMNITY
|
||||
|
||||
You agree to fully indemnify, defend and hold the provider harmless
|
||||
immediately upon demand from and against all actions, liability, claims,
|
||||
losses, damages, costs and expenses (including legal/attorney fees) incurred
|
||||
by the provider arising directly or indirectly as a result of your breach of
|
||||
this Licence Agreement.
|
||||
|
||||
|
||||
10 INTELLECTUAL PROPERTY RIGHTS
|
||||
|
||||
10.1 The user acknowledges that the Loader and associated documentation and
|
||||
materials contain proprietary information of the provider and are and shall
|
||||
remain the exclusive property of the provider and/or its licensors and all
|
||||
title, copyright, trade marks, trade names, patents and other intellectual
|
||||
property rights therein of whatever nature shall remain the sole property of
|
||||
the provider and/or its licensors.
|
||||
|
||||
10.2 No title to or rights of ownership, copyright or other intellectual
|
||||
property in the Loader is transferred to the user (other than the licence
|
||||
rights expressly granted in this Licence Agreement).
|
||||
|
||||
|
||||
11 TERMINATION
|
||||
|
||||
11.1 The provider reserves the right to terminate this Licence Agreement
|
||||
immediately by notice in writing against the user if the user is in breach of
|
||||
any terms and conditions of this Licence Agreement.
|
||||
|
||||
11.2 Termination of this Licence Agreement for any reason shall be without
|
||||
prejudice to any other rights or remedies of the provider which may have
|
||||
arisen on or before the date of termination under this Licence Agreement or in
|
||||
law.
|
||||
|
||||
11.3 The provisions of the following clauses shall survive any termination of
|
||||
this agreement; clause 3, 5, 10 and 13.
|
||||
|
||||
|
||||
12 GENERAL
|
||||
|
||||
12.1 The provider reserves the right to transfer or assign all or any of its
|
||||
rights and duties and responsibilities set out in this Licence Agreement to
|
||||
another party.
|
||||
|
||||
12.2 Headings have been included for convenience only and will not be used in
|
||||
construing any provision of this Licence Agreement.
|
||||
|
||||
12.3 No delay or failure by the provider to exercise any powers, rights or
|
||||
remedies under this Licence Agreement will operate as a waiver of them nor
|
||||
will any single or partial exercise of any such powers, rights or remedies
|
||||
include any other or further exercise of them.
|
||||
|
||||
12.4 If any part of this Licence Agreement is found by a court of competent
|
||||
jurisdiction or other competent authority to be invalid, unlawful or
|
||||
unenforceable then such part shall be severed from the remainder of this
|
||||
Licence Agreement which will continue to be valid and enforceable to the
|
||||
fullest extent permitted by applicable law.
|
||||
|
||||
12.5 This Licence Agreement including the documents or other sources referred
|
||||
to herein supersede all prior representations, understandings and agreements
|
||||
between the user and the provider relating to the Loader and sets forth the
|
||||
entire agreement and understanding between the user and the provider relating
|
||||
to the Loader.
|
||||
|
||||
12.6 Nothing in this Licence Agreement shall be deemed to constitute a
|
||||
partnership between you and the provider nor constitute either party being an
|
||||
agent of the other party.
|
||||
|
||||
12.7 This Agreement does not create any rights or benefits enforceable by any
|
||||
person not a party to it (within the meaning of the U.K.Contracts (Rights of
|
||||
Third Parties) Act 1999) except that a person who under clause 12.1 is a
|
||||
permitted successor or assignee of the rights or benefits of the provider may
|
||||
enforce such rights or benefits.
|
||||
|
||||
|
||||
13 GOVERNING LAW AND JURISDICTION
|
||||
|
||||
This License Agreement and any issues relating thereto shall be construed and
|
||||
interpreted in accordance with the laws of England and subject to the
|
||||
exclusive jurisdiction of the English courts.
|
||||
|
||||
Copyright (c) 2002-2024 ionCube Ltd. Last revised 23-April-2015
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
The ionCube Loader
|
||||
------------------
|
||||
|
||||
This package contains:
|
||||
|
||||
* ionCube Loaders
|
||||
|
||||
* a Loader Wizard script to assist with Loader installation (loader-wizard.php)
|
||||
|
||||
* the License document for use of the Loader and encoded files (LICENSE.txt)
|
||||
|
||||
* User Guide describing options that can be configured through a php.ini file.
|
||||
There are options that may improve performance, particularly with files on
|
||||
a network drive. Options for the ionCube24 intrusion protection and PHP error
|
||||
reporting service (ioncube24.com) are also described.
|
||||
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
Quick Guide for experienced system admins
|
||||
-----------------------------------------
|
||||
|
||||
The Loader is a PHP engine extension, so should be referenced with
|
||||
a zend_extension line in a php.ini file. It must be the first engine
|
||||
extension to be installed.
|
||||
|
||||
The Loader must be for the correct operating system, match the
|
||||
PHP version, and for whether PHP is built as thread-safe (TS) or not.
|
||||
All information required for installing is available on a phpinfo page.
|
||||
|
||||
For example, if your web server is 64 bit Linux, thread safety is disabled,
|
||||
PHP is version 8.1.8, the main php.ini file is /etc/php.ini and you
|
||||
have unpacked Loaders to /usr/local/ioncube, you would:
|
||||
|
||||
1) edit /etc/php.ini
|
||||
2) at the top of the php.ini file add
|
||||
|
||||
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.1.so
|
||||
|
||||
3) restart the PHP environment (i.e. Apache, php-fpm, etc.)
|
||||
|
||||
4) Check a phpinfo page and the Loader should show up in the Zend Engine box.
|
||||
|
||||
|
||||
Assisted Installation with the Loader Wizard
|
||||
--------------------------------------------
|
||||
|
||||
1. Upload the contents of this package to a directory/folder called ioncube
|
||||
within the top level of your web scripts area. This is sometimes called the
|
||||
"web root" or "document root". Common names for this location are "www",
|
||||
"public_html", and "htdocs", but it may be different on your server.
|
||||
|
||||
2. Launch the Loader Wizard script in your browser. For example:
|
||||
https://yourdomain/ioncube/loader-wizard.php
|
||||
|
||||
If the wizard is not found, check carefully the location on your server
|
||||
where you uploaded the Loaders and the wizard script.
|
||||
|
||||
3. Follow the steps given by the Loader Wizard. If you have full access to the
|
||||
server then installation should be easy. If your hosting plan is more limited,
|
||||
you may need to ask your hosting provider for assistance.
|
||||
|
||||
4. The Loader Wizard can automatically create a ticket in our support system
|
||||
if installation is unsuccessful, and we are happy to assist in that case.
|
||||
|
||||
YouTube with a search for "ioncube loader wizard" also gives some helpful
|
||||
examples of installation.
|
||||
|
||||
|
||||
WHERE TO INSTALL THE LOADERS
|
||||
============================
|
||||
|
||||
The Loader Wizard should be used to guide the installation process but the
|
||||
following are the standard locations for the Loader files. Loader file
|
||||
packages can be obtained from https://www.ioncube.com/loaders.php
|
||||
|
||||
Please check that you have the correct package of Loaders for your system.
|
||||
|
||||
Installing to a remote SHARED server
|
||||
------------------------------------
|
||||
|
||||
* Upload the Loader files to a directory/folder called ioncube within your
|
||||
main web scripts area. (This will probably be where you placed the
|
||||
loader-wizard.php script.)
|
||||
|
||||
|
||||
Installing to a remote UNIX/LINUX DEDICATED or VPS server
|
||||
---------------------------------------------------------
|
||||
|
||||
* Upload the Loader files to the PHP extensions directory or, if that is
|
||||
not set, /usr/local/ioncube
|
||||
|
||||
|
||||
** Installing to a remote WINDOWS DEDICATED or VPS server
|
||||
|
||||
* Upload the Loader files to the PHP extensions directory or, if that is
|
||||
not set, C:\windows\system32
|
||||
|
||||
|
||||
64-BIT LOADERS FOR WINDOWS
|
||||
--------------------------
|
||||
|
||||
64-bit Loaders for Windows are available for PHP 5.5 upwards.
|
||||
The Loader Wizard will not give directions for installing 64-bit Loaders for
|
||||
any earlier version of PHP 5.
|
||||
|
||||
Copyright (c) 2002-2022 ionCube Ltd. Last revised July-2022
|
||||
Binary file not shown.
|
|
@ -0,0 +1,337 @@
|
|||
ionCube Loader 13.3 (beta) User Guide
|
||||
=====================================
|
||||
|
||||
This document describes the available php.ini configuration options of the
|
||||
ionCube Loader that relate to processing of PHP encoded files, and also the
|
||||
ionCube24 service. It also describes which encoded files can be run by each
|
||||
ionCube Loader.
|
||||
|
||||
PERFORMANCE OF ENCODED FILES
|
||||
----------------------------
|
||||
|
||||
We recommend that the encoded paths feature (see below) is used
|
||||
with encoded files in order to maximise performance.
|
||||
|
||||
ENCODED FILES
|
||||
-------------
|
||||
|
||||
INI entry: ioncube.loader.encoded_paths
|
||||
|
||||
Purpose: Specify the locations of encoded files
|
||||
|
||||
The ionCube Loader will normally examine a PHP file before processing
|
||||
to test whether it is encoded, and will run the file itself if necessary.
|
||||
Although this checking is very efficient, restricting which files the
|
||||
Loader tests for being encoded may give extra performance. If set to
|
||||
a series of paths or files, only files in those locations are tested.
|
||||
|
||||
Entries should be separated by a : on Unix and ; on Windows.
|
||||
A path may be prefixed with + or - to add or remove that path from
|
||||
the possible locations. + is assumed if no character is given.
|
||||
|
||||
|
||||
Examples: (... means ioncube.loader.encoded_paths)
|
||||
|
||||
* Site with a single encoded module in /var/www/html/modules/RSS
|
||||
|
||||
... = "/var/www/html/modules/RSS"
|
||||
|
||||
|
||||
* As above, with a site configuration file encoded too.
|
||||
|
||||
... = "/var/www/html/modules/RSS:/var/www/html/config/config.php"
|
||||
|
||||
|
||||
* Encoded files may be anywhere except for /var/www/html/framework
|
||||
|
||||
... = "/:-/var/www/html/framework"
|
||||
|
||||
|
||||
* Site with most modules encoded except for one
|
||||
|
||||
... = "/var/www/html/modules:-/var/www/html/modules/plain"
|
||||
|
||||
|
||||
* As above, with an encoded config file in the plain directory
|
||||
|
||||
... = "/site/modules:-/site/modules/plain:/site/modules/plain/config.php"
|
||||
|
||||
|
||||
Locations:
|
||||
|
||||
The ioncube.loader.encoded_paths property can be set in a php.ini
|
||||
file, in a .htaccess file (when using Apache), in a .user.ini file
|
||||
(when using CGI PHP 5.3+) or using ini_set within a PHP script. In ini
|
||||
files only the last value will be used for the encoded_paths property. If
|
||||
you wish to build up the value in several lines then, for PHP 5.1+, you
|
||||
can use the following syntax:
|
||||
|
||||
ioncube.loader.encoded_paths = "/path1"
|
||||
ioncube.loader.encoded_paths = ${ioncube.loader.encoded_paths}":/path2"
|
||||
; etc...
|
||||
|
||||
LIMITATIONS OF LOADERS AND ENCODED FILES
|
||||
----------------------------------------
|
||||
|
||||
Encoded files can, in general, run on versions of PHP equal to
|
||||
or greater than the source language of the Encoder used to
|
||||
produce them. So a file produced by the Encoder for PHP 7.2
|
||||
can be run by the Loaders for PHP 7.2, 7.3 and 7.4, but 7.1. This
|
||||
means that the Loaders offer good backwards compatibility,
|
||||
however there are the following limitations:
|
||||
|
||||
* The Loader for PHP 8.2 can only run files produced for
|
||||
PHP 8.2. Updates for files produced for PHP 8.1 should
|
||||
be obtained to use them with PHP 8.2.
|
||||
|
||||
* The Loader for PHP 8.1 can only run files produced for
|
||||
PHP 8.1.
|
||||
|
||||
* The Loaders for PHP 7.1 through 7.4 can only run files
|
||||
produced by the Encoders for PHP 7.
|
||||
|
||||
* The Loader for PHP 7.0 can only run files produced by the
|
||||
Encoder for PHP 5.6.
|
||||
|
||||
* The Loaders for PHP 5.5 and PHP 5.6 cannot run files
|
||||
produced by the PHP 4 Encoder.
|
||||
|
||||
|
||||
IONCUBE24 : real-time intrusion protection and PHP error reporting
|
||||
---------
|
||||
### (Available for Linux 32 and 64 bit x86 servers using PHP 7)
|
||||
|
||||
ionCube24 (https://ioncube24.com) is an ionCube service that uses the
|
||||
ionCube Loader to provide both real-time protection against the exploit of
|
||||
website vulnerabilities and alerting of website errors.
|
||||
|
||||
Vulnerabilities in PHP applications are common, particularly in sites using
|
||||
Wordpress and other plugin based systems. Exploits result in website
|
||||
defacement or customer data being compromised, and ionCube24 provides a
|
||||
uniquely powerful defense.
|
||||
|
||||
PHP errors can cause intermittent or even persistent blank pages or errors for
|
||||
visitors until discovered, and without active monitoring this could go
|
||||
undetected indefinitely. ionCube24 active monitoring ensures you are always
|
||||
aware of problems in your website code.
|
||||
|
||||
ionCube24 is free to try, with the server side support built into the Linux
|
||||
Loaders as standard. With the Loader installed, ionCube24 can be activated
|
||||
at any time to give active intrusion protection and error reporting.
|
||||
|
||||
## php.ini settings
|
||||
|
||||
ionCube24 has a powerful real-time web interface to configure, monitor and
|
||||
manage things, and there are also settings that can be used in a php.ini
|
||||
file as summarised below.
|
||||
|
||||
The setup process at https://ioncube24.com automatically gives the settings
|
||||
that you need to get started, but you may wish to make changes yourself
|
||||
once setup. The default values are given with each example.
|
||||
|
||||
### Global settings
|
||||
|
||||
INI entry: ic24.enable ; default 0
|
||||
|
||||
Purpose: Enable or disable all ionCube24 features.
|
||||
|
||||
This defaults to 0 (off), and in this case no ionCube24 behaviour is
|
||||
activated.
|
||||
|
||||
Example:
|
||||
|
||||
ic24.enable = 1
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.api_access_key ; provided during setup
|
||||
|
||||
Purpose: An authentication key for adminstration requests.
|
||||
|
||||
This value is provided when adding a server to ionCube24.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.api_check_ip ; default 1
|
||||
|
||||
Purpose: Specify whether the IP for admin requests should be validated
|
||||
|
||||
If set, ionCube24 refuses access to API functions unless the calling IP
|
||||
is a known ionCube IP address. This option should be left with the
|
||||
default setting unless web requests pass through a proxy and your site
|
||||
appears to be accessed from the IP of the proxy instead of ionCube. Note
|
||||
that access to API functions will still be authenticated by access key.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.api_max_timeout ; default 7
|
||||
|
||||
Purpose: Maximum timeout period when sending notifications to ionCube24.
|
||||
|
||||
The actual period is adaptive so that a brief increase in typical latency
|
||||
will favour a timeout followed by a retry rather than a longer than usual
|
||||
timeout.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.home_dir ; no default
|
||||
|
||||
Purpose: The home directory for ionCube24 related system files.
|
||||
|
||||
A location outside of the web root is recommended. It should be writable
|
||||
by the web server during startup.
|
||||
|
||||
Example:
|
||||
|
||||
ic24.home_dir = /var/www/ic24_home
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.update_domains_retry_interval ; default 30
|
||||
|
||||
Purpose: The number of seconds to wait before retrying a fetch of the set
|
||||
of domains being managed.
|
||||
|
||||
|
||||
### Security related settings
|
||||
|
||||
INI entry: ic24.sec.enable ; default "auto"
|
||||
|
||||
Purpose: Enable the intrusion protection feature of ionCube24.
|
||||
|
||||
Accepted values:
|
||||
|
||||
* "auto" (default) - allow setting from the ionCube24 control panel.
|
||||
* 1 : always enabled.
|
||||
* 0 : disabled.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.initial_state ; default 1
|
||||
|
||||
Purpose: The default for whether security should be enabled or
|
||||
disabled. The default is to enable protection. Any files on a protected
|
||||
domain will become blocked if they are changed, so setting this to 0 will
|
||||
avoid accidental blocking when using ionCube24 for the first time.
|
||||
Protection may be enabled and disabled using the ionCube24 control panel and
|
||||
also via the User API.
|
||||
|
||||
Accepted values:
|
||||
|
||||
* 1 : protection will be active when ionCube24 initialises.
|
||||
* 0 : protection will be disabled.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.initial_action ; default "block"
|
||||
|
||||
Purpose: The initial setting for how new and modified files should be
|
||||
treated when about to execute. The default is to block. The action is taken
|
||||
only if protection is enabled, and the setting may be changed via the
|
||||
ionCube24 control panel.
|
||||
|
||||
Accepted values:
|
||||
|
||||
* "block" : prevent execution of new or modified files
|
||||
* "allow" : allow execution of new or modified files
|
||||
|
||||
Note that depending on the notification settings, a notification may still
|
||||
be generated when a new or modified file is about to execute even if it is
|
||||
not blocked.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.initial_notify ; default "always"
|
||||
|
||||
Purpose: The initial setting for whether a notification is generated the
|
||||
first time an unacknowledged new or modified file is attempted to be
|
||||
executed. This setting can be changed via the ionCube24 control panel.
|
||||
|
||||
Accepted values:
|
||||
|
||||
* "always" : always notify of a new modification
|
||||
* "once" : only the first detected modification is reported
|
||||
* "never" : never notify of new and modified files
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.exclusion_key ; provided during setup
|
||||
|
||||
Purpose: A key that if present at the start of a file, will identify the
|
||||
file as trusted. This value is provided when adding a server to ionCube24.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.trusted_include_paths ; no default
|
||||
|
||||
Purpose: List paths from where files can be included and automatically
|
||||
trusted.
|
||||
|
||||
Example:
|
||||
|
||||
ic24.sec.trusted_include_paths = "/var/cache:/var/cache2"
|
||||
|
||||
Directories can be excluded from the list by prefixing with a minus
|
||||
character -. e.g.
|
||||
|
||||
"/var/cache:-/var/cache/subdir"
|
||||
|
||||
This is useful if your site creates and/or modifies files by itself from
|
||||
time to time, e.g. in a cache directory. Requests that *directly* access
|
||||
files on a trusted include path will be blocked but the file itself will
|
||||
not be blocked, so requests that use the file as intended will still work.
|
||||
See ioncube24.com for more details once signed up. As an alternative, if
|
||||
possible we recommend producing files that include the exclusion key.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.block_uploaded_files ; default 1
|
||||
|
||||
Purpose: If set, block any uploaded files in ionCube24 that are processed
|
||||
using the standard PHP mechanism for uploaded files. This applies even if
|
||||
the file is subsequently included and where included files being
|
||||
automatically approved with the previous setting.
|
||||
|
||||
----------
|
||||
|
||||
INI entry: ic24.sec.block_stdin ; default 1
|
||||
|
||||
Purpose: Refuse code that PHP sees via stdin. If disabled, code via
|
||||
stdin will run without security checking as there is no filepath. This
|
||||
setting should be left on as PHP would normally never receive a script via
|
||||
stdin.
|
||||
|
||||
### PHP Error reporting settings
|
||||
|
||||
INI entry: ic24.phperr.enable ; default "auto"
|
||||
|
||||
Purpose: Enable reporting of PHP errors to ionCube24. When enabled, any
|
||||
non-ignored errors are reported to ionCube24 in realtime, triggering
|
||||
alerting so errors can be investigated as necessary.
|
||||
|
||||
Accepted values:
|
||||
|
||||
* "auto" (default) - allow setting from the ionCube24 control panel.
|
||||
* 1 : always enabled.
|
||||
* 0 : disabled.
|
||||
|
||||
----------
|
||||
|
||||
### Deprecated settings
|
||||
|
||||
Deprecated settings are subject to removal in a future
|
||||
release.
|
||||
|
||||
INI entry: ic24.phperr.ignore ; default 0
|
||||
|
||||
Purpose: Specify default error levels to always ignore for all domains.
|
||||
|
||||
Note that default and per-domain errors to ignore can also be set via the
|
||||
web interface, and are combined with this setting. Leaving this unset and
|
||||
using the web interface is recommended for maximum flexibility.
|
||||
|
||||
Example:
|
||||
|
||||
ic24.phperr.ignore = E_NOTICE | E_DEPRECATED
|
||||
|
||||
(c) ionCube Ltd. 2024
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,158 @@
|
|||
<?php
|
||||
/*
|
||||
|
||||
Call Recordings Maintenance
|
||||
- Convert WAV to MP3
|
||||
- Reduce the file size
|
||||
- Move recordings
|
||||
- Move the recording from the source to a destination directory.
|
||||
|
||||
At the top of the file need to define or set the destination_directory...
|
||||
|
||||
In my case I put the file in /usr/src and then run manually like this.
|
||||
/usr/bin/php /usr/src/fusionpbx-install.sh/debian/resources/maintenance/call_recordings.php
|
||||
|
||||
Debian
|
||||
crontab -e
|
||||
0 * * * * /usr/bin/php /usr/src/fusionpbx-install.sh/debian/resources/maintenance/call_recordings.php > /dev/null 2>&1
|
||||
|
||||
*/
|
||||
|
||||
//add the document root to the included path
|
||||
if (defined('STDIN')) {
|
||||
$config_glob = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
|
||||
$conf = parse_ini_file($config_glob[0]);
|
||||
set_include_path($conf['document.root']);
|
||||
}
|
||||
else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//set pre-defined variables
|
||||
$debug = true;
|
||||
$action = 'convert'; //convert, move or both
|
||||
$audio_format = 'wav';
|
||||
$preferred_command = 'lame'; //mpg123, lame
|
||||
|
||||
//includes files
|
||||
require_once "resources/require.php";
|
||||
|
||||
//create the database connection
|
||||
$database = new database;
|
||||
|
||||
//use settings object instead of session
|
||||
$settings = new settings(['database' => $database]);
|
||||
|
||||
//set the source and destination paths
|
||||
$source_path = $settings->get('switch','recordings', '');
|
||||
|
||||
//set the destination_path
|
||||
if ($action == 'move' || $action == 'both') {
|
||||
$destination_path = $settings->get('call_recordings','destination_path', null);
|
||||
}
|
||||
|
||||
//make sure the directory exists
|
||||
if ($action == 'move' || $action == 'both') {
|
||||
system('mkdir -p '.$destination_path);
|
||||
}
|
||||
|
||||
//get the xml cdr call recordings.
|
||||
$sql = "select xml_cdr_uuid, domain_uuid, domain_name, ";
|
||||
$sql .= "record_path, record_name, direction, start_stamp, ";
|
||||
$sql .= "caller_id_name, caller_id_number from v_xml_cdr ";
|
||||
//$sql .= "where start_stamp > NOW() - INTERVAL '7 days' ";
|
||||
$sql .= "where true ";
|
||||
if ($action == 'convert' || $action == 'both') {
|
||||
$sql .= "and record_name like '%.wav' ";
|
||||
}
|
||||
if ($action == 'move' || $action == 'both') {
|
||||
$sql .= "and length(record_path) > 0 ";
|
||||
$sql .= "and substr(record_path, 1, length(:source_path)) = :source_path ";
|
||||
$parameters['source_path'] = $source_path;
|
||||
}
|
||||
$sql .= "order by start_stamp desc ";
|
||||
if ($debug) { echo $sql."\n"; }
|
||||
$call_recordings = $database->select($sql, $parameters, 'all');
|
||||
unset($parameters);
|
||||
|
||||
//process the changes
|
||||
foreach ($call_recordings as $row) {
|
||||
|
||||
//set the record_name
|
||||
$record_name = $row['record_name'];
|
||||
|
||||
//set the source_path
|
||||
$source_path = realpath($row['record_path']);
|
||||
|
||||
//get the file name without the file extension
|
||||
$path_parts = pathinfo($source_path.'/'.$record_name);
|
||||
|
||||
//convert the audio file from wav to mp3
|
||||
if ($action == 'convert' || $action == 'both') {
|
||||
|
||||
if ($debug) {
|
||||
if (!file_exists($source_path."/".$record_name)) {
|
||||
//echo "file not found: ".$source_path."/".$record_name."\n";
|
||||
}
|
||||
else {
|
||||
echo "found file: ".$source_path."/".$record_name."\n";
|
||||
}
|
||||
}
|
||||
if (file_exists($source_path."/".$record_name)) {
|
||||
//build the run the mpg123 command
|
||||
if ($preferred_command == 'mpg123' && !file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
||||
$command = "mpg123 -w ".$source_path."/".$record_name." ".$source_path."/".$path_parts['filename'].".mp3\n";
|
||||
if ($debug) { echo $command."\n"; }
|
||||
system($command);
|
||||
}
|
||||
|
||||
//build the run the mpg123 command
|
||||
if ($preferred_command == 'lame' && !file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
||||
$command = "lame -b 128 ".$source_path."/".$record_name." ".$source_path."/".$path_parts['filename'].".mp3\n";
|
||||
if ($debug) { echo $command."\n"; }
|
||||
system($command);
|
||||
}
|
||||
|
||||
//update the record name to use the new file extension
|
||||
if (file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
||||
//make sure the mp3 file exists and then delete the wav file
|
||||
unlink($source_path."/".$path_parts['filename'].".wav");
|
||||
|
||||
//set the record_name with the new file extension
|
||||
$record_name = $path_parts['filename'].".mp3";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//move the files
|
||||
if ($action == 'move' || $action == 'both') {
|
||||
//get break down the date to year, month and day
|
||||
$start_time = strtotime($row['start_stamp']);
|
||||
$start_year = date("Y", $start_time);
|
||||
$start_month = date("M", $start_time);
|
||||
$start_day = date("d", $start_time);
|
||||
|
||||
//move the recording from the old to the new directory
|
||||
$old_path = realpath($row['record_path']);
|
||||
$new_path = realpath($destination_path).'/'.$row['domain_name'].'/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
|
||||
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);
|
||||
}
|
||||
|
||||
//update the database to the new directory
|
||||
$sql = "update v_xml_cdr set \n";
|
||||
if ($action == 'move' || $action == 'both') {
|
||||
$sql .= "record_path = '".$new_path."' \n";
|
||||
}
|
||||
if ($action == 'convert' || $action == 'both') {
|
||||
$sql .= "record_name = '".$path_parts['filename'].".mp3'\n";
|
||||
}
|
||||
$sql .= "where xml_cdr_uuid = '".$row['xml_cdr_uuid']."';\n";
|
||||
if ($debug) { echo $sql."\n"; }
|
||||
$database->execute($sql);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
check process freeswitch with pidfile /run/freeswitch/freeswitch.pid
|
||||
start program = "/usr/src/fusionpbx-install.sh/debian/resources/monit/./shell.sh"
|
||||
stop program = "/usr/bin/freeswitch -stop"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
mkdir -p /var/run/freeswitch
|
||||
chown -R www-data:www-data /var/run/freeswitch
|
||||
/usr/bin/freeswitch -nc -u www-data -g www-data -nonat
|
||||
|
|
@ -41,6 +41,15 @@ fi
|
|||
if [ ."$php_version" = ."7.4" ]; then
|
||||
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.4-fpm.sock;#g'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.1" ]; then
|
||||
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.1-fpm.sock;#g'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.2" ]; then
|
||||
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.2-fpm.sock;#g'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.3" ]; then
|
||||
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.3-fpm.sock;#g'
|
||||
fi
|
||||
ln -s /etc/nginx/sites-available/fusionpbx /etc/nginx/sites-enabled/fusionpbx
|
||||
|
||||
#self signed certificate
|
||||
|
|
|
|||
|
|
@ -13,6 +13,18 @@ verbose "Configuring PHP"
|
|||
|
||||
#add the repository
|
||||
if [ ."$os_name" = ."Ubuntu" ]; then
|
||||
#24.04.x - /*noble/
|
||||
if [ ."$os_codename" = ."noble" ]; then
|
||||
echo "Ubuntu 24.04 LTS\n"
|
||||
which add-apt-repository || apt-get install -y software-properties-common
|
||||
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
||||
fi
|
||||
#22.04.x - /*jammy/
|
||||
if [ ."$os_codename" = ."jammy" ]; then
|
||||
echo "Ubuntu 22.04 LTS\n"
|
||||
which add-apt-repository || apt-get install -y software-properties-common
|
||||
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
||||
fi
|
||||
#20.04.x - /*bionic/
|
||||
if [ ."$os_codename" = ."focal" ]; then
|
||||
echo "Ubuntu 20.04 LTS\n"
|
||||
|
|
@ -53,6 +65,15 @@ fi
|
|||
if [ ."$php_version" = ."7.4" ]; then
|
||||
apt-get install -y php7.4 php7.4-cli php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring
|
||||
fi
|
||||
if [ ."$php_version" = ."8.1" ]; then
|
||||
apt-get install -y php8.1 php8.1-cli php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring
|
||||
fi
|
||||
if [ ."$php_version" = ."8.2" ]; then
|
||||
apt-get install -y php8.2 php8.2-cli php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-imap php8.2-xml php8.2-gd php8.2-mbstring
|
||||
fi
|
||||
if [ ."$php_version" = ."8.3" ]; then
|
||||
apt-get install -y php8.3 php8.3-cli php8.3-fpm php8.3-pgsql php8.3-sqlite3 php8.3-odbc php8.3-curl php8.3-imap php8.3-xml php8.3-gd php8.3-mbstring
|
||||
fi
|
||||
|
||||
#update config if source is being used
|
||||
if [ ."$php_version" = ."5" ]; then
|
||||
|
|
@ -75,6 +96,18 @@ if [ ."$php_version" = ."7.4" ]; then
|
|||
verbose "version 7.4"
|
||||
php_ini_file='/etc/php/7.4/fpm/php.ini'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.1" ]; then
|
||||
verbose "version 8.1"
|
||||
php_ini_file='/etc/php/8.1/fpm/php.ini'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.2" ]; then
|
||||
verbose "version 8.2"
|
||||
php_ini_file='/etc/php/8.2/fpm/php.ini'
|
||||
fi
|
||||
if [ ."$php_version" = ."8.3" ]; then
|
||||
verbose "version 8.3"
|
||||
php_ini_file='/etc/php/8.3/fpm/php.ini'
|
||||
fi
|
||||
sed 's#post_max_size = .*#post_max_size = 80M#g' -i $php_ini_file
|
||||
sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i $php_ini_file
|
||||
sed 's#;max_input_vars = .*#max_input_vars = 8000#g' -i $php_ini_file
|
||||
|
|
@ -102,6 +135,15 @@ fi
|
|||
if [ ."$php_version" = ."7.4" ]; then
|
||||
systemctl restart php7.4-fpm
|
||||
fi
|
||||
if [ ."$php_version" = ."8.1" ]; then
|
||||
systemctl restart php8.1-fpm
|
||||
fi
|
||||
if [ ."$php_version" = ."8.2" ]; then
|
||||
systemctl restart php8.2-fpm
|
||||
fi
|
||||
if [ ."$php_version" = ."8.3" ]; then
|
||||
systemctl restart php8.3-fpm
|
||||
fi
|
||||
#init.d
|
||||
#/usr/sbin/service php5-fpm restart
|
||||
#/usr/sbin/service php7.0-fpm restart
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ cd "$(dirname "$0")"
|
|||
|
||||
#includes
|
||||
. ./config.sh
|
||||
. ./environment.sh
|
||||
|
||||
if [ .$switch_source = .true ]; then
|
||||
if [ ."$switch_branch" = "master" ]; then
|
||||
|
|
|
|||
|
|
@ -10,12 +10,7 @@ cd "$(dirname "$0")"
|
|||
apt update && apt upgrade -y
|
||||
|
||||
# install dependencies
|
||||
apt install -y autoconf automake devscripts g++ git-core libncurses5-dev libtool make libjpeg-dev \
|
||||
pkg-config flac libgdbm-dev libdb-dev gettext sudo equivs mlocate git dpkg-dev libpq-dev \
|
||||
liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev \
|
||||
devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev \
|
||||
libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev \
|
||||
libavformat-dev libswscale-dev libspandsp-dev pip libpq-dev libvlc-dev uuid-dev sox libsox-fmt-all
|
||||
apt install -y autoconf automake devscripts g++ git-core libncurses5-dev libtool make libjpeg-dev pkg-config flac libgdbm-dev libdb-dev gettext sudo equivs plocate git dpkg-dev libpq-dev liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev libavformat-dev libswscale-dev libspandsp-dev pip libpq-dev libvlc-dev uuid-dev sox libsox-fmt-all
|
||||
|
||||
# additional dependencies
|
||||
apt install -y swig3.0 unzip sox wget
|
||||
|
|
@ -79,12 +74,12 @@ mv freeswitch-$switch_version.-release freeswitch-$switch_version
|
|||
cd /usr/src/freeswitch-$switch_version
|
||||
|
||||
# bootstrap is needed if using git
|
||||
#./bootstrap.sh -j
|
||||
./bootstrap.sh -j
|
||||
|
||||
# enable required modules
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_callcenter:applications/mod_callcenter:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:'
|
||||
sed -i /usr/src/freeswitch-$switch_version-$switch_version/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#applications/mod_curl:applications/mod_curl:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'#formats/mod_pgsql:formats/mod_pgsql:'
|
||||
|
|
@ -93,6 +88,7 @@ sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'endpoints/mod_vert
|
|||
|
||||
#disable module or install dependency libks to compile signalwire
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'applications/mod_signalwire:#applications/mod_signalwire:'
|
||||
sed -i /usr/src/freeswitch-$switch_version/modules.conf -e s:'applications/mod_av:#applications/mod_av:'
|
||||
|
||||
# prepare the build
|
||||
#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --disable-fhs
|
||||
|
|
|
|||
Loading…
Reference in New Issue