diff -Nur smeserver-freepbx-0.1.old/createlinks smeserver-freepbx-0.1/createlinks --- smeserver-freepbx-0.1.old/createlinks 2016-05-16 00:29:46.644000000 -0400 +++ smeserver-freepbx-0.1/createlinks 2016-05-16 00:55:12.434000000 -0400 @@ -30,7 +30,6 @@ # Events links my $event = 'freepbx-update'; -#templates2events("/etc/amportal.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/asterisk/asterisk.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save)); @@ -40,7 +39,7 @@ templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save)); event_link("freepbx-checkinstall", $event, "10"); -#event_link("freepbx-applypatch", $event, "20"); +event_link("freepbx-amportal.conf", $event, "91"); event_link("freepbx-clean-crontab", $event, "40"); event_link("freepbx-dump-astdb", "pre-backup", "30"); diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/events/actions/freepbx-amportal.conf smeserver-freepbx-0.1/root/etc/e-smith/events/actions/freepbx-amportal.conf --- smeserver-freepbx-0.1.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-freepbx-0.1/root/etc/e-smith/events/actions/freepbx-amportal.conf 2016-05-16 00:51:40.388000000 -0400 @@ -0,0 +1,16 @@ +#!/bin/bash + +# Change FreePBX database settings that should have come from /etc/amportal.conf, +# this is a dynamic template for FreePBX > 1.9 as it update the file on the fly, and also the db +FPBX_SETTING_PATH="/var/lib/asterisk/bin/freepbx_setting" +$FPBX_SETTING_PATH DISABLE_CSS_AUTOGEN 1 +$FPBX_SETTING_PATH CHECKREFERER 0 +$FPBX_SETTING_PATH AUTHTYPE none +$FPBX_SETTING_PATH AMPWEBROOT /opt/freepbx +$FPBX_SETTING_PATH MODULEADMINWGET 1 +$FPBX_SETTING_PATH DYNAMICHINTS 1 +$FPBX_SETTING_PATH ARI_ADMIN_PASSWORD $(/sbin/e-smith/db configuration getprop freepbx AriPassword) +$FPBX_SETTING_PATH AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword) + +# now regenrate the amportal.conf from mysql +/var/lib/asterisk/bin/fwconsole r diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/10database smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/10database --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/10database 2008-08-06 07:37:19.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/10database 1969-12-31 19:00:00.000000000 -0500 @@ -1,35 +0,0 @@ -{ -my $dbuser = ${'freepbx'}{'DbUser'} || 'asteriskuser'; -my $dbname = ${'freepbx'}{'DbName'} || 'asterisk'; -my $dbpass = ${'freepbx'}{'DbPassword'} || 'amp109'; - -$OUT .=<<"HERE"; - -# MySQL database configuration - -# AMPDBUSER: the user to connect to the database named '$dbname' -AMPDBUSER=$dbuser - -# AMPDBPASS: the password for AMPDBUSER -AMPDBPASS=$dbpass - -# AMPDBNAME: name of the database to use -AMPDBNAME=$dbname - -# AMPDBHOST: the host to connect to the database named '$dbname' -AMPDBHOST=localhost - -# AMPDBENGINE: the type of database to use -AMPDBENGINE=mysql - -# CDR DB Settings: Only used if you dont use the default values provided by freepbx. -# CDRDBHOST: hostname of db server if not the same as AMPDBHOST -# CDRDBPORT: Port number for db host -# CDRDBUSER: username to connect to db with if its not the same as AMPDBUSER -# CDRDBPASS: password for connecting to db if its not the same as AMPDBPASS -# CDRDBNAME: name of database used for cdr records -# CDRDBTYPE: mysql or postgres mysql is default -# CDRDBTABLENAME: Name of the table in the db where the cdr is stored cdr is default - -HERE -} diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/15manager smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/15manager --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/15manager 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/15manager 1969-12-31 19:00:00.000000000 -0500 @@ -1,13 +0,0 @@ -{ -my $managerpass = ${'freepbx'}{'ManagerPassword'} || 'amp111'; - -$OUT.=<<"HERE"; - -# AMPMGRUSER: the user to access the Asterisk manager interface -AMPMGRUSER=admin - -# AMPMGRPASS: the password for AMPMGRUSER -AMPMGRPASS=$managerpass - -HERE -} diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/20paths smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/20paths --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/20paths 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/20paths 1969-12-31 19:00:00.000000000 -0500 @@ -1,21 +0,0 @@ - -# AMPBIN: where command line scripts live -AMPBIN=/var/lib/asterisk/bin - -#AMPSBIN: where (root) command line scripts live -AMPSBIN=/usr/local/sbin - -# AMPWEBROOT: the path to Apache's webroot (leave off trailing slash) -AMPWEBROOT=/opt/freepbx - -# AMPCGIBIN: the path to Apache's cgi-bin dir (leave off trailing slash) -AMPCGIBIN=/var/www/cgi-bin - -ASTETCDIR=/etc/asterisk -ASTMODDIR=/usr/lib/asterisk/modules -ASTVARLIBDIR=/var/lib/asterisk -ASTAGIDIR=/var/lib/asterisk/agi-bin -ASTSPOOLDIR=/var/spool/asterisk -ASTRUNDIR=/var/run/asterisk -ASTLOGDIR=/var/log/asterisk - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/25fop smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/25fop --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/25fop 2016-05-16 00:29:46.611000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/25fop 1969-12-31 19:00:00.000000000 -0500 @@ -1,16 +0,0 @@ - -# FOPWEBROOT:web root for the Flash Operator Panel -FOPWEBROOT=/opt/freepbx/panel - -# FOPPASSWORD: the secret code for performing transfers and hangups in the Flash Operator Panel -FOPPASSWORD={${'fop'}{'Password'} || 'passw0rd';} - -# FOPSORT: FOP should sort extensions by Last Name [lastname] or by Extension [extension] -FOPSORT=extension - -# FOPRUN: set to true if you want FOP started by freepbx_engine (amportal_start), false otherwise -FOPRUN={((${'fop'}{'status'} || 'disabled') eq 'enabled') ? 'true': 'false';} - -FOPDISABLE={((${'fop'}{'status'} || 'disabled') eq 'enabled') ? 'false': 'true';} -# Disables FOP in interface and retrieve_conf. Usefull for sqlite3 or if you don't want FOP. - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup00general smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup00general --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup00general 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup00general 1969-12-31 19:00:00.000000000 -0500 @@ -1,11 +0,0 @@ - -# AMPPROVROOT=/var/ftp /tftpboot -# One or more directories where there are provisioning files that should be included in the backup. Currently -# these get backed up only, the FreePBX utility does not automatically restore them. -# -#AMPPROVROOT=/var/ftp /tftpboot -# AMPPROVEXCLUDE=/var/ftp/exclude-from-file-list -# a list of files to exclude, to be used in tar's --exclude-from argument -# -#AMPPROVEXCLUDE=/var/ftp/exclude-from-file-list - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup10ssh smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup10ssh --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup10ssh 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup10ssh 1969-12-31 19:00:00.000000000 -0500 @@ -1,13 +0,0 @@ - -# SSH BACKUP INFO: must have a valid SSHRSAKEY file and server, only supported through -# ssh. SUBDIR is optional and will be created if it does not exist. -# -# If SSHUSER is not set, it will default to the current user which is asterisk in any -# standard configuration. -# -#SSHBACKUP=yes -#SSHUSER=backups -#SSHRSAKEY=/etc/asterisk/backup_rsa -#SSHSUBDIR=mysubdir -#SSHSERVER=mybackupserver.com - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup20ftp smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup20ftp --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/30backup20ftp 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/30backup20ftp 1969-12-31 19:00:00.000000000 -0500 @@ -1,17 +0,0 @@ - -# The following are used to optionally have the freepbx backup program optionally -# send the generated backup to an ftp server -# -# FTPBACKUP=YES to enable -# FTPUSER, FTPPASSWORD, FTPSERVER must be set -# FTPSUBDIR is an optional subdirectory at the ftp server, it will cause ftp to do a cd -# -# There is no error checking so you should check to make sure these are set correctly. The -# ftp is saved after the backup, so it will not cause the local backup file to be effected -# -# FTPBACKUP=yes -#FTPUSER=asterisk -#FTPPASSWORD=password -#FTPSUBDIR=mybackupfolder -#FTPSERVER=myftpserver - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/35guiCustomization smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/35guiCustomization --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/35guiCustomization 2008-08-04 09:17:11.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/35guiCustomization 1969-12-31 19:00:00.000000000 -0500 @@ -1,20 +0,0 @@ - -# SERVERINTITLE if set to true, the browser title will be preceded with the server name. default false -SERVERINTITLE=false - -# AMPADMINLOGO: Defines the logo that is to be displayed at the TOP RIGHT of the admin screen. -# This enables you to customize the look of the administration screen. -# NOTE: images need to be saved in the ..../admin/images directory of your AMP install -# This image should be 55px in height -AMPADMINLOGO=logo.png - -# USECATEGORIES: Controls if the menu items in the admin interface are sorted by category (true), -# or sorted alphebetically with no categories shown (false). Defaults to true. -#USECATEGORIES=false - -# AMPEXTENSIONS: the type of view for extensions admin -# If set to 'deviceanduser' Devices and Users will be administered seperately, and Users will be able to "login" to devices. -# If set to 'extensions' Devices and Users will me administered in a single screen. -AMPEXTENSIONS={((${'freepbx'}{'DeviceAndUser'} || 'disabled') eq 'enabled')? 'deviceanduser': 'extensions';} - - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/40features smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/40features --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/40features 2016-05-16 00:29:46.617000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/40features 1969-12-31 19:00:00.000000000 -0500 @@ -1,59 +0,0 @@ - -# ENABLECW: Enable call waiting by default when an extension is created (DEFAULT is yes) -# Set to 'no' to if you don't want phones to be commissioned with call waiting already -# enabled. The user would then be required to dial the CW feature code (*70 default) to -# enable their phone. Most installations should leave this alone. It allows multi-line -# phones to receive multiple calls on their line appearances. -ENABLECW=yes - -#CWINUSEBUSY: Set to yes for extensions that have CW enabled to report as busy if -# they don't answer (resulting in busy voicemail greeting). Otherwise they simply -# report as no-answer (e.g. busy greeting servers no purpose -CWINUSEBUSY=yes - -# AMPBADNUMBER: Set to false if you do not want the bad-number context generated which -# traps any bogus number or freature code and plays a message to the effect. If you use -# the Early Dial feature on some Grandstream phones, you will want to set this to false -AMPBADNUMBER=true - -# If CUSTOMASERROR is set to false, then the Destination Registry will not report unknow destinations as errors -# this should be left to the default true and custom destinations should be moved into the new custom apps registry -# CUSTOMASERROR=false - -# if DYNAMICHINTS is set to true, Core will not statically generate hints. Instead it will make a call to the -# AMPBIN php script, generate_hints.php, through an Asteirsk's #exec call. This requires Asterisk.conf to be -# configured with "execincludes=yes" set in the [options] section. -DYNAMICHINTS=false - -# XTNCONFLICTABORT, BADDESTABORT -# setting either of these to true will result in retrieve_conf aborting during a reload if an extension -# conflict is detected or a destination is detected. It is usually better to allow the reload to go -# through and then correct the problem but these can be set if a more strict behavior is desired -# both default to false if not set -XTNCONFLICTABORT=false -BADDESTABORT=false - -# USEDEVSTATE = true|false # DEFAULT VALUE false -# If this is set, it assumes that you are running Asterisk 1.4 or higher and want to take advantage of the -# func_devstate.c backport available from Asterisk 1.6 which allows custom hints to be created to support -# BLF for server side feature codes such as daynight, followme, etc. -# -USEDEVSTATE={ ( -e '/usr/lib/asterisk/modules/func_devstate.so' || - -e '/usr/lib64/asterisk/modules/func_devstate.so' )? 'true':'false';} - -# MODULEADMINWGET=true|false # DEFAULT VALUE false -# Module Admin normally tries to get its online information through direct file open type calls to URLs that -# go back to the freepbx.org server. If it fails, typically because of content filters in firewalls that don't -# like the way PHP formats the requests, the code will fall back and try a wget to pull the information. -# This will often solve the problem. However, in such environemnts there can be a significant timeout before -# the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this value -# will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls. -# -MODULEADMINWGET=false - -# AMPMPG123=true|false # DEFAULT VALUE true -# When set to false, the old MoH behavior is adopted where MP3 files can be loaded and WAV files converted to MP3 -# The new default behavior assumes you have mpg123 loaded as well as sox and will convert MP3 files to WAV. This is -# highly recommended as MP3 files heavily tax the system and can cause instability on a busy phone system. -AMPMPG123={system('/usr/bin/which mpg123 > /dev/null 2>&1') == 0 ? 'true':'false';} - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/45debug smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/45debug --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/45debug 2008-08-06 07:55:48.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/45debug 1969-12-31 19:00:00.000000000 -0500 @@ -1,9 +0,0 @@ -# AMPDISABLELOG=true|false # DEFAULT VALUE true -# Whether or not to invoke the freepbx log facility - -# AMPSYSLOGLEVEL=LOG_EMERG|LOG_ALERT|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_NOTICE|LOG_INFO|LOG_DEBUG|LOG_SQL|SQL # DEFAULT VALUE LOG_ERR -# Where to log if enabled, SQL, LOG_SQL logs to old MySQL table, others are passed to syslog system to determine where to log - -# AMPENABLEDEVELDEBUG=true|false # DEFAULT VALUE false -# Whether or not to include log messages marked as 'devel-debug' in the log system - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/50permissions smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/50permissions --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/50permissions 2008-08-06 08:03:43.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/50permissions 1969-12-31 19:00:00.000000000 -0500 @@ -1,7 +0,0 @@ -# AMPVMUMASK: defaults to 077 allowing only the asterisk user to have any permissions on VM files. If set to something -# like 007, it would allow the group to have permissions. This can be used if setting apache to a different -# user then asterisk, so that the apache user (and thus ARI) can have access to read/write/delete the -# voicemail files. If changed, some of the voicemail directory strucuters may have to be manually changed. -AMPVMUMASK=007 - - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/55dashboardRefresh smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/55dashboardRefresh --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/55dashboardRefresh 2008-09-19 19:40:17.000000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/55dashboardRefresh 1969-12-31 19:00:00.000000000 -0500 @@ -1,10 +0,0 @@ -# These can be used to change the refresh rate of the System Status Panel. Most of -# the stats are updated based on the STATS interval but a few items are checked -# less frequently (such as Astersisk Uptime) based on the INFO value - -# DEFAULT VALUE: 6 -DASHBOARD_STATS_UPDATE_TIME=20 - -# DEFAULT VALUE: 20 -DASHBOARD_INFO_UPDATE_TIME=60 - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/60dahdi smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/60dahdi --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/60dahdi 2016-05-16 00:29:46.583000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/60dahdi 1969-12-31 19:00:00.000000000 -0500 @@ -1,12 +0,0 @@ - -# ZAP2DAHDICOMPAT=true|false -# DEFAULT VALUE: false -# If set to true, FreePBX will check if you have chan_dadhi installed. If so, it will -# automatically use all your ZAP configuration settings (devices and trunks) and -# silently convert them, under the covers, to DAHDI so no changes are needed. The -# GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels. -# This will also keep Zap Channel DIDs working. - -ZAP2DAHDICOMPAT={ ( -e '/usr/lib/asterisk/modules/chan_dahdi.so' || - -e '/usr/lib64/asterisk/modules/chan_dahdi.so' )? 'true':'false';} - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/65check_referer smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/65check_referer --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/65check_referer 2016-05-16 00:29:46.613000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/65check_referer 1969-12-31 19:00:00.000000000 -0500 @@ -1,3 +0,0 @@ - -CHECKREFERER=false - diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/70ari smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/70ari --- smeserver-freepbx-0.1.old/root/etc/e-smith/templates/etc/amportal.conf/70ari 2016-05-16 00:29:46.622000000 -0400 +++ smeserver-freepbx-0.1/root/etc/e-smith/templates/etc/amportal.conf/70ari 1969-12-31 19:00:00.000000000 -0500 @@ -1,14 +0,0 @@ -{ -my $aripass = ${'freepbx'}{'AriPassword'} || 'azerty'; - -$OUT.=<<"HERE"; - -# This is the default admin name used to allow an administrator to login to ARI bypassing all security. -ARI_ADMIN_USERNAME=admin - -# This is the default admin password to allow an administrator to login to ARI bypassing all security. -ARI_ADMIN_PASSWORD=$aripass - -HERE -} -