/[smecontribs]/rpms/smeserver-freepbx/contribs10/smeserver-freepbx-bz11613-sme10.patch
ViewVC logotype

Annotation of /rpms/smeserver-freepbx/contribs10/smeserver-freepbx-bz11613-sme10.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (hide annotations) (download)
Mon Mar 28 03:56:02 2022 UTC (2 years, 5 months ago) by jpp
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +0 -0 lines
FILE REMOVED
14

1 jpp 1.1 diff -Nur --no-dereference smeserver-freepbx-13.old/createlinks smeserver-freepbx-13/createlinks
2     --- smeserver-freepbx-13.old/createlinks 2022-03-24 23:13:37.415000000 -0400
3 jpp 1.7 +++ smeserver-freepbx-13/createlinks 2022-03-27 22:17:06.363000000 -0400
4 jpp 1.5 @@ -2,25 +2,12 @@
5 jpp 1.1
6 jpp 1.5 use esmith::Build::CreateLinks qw(:all);
7    
8     -# Start and stop links
9     +# force default php to php56
10     +safe_symlink("/usr/bin/php56", "root/usr/sbin/php");
11 jpp 1.7 +safe_symlink("/usr/bin/php56", "root/usr/local/sbin/php");
12 jpp 1.1
13     -service_link_enhanced("freepbx", "S98", "7");
14     -service_link_enhanced("freepbx", "K10", "6");
15     -service_link_enhanced("freepbx", "K10", "0");
16     -service_link_enhanced("freepbx", "K10", "1");
17     -
18     -service_link_enhanced("httpd-fpbx", "S86", "7");
19     -service_link_enhanced("httpd-fpbx", "K15", "6");
20     -service_link_enhanced("httpd-fpbx", "K15", "0");
21     -service_link_enhanced("httpd-fpbx", "K15", "1");
22     -
23     -service_link_enhanced("dahdi", "S09", "7");
24     -service_link_enhanced("dahdi", "K16", "6");
25     -service_link_enhanced("dahdi", "K16", "0");
26     -service_link_enhanced("dahdi", "K16", "1");
27 jpp 1.5 -
28 jpp 1.1 -safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx');
29     -safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx');
30     +#safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx');
31     +#safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx');
32    
33     # Panel links
34    
35 jpp 1.5 @@ -37,6 +24,8 @@
36 jpp 1.2 templates2events("/etc/httpd/conf/httpd.conf", $event);
37     templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel));
38     templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save));
39 jpp 1.4 +#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event);
40     +templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event);
41 jpp 1.2
42     event_link("freepbx-checkinstall", $event, "10");
43     event_link("freepbx-checkinstall-backup", $event, "11");
44 jpp 1.5 @@ -48,17 +37,46 @@
45 jpp 1.1 safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
46     safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
47     safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx");
48 jpp 1.4 +safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm");
49 jpp 1.1 +
50     safe_symlink("sigusr1", "root/etc/e-smith/events/logrotate/services2adjust/httpd-fpbx");
51    
52     safe_symlink("sigusr1", "root/etc/e-smith/events/conf-userpanel/services2adjust/httpd-fpbx");
53    
54     # Create empty files
55     -safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/fpbx_access_log");
56     -safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/fpbx_error_log");
57     -safe_touch("root/var/service/httpd-fpbx/down");
58     +#safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/fpbx_access_log");
59     +#safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/fpbx_error_log");
60     +#safe_touch("root/var/service/httpd-fpbx/down");
61    
62     # Create empty directories
63     system("/bin/mkdir -p root/var/service/httpd-fpbx/supervise");
64     system("/bin/mkdir -p root/var/service/httpd-fpbx/log/supervise");
65     system("/bin/mkdir -p root/var/log/httpd-fpbx");
66    
67     +
68     +## systemd install/update
69 jpp 1.6 +$event = 'smeserver-freepbx-update';
70 jpp 1.1 +templates2events("/etc/asterisk/asterisk.conf", $event);
71     +templates2events("/etc/asterisk/cdr_mysql.conf", $event);
72     +templates2events("/etc/asterisk/manager.conf", $event);
73     +templates2events("/etc/logrotate.d/asterisk", $event);
74     +templates2events("/etc/httpd/conf/httpd.conf", $event);
75     +templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event);
76     +templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event);
77 jpp 1.4 +#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event);
78     +templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event);
79     +
80     +
81 jpp 1.1 +event_link("freepbx-checkinstall", $event, "10");
82     +event_link("freepbx-checkinstall-backup", $event, "11");
83     +event_link("freepbx-amportal.conf", $event, "91");
84     +event_link("freepbx-clean-crontab", $event, "40");
85     +
86     +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
87     +safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
88     +safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx");
89 jpp 1.4 +safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm");
90 jpp 1.1 +#action needed in case we have a systemd unit
91     +event_link("systemd-default", $event, "88");
92     +event_link("systemd-reload", $event, "89");
93     +
94     diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/events/actions/freepbx-checkinstall smeserver-freepbx-13/root/etc/e-smith/events/actions/freepbx-checkinstall
95     --- smeserver-freepbx-13.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-03-24 23:13:37.431000000 -0400
96 jpp 1.8 +++ smeserver-freepbx-13/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-03-27 22:48:08.732000000 -0400
97 jpp 1.5 @@ -4,23 +4,24 @@
98 jpp 1.3 DBUSER=$(/sbin/e-smith/db configuration getprop freepbx DbUser)
99     DBPASS=$(/sbin/e-smith/db configuration getprop freepbx DbPassword)
100     CDRDBNAME=$(/sbin/e-smith/db configuration getprop freepbx CdrDbName)
101     -
102     +MANAGERPASSWORD=$(/sbin/e-smith/db configuration getprop freepbx ManagerPassword)
103     +DomainName=$(/sbin/e-smith/db configuration get DomainName)
104    
105     if [ $(mysqlshow | grep -c $DBNAME) -lt 1 ]; then
106     - mysql -e "create database $DBNAME;"
107     + mysql -e "create database $DBNAME CHARACTER SET utf8 COLLATE utf8_unicode_ci ;"
108     mysql -e "grant all privileges on $DBNAME.* to '$DBUSER'@'localhost' identified by '$DBPASS';"
109     mysql -e 'flush privileges;'
110    
111     - if [ -e /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql ]; then
112     - mysql $DBNAME < /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql
113     + if [ -e /usr/share/freepbx/sql/asterisk.sql ]; then
114     + mysql $DBNAME < /usr/share/freepbx/sql/asterisk.sql
115     else
116     - echo "Error: file /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql doesn't exists"
117     + echo "Error: file /usr/share/freepbx/sql/asterisk.sql doesn't exists"
118     exit 1
119     fi
120     fi
121    
122     if [ $(mysqlshow | grep -c $CDRDBNAME) -lt 1 ]; then
123     - mysql -e "create database $CDRDBNAME;"
124     + mysql -e "create database $CDRDBNAME CHARACTER SET utf8 COLLATE utf8_unicode_ci ;"
125     mysql -e "grant all privileges on $CDRDBNAME.* to '$DBUSER'@'localhost' identified by '$DBPASS';"
126     mysql -e 'flush privileges;'
127     if [ -e /usr/share/freepbx/sources/freepbx/installlib/SQL/cdr.sql ]; then
128 jpp 1.8 @@ -31,9 +32,23 @@
129 jpp 1.3 fi
130     fi
131    
132     +# set user and passwords
133     +/usr/bin/mysql $DBNAME -e "INSERT INTO \`admin\` (\`variable\`, \`value\`) VALUES ('email', 'admin\@$DomainName') ON DUPLICATE KEY UPDATE \`value\` = 'admin\@$DomainName';"
134     +/usr/bin/mysql $DBNAME -e "INSERT INTO \`ampusers\` (\`username\`, \`password_sha1\`, \`extension_low\`, \`extension_high\`, \`deptname\`, \`sections\`) VALUES
135     +('admin', sha1('$MANAGERPASSWORD '), '', '', '', 0x2a) ON DUPLICATE KEY UPDATE \`password_sha1\` = sha1('$ManagerPassword ');"
136     +
137     # Chown dir to allow user asterisk to create its files
138     chown asterisk:asterisk /var/lib/asterisk
139 jpp 1.5
140 jpp 1.3 +# workaround as freepbx is expecting them in /var not /usr/share
141 jpp 1.8 +cd /var/lib/asterisk
142     +if [[ ! -d /var/lib/asterisk/documentation ]]; then ln -s /usr/share/asterisk/documentation ; fi
143     +if [[ ! -d /var/lib/asterisk/moh ]]; then ln -s /usr/share/asterisk/moh ; fi
144     +if [[ ! -d /var/lib/asterisk/sounds ]]; then ln -s /usr/share/asterisk/sounds/ ; fi
145     +mkdir /usr/share/asterisk/sounds/tmp
146     +chown asterisk: /usr/share/asterisk/sounds/tmp
147     +chown asterisk: /usr/share/asterisk/sounds/ /usr/share/asterisk/moh
148 jpp 1.5 +
149 jpp 1.3 # Run the install script only if it's a new install
150     # Upgrades have to be done through freePBX and the online repository
151 jpp 1.5 if [ ! -d /opt/freepbx/admin ]; then
152 jpp 1.8 @@ -44,7 +59,11 @@
153 jpp 1.1 ./start_asterisk start >> /root/freepbx_install.log 2>&1
154     echo "" >> /root/freepbx_install.log
155     echo "Installing FreePBX..." >> /root/freepbx_install.log
156     - echo "a" | ./install --webroot="/opt/freepbx" --dbengine="mysql" --dbname="freepbxdb" --dbuser="freepbxuser" --dbpass="$DBPASS" -n >> /root/freepbx_install.log 2>&1
157 jpp 1.3 + echo "a" | ./install --webroot="/opt/freepbx" \
158 jpp 1.1 + --dbengine="mysql" --dbname="freepbxdb" --dbuser="freepbxuser" --dbpass="$DBPASS" -n \
159     + --cdrdbname="$CDRDBNAME" --astmoddir=/usr/lib64/asterisk/modules/ \
160 jpp 1.3 + --astagidir=/usr/share/asterisk/agi-bin/ --ampsbin=/usr/sbin --ampcgibin=/opt/freepbx/cgi-bin \
161 jpp 1.1 + >> /root/freepbx_install.log 2>&1
162     else
163     echo "error: /usr/share/freepbx/sources/freepbx/ doesn't exists"
164     exit 1
165 jpp 1.8 @@ -72,6 +91,6 @@
166 jpp 1.5 # update modules
167 jpp 1.3 /usr/sbin/fwconsole ma upgrade framework
168     /usr/sbin/fwconsole ma upgradeall -R standard -R extended
169 jpp 1.5 -/usr/sbin/fwconsole ma refreshsignatures
170 jpp 1.3 -
171 jpp 1.5 +/usr/sbin/fwconsole ma refreshsignatures
172     +/usr/sbin/fwconsole ma downloadinstall userman certman ucp
173 jpp 1.3 exit 0
174 jpp 1.5 diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/asterisk/asterisk.conf/10dirs smeserver-freepbx-13/root/etc/e-smith/templates/etc/asterisk/asterisk.conf/10dirs
175     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/asterisk/asterisk.conf/10dirs 2016-06-13 08:03:08.000000000 -0400
176     +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/asterisk/asterisk.conf/10dirs 2022-03-27 21:39:15.866000000 -0400
177     @@ -3,7 +3,8 @@
178     astmoddir => { return '/usr/lib64/asterisk/modules' if -d '/usr/lib64/asterisk/modules';
179     return '/usr/lib/asterisk/modules' if -d '/usr/lib/asterisk/modules'; }
180     astvarlibdir => /var/lib/asterisk
181     -astdatadir => /var/lib/asterisk
182     +astdatadir => { return '/var/lib/asterisk' if -d '/var/lib/asterisk/documentation' ;
183     + return '/usr/share/asterisk' if -d '/usr/share/asterisk/documentation';}
184     astagidir => /var/lib/asterisk/agi-bin
185     astspooldir => /var/spool/asterisk
186     astrundir => /var/run/asterisk
187 jpp 1.3 diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/e-smith/sql/init/30freepbx_mysql_create_database smeserver-freepbx-13/root/etc/e-smith/templates/etc/e-smith/sql/init/30freepbx_mysql_create_database
188     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/e-smith/sql/init/30freepbx_mysql_create_database 2016-06-13 08:03:08.000000000 -0400
189     +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/e-smith/sql/init/30freepbx_mysql_create_database 2022-03-27 16:11:55.804000000 -0400
190     @@ -11,18 +11,18 @@
191     #! /bin/sh
192    
193     if [ ! -d /var/lib/mysql/$dbname ]; then
194     - mysqladmin create $dbname
195     + mysql -e "create database $dbname CHARACTER SET utf8 COLLATE utf8_unicode_ci ;"
196    
197     - if [ -e /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql ]; then
198     - mysql $dbname < /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql
199     + if [ -e /usr/share/freepbx/sql/asterisk.sql ]; then
200     + mysql $dbname < /usr/share/freepbx/sql/asterisk.sql
201     else
202     - echo "Error: file /usr/share/freepbx/sources/freepbx/installlib/SQL/asterisk.sql doesn't exists"
203     + echo "Error: file /usr/share/freepbx/sql/asterisk.sql doesn't exists"
204     exit 1
205     fi
206     fi
207    
208     if [ ! -d /var/lib/mysql/$cdrdbname ]; then
209     - mysqladmin create $cdrdbname
210     + mysql -e "create database $cdrdbname CHARACTER SET utf8 COLLATE utf8_unicode_ci ;"
211     if [ -e /usr/share/freepbx/sources/freepbx/installlib/SQL/cdr.sql ]; then
212     mysql $cdrdbname < /usr/share/freepbx/sources/freepbx/installlib/SQL/cdr.sql
213     else
214     @@ -38,45 +38,8 @@
215     /usr/bin/mysql <<EOF
216     USE mysql;
217    
218     -REPLACE INTO user (
219     - host,
220     - user,
221     - password)
222     - VALUES (
223     - 'localhost',
224     - '$dbuser',
225     - PASSWORD ('$dbpass'));
226     -
227     -
228     -REPLACE INTO db (
229     - host,
230     - db,
231     - user,
232     - select_priv, insert_priv, update_priv, delete_priv,
233     - create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
234     - grant_priv, lock_tables_priv, references_priv)
235     - VALUES (
236     - 'localhost',
237     - '$dbname',
238     - '$dbuser',
239     - 'Y', 'Y', 'Y', 'Y',
240     - 'Y', 'Y', 'Y', 'Y', 'Y',
241     - 'N', 'Y', 'Y');
242     -REPLACE INTO db (
243     - host,
244     - db,
245     - user,
246     - select_priv, insert_priv, update_priv, delete_priv,
247     - create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
248     - grant_priv, lock_tables_priv, references_priv)
249     - VALUES (
250     - 'localhost',
251     - '$cdrdbname',
252     - '$dbuser',
253     - 'Y', 'Y', 'Y', 'Y',
254     - 'Y', 'Y', 'Y', 'Y', 'Y',
255     - 'N', 'Y', 'Y');
256     -
257     +GRANT ALL PRIVILEGES ON ${dbname} TO '$dbuser'\@'localhost' identified by '$dbpass';
258     +GRANT ALL PRIVILEGES ON ${cdrdbname} TO '$dbuser'\@'localhost' identified by '$dbpass';
259    
260     FLUSH PRIVILEGES;
261    
262 jpp 1.1 diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/20Modules smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/20Modules
263     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/20Modules 2016-06-13 08:03:08.000000000 -0400
264 jpp 1.3 +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/20Modules 2022-03-27 16:11:53.875000000 -0400
265     @@ -20,6 +20,13 @@
266     env
267     log_config
268     mime
269     + proxy
270     + proxy_fcgi
271     + authz_core
272     + authn_core
273     + unixd
274     + systemd
275     + mpm_prefork
276     negotiation
277     status
278     info
279     @@ -50,25 +57,10 @@
280 jpp 1.1 $OUT .= "LoadModule ${_}_module modules/mod_${_}.so\n";
281     }
282    
283     -if (exists $php{status} and $php{status} eq "enabled"){
284     - my $modphp = '4';
285     - if ( -r "/usr/lib/httpd/modules/libphp5.so" || -r "/usr/lib64/httpd/modules/libphp5.so" ){
286     - $modphp = '5';
287     - }
288     - $OUT .= "LoadModule php".$modphp."_module modules/libphp".$modphp.".so\n";
289     -}
290 jpp 1.3
291 jpp 1.1 -$OUT .= <<HERE;
292 jpp 1.3 +# we do not use php module anymore, but php-fpm
293    
294 jpp 1.1 -<IfModule mod_php4.c>
295     - AddIcon /icons/php4.gif .php3 .php4 .php .phtml
296     - AddIcon /icons/phps.gif .phps
297     -</IfModule>
298     -
299     -<IfModule mod_php5.c>
300     - AddIcon /icons/php5.gif .php3 .php4 .php5 .php .phtml
301     - AddIcon /icons/phps.gif .phps
302     -</IfModule>
303 jpp 1.3 +$OUT .= <<HERE;
304 jpp 1.1
305     PidFile /var/run/httpd-fpbx.pid
306     UseCanonicalName off
307 jpp 1.3 @@ -102,7 +94,6 @@
308     AddIconByType (IMG,/icons/image2.gif) image/*
309     AddIconByType (SND,/icons/sound2.gif) audio/*
310     AddIconByType (VID,/icons/movie.gif) video/*
311     -DefaultType text/plain
312     TypesConfig /etc/mime.types
313    
314     AddEncoding x-compress Z
315     diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/85DefaultAccess smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/85DefaultAccess
316     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/85DefaultAccess 2008-08-04 09:17:11.000000000 -0400
317     +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/85DefaultAccess 2022-03-27 16:11:54.121000000 -0400
318     @@ -5,8 +5,9 @@
319     <Directory />
320     Options None
321     AllowOverride None
322     - order deny,allow
323     - deny from all
324     - allow from none
325     + #order deny,allow
326     + #deny from all
327     + #allow from none
328     + Require all denied
329     </Directory>
330    
331 jpp 1.1 diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root
332     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2016-06-13 08:03:08.000000000 -0400
333 jpp 1.3 +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-03-27 16:11:54.373000000 -0400
334     @@ -1,11 +1,19 @@
335    
336 jpp 1.1 <Directory /opt/freepbx/>
337 jpp 1.3 - AddType application/x-httpd-php .php
338 jpp 1.1 Options +followSymlinks
339     +{
340     + my $key = "freepbx";
341     + my $pool_name = lc $key;
342 jpp 1.3 + my $version = 56;
343 jpp 1.1 + $OUT .="
344     + <FilesMatch .php\$>
345     + SetHandler \"proxy:unix:/var/run/php-fpm/php${version}-${pool_name}.sock|fcgi://localhost\"
346     + </FilesMatch>\n";
347     +}
348     AllowOverride All
349 jpp 1.3 - order deny,allow
350     - deny from all
351     - allow from 127.0.0.1
352 jpp 1.1 - php_admin_value session.save_path /var/lib/php/fpbx-session
353 jpp 1.3 + #order deny,allow
354     + #deny from all
355     + #allow from 127.0.0.1
356     + Require host 127.0.0.1
357 jpp 1.1 </Directory>
358    
359     diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX30Admin smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX30Admin
360     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX30Admin 2022-03-24 23:13:37.426000000 -0400
361 jpp 1.3 +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX30Admin 2022-03-27 16:11:54.582000000 -0400
362     @@ -1,31 +1,26 @@
363 jpp 1.1
364     <Directory /opt/freepbx/admin/>
365     Options +followSymlinks
366     - php_admin_flag allow_url_fopen On
367     - php_admin_value memory_limit 256M
368     - php_admin_value upload_max_filesize 100M
369     - php_admin_value post_max_size 100M
370     - php_admin_flag file_upload On
371     - php_admin_flag magic_quotes_gpc Off
372     </Directory>
373    
374     <Directory /opt/freepbx/admin/modules/>
375 jpp 1.3 - deny from all
376     - Allow from 127.0.0.1
377     + #deny from all
378     + #Allow from 127.0.0.1
379     + Require host 127.0.0.1
380     </Directory>
381    
382     <Location /freepbx/admin>
383     AuthType Basic
384     TKTAuthLoginURL /server-common/cgi-bin/login
385     - require user admin {getUsersList('freepbx');}
386     + Require user admin {getUsersList('freepbx');}
387     {
388     my $ManagerTimeout = ${'httpd-admin'}{ManagerTimeout} || "30m";
389     - $OUT = " TKTAuthTimeout $ManagerTimeout\n";
390     + $OUT = " TKTAuthTimeout $ManagerTimeout\n";
391     my $Cookie = ${'httpd-admin'}{Cookie} || "disabled";
392     - $OUT .= " TKTAuthCookieExpires $ManagerTimeout\n" if "$Cookie" eq "enabled";
393     + $OUT .= " TKTAuthCookieExpires $ManagerTimeout\n" if "$Cookie" eq "enabled";
394     my $ManagerTimeoutReset = ${'httpd-admin'}{ManagerTimeoutReset} || "0.66";
395     - $OUT .= " TKTAuthTimeoutRefresh $ManagerTimeoutReset\n";
396     + $OUT .= " TKTAuthTimeoutRefresh $ManagerTimeoutReset\n";
397     }
398     - Satisfy all
399     + #Satisfy all
400     </Location>
401    
402 jpp 1.1 diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/logrotate.d/asterisk/All smeserver-freepbx-13/root/etc/e-smith/templates/etc/logrotate.d/asterisk/All
403     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/logrotate.d/asterisk/All 2016-06-13 08:03:08.000000000 -0400
404     +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/logrotate.d/asterisk/All 2022-03-25 00:20:25.749000000 -0400
405     @@ -1,9 +1,26 @@
406     -/var/log/asterisk/messages /var/log/asterisk/freepbx.log /var/log/asterisk/event_log /var/log/asterisk/queue_log /var/log/asterisk/full /var/log/asterisk/warnings /var/log/asterisk/misdn.log \{
407     +/var/log/asterisk/messages
408     +/var/log/asterisk/event_log
409     +/var/log/asterisk/queue_log
410     +/var/log/asterisk/full
411     +/var/log/asterisk/security
412     +/var/log/asterisk/freepbx.log
413     +/var/log/asterisk/freepbx_security.log
414     +/var/log/asterisk/ucp_err.log
415     +/var/log/asterisk/ucp_out.log
416     +/var/log/asterisk/cdr-csv/Master.csv
417     +/var/log/asterisk/warnings
418     +/var/log/asterisk/misdn.log
419     +\{
420     missingok
421     notifempty
422     compress
423     + compressoptions -T0
424     + compresscmd /usr/bin/xz
425     + compressext .xz
426     + uncompresscmd /usr/bin/unxz
427     daily
428     - rotate 60
429     + rotate 365
430     + su asterisk asterisk
431     create 0640 asterisk asterisk
432     sharedscripts
433     postrotate
434     diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx smeserver-freepbx-13/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx
435     --- smeserver-freepbx-13.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 1969-12-31 19:00:00.000000000 -0500
436 jpp 1.3 +++ smeserver-freepbx-13/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-03-27 16:11:56.037000000 -0400
437 jpp 1.1 @@ -0,0 +1,69 @@
438     +{
439     +
440 jpp 1.3 +if ($PHP_VERSION eq '56'){
441 jpp 1.1 + if (($freepbx{'status'} || 'disabled') eq 'enabled'){
442     + my $max_upload_size = ($freepbx{MaxUploadSize} || '100M');
443     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
444     + my $memory_limit = ($freepbx{MemoryLimit} || '512M');
445     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
446     + my $open_basedir= $freepbx{PHPBaseDir} || '';
447     + $open_basedir = "/usr/share/freepbx:/var/lib/freepbx:/var/log/freepbx.log:/var/lib/php/freepbx:/home/e-smith/files/freepbx:/dev/urandom:/proc/meminfo:$open_basedir";
448     + my $id = 'freepbx';
449     + my $max_children = $freepbx{'PHPmaxChildren'} || 15;
450     + my $min_spare_servers = $freepbx{'PHPminServers'} || 3;
451     + my $start_servers = $freepbx{'PHPstartServers'} || 3;
452     + my $max_spare_servers = $freepbx{'PHPmaxServers'} || 6;
453     + my $max_requests = $freepbx{'PHPmaxRequests'} || 5000;
454     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
455     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
456     +
457     +
458     + $OUT .=<<_EOF;
459     +
460     +[freepbx]
461     +
462     +listen.owner = root
463 jpp 1.3 +listen.group = asterisk
464 jpp 1.1 +listen.mode = 0660
465     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
466     +user = asterisk
467     +group = asterisk
468     +catch_workers_output = yes
469     +
470     +pm = dynamic
471     +pm.max_children = $max_children
472     +pm.start_servers = $start_servers
473     +pm.min_spare_servers = $min_spare_servers
474     +pm.max_spare_servers = $max_spare_servers
475     +pm.max_requests = $max_requests
476     +request_terminate_timeout = 60m
477     +
478     +php_flag[display_errors] = off
479     +php_admin_flag[log_errors] = on
480 jpp 1.3 +php_admin_value[error_log] = /var/log/php/$id/error.log
481 jpp 1.1 +php_admin_value[memory_limit] = $memory_limit
482 jpp 1.3 +php_admin_value[session.save_path] = /var/lib/php/fpbx-session
483 jpp 1.1 +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
484     +php_admin_value[sys_temp_dir] = /var/lib/php/$id/tmp
485     +php_admin_value[post_max_size] = $max_upload_size
486     +php_admin_value[upload_max_filesize] = $max_upload_size
487     +php_admin_value[max_execution_time] = 900
488     +php_admin_value[max_input_time] = 900
489     +php_admin_flag[allow_url_include] = off
490     +php_admin_flag[allow_url_fopen] = on
491     +php_admin_flag[file_uploads] = on
492     +php_admin_flag[session.cookie_httponly] = on
493     +
494     +; Needed so that the #!/usr/bin/env php shebang will point to the correct PHP version
495     +env[PATH] = /opt/remi/php{{ fpbx_php_version }}/root/usr/bin:/opt/remi/php{{ fpbx_php_version }}/root/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
496     +;env[http_proxy] = {{ system_proxy }}
497     +;env[https_proxy] = {{ system_proxy }}
498     +;env[no_proxy] =
499     +_EOF
500     +
501     + }
502     + else{
503     + $OUT .= '; Nextcloud is disabled';
504     + }
505     +}
506     +}
507     diff -Nur --no-dereference smeserver-freepbx-13.old/root/etc/rc.d/init.d/freepbx smeserver-freepbx-13/root/etc/rc.d/init.d/freepbx
508     --- smeserver-freepbx-13.old/root/etc/rc.d/init.d/freepbx 2008-08-05 17:07:12.000000000 -0400
509     +++ smeserver-freepbx-13/root/etc/rc.d/init.d/freepbx 1969-12-31 19:00:00.000000000 -0500
510     @@ -1,85 +0,0 @@
511     -#! /bin/sh
512     -# chkconfig: 98 10
513     -
514     -if [ -f /etc/init.d/functions ] ; then
515     - . /etc/init.d/functions
516     -elif [ -f /etc/rc.d/init.d/functions ] ; then
517     - . /etc/rc.d/init.d/functions
518     -else
519     - exit 0
520     -fi
521     -
522     -
523     -
524     -
525     -# make sure config file exists
526     -if [ ! -e "/etc/amportal.conf" ]; then
527     - echo ""
528     - echo "/etc/amportal.conf does not exist!"
529     - echo "Have you installed the AMP configuration?"
530     - exit 1
531     -fi
532     -. /etc/amportal.conf
533     -
534     -if [ -x ${AMPBIN}/freepbx_engine ]; then
535     - FPBXENGINE=${AMPBIN}/freepbx_engine
536     -elif [ -x ${ASTVARLIBDIR}/bin/freepbx_engine ]; then
537     - FPBXENGINE=${ASTVARLIBDIR}/bin/freepbx_engine
538     -elif [ -x /var/lib/asterisk/bin/freepbx_engine ]; then
539     - FPBXENGINE=/var/lib/asterisk/bin/freepbx_engine
540     -else
541     - echo "FATAL: can not find freepbx_engine to start Asterisk"
542     - exit 1
543     -fi
544     -
545     -FPBXSTATUS=$(/sbin/e-smith/db configuration getprop freepbx status)
546     -
547     -case "$1" in
548     - start)
549     - $FPBXENGINE start > /dev/null 2>&1
550     - echo -n "Starting FreePBX: "
551     - RETVAL=$?
552     - ;;
553     - stop)
554     - $FPBXENGINE stop > /dev/null 2>&1
555     - echo -n "Stoping FreePBX: "
556     - RETVAL=$?
557     - ;;
558     - restart)
559     - $FPBXENGINE restart > /dev/null 2>&1
560     - echo -n "Restarting FreePBX: "
561     - RETVAL=$?
562     - ;;
563     - reload)
564     - /usr/sbin/asterisk -rx 'reload' > /dev/null 2>&1
565     - echo -n "Reloading FreePBX: "
566     - RETVAL=$?
567     - ;;
568     - kill)
569     - $FPBXENGINE kill > /dev/null 2>&1
570     - echo -n "Killing FreePBX: "
571     - RETVAL=$?
572     - ;;
573     - adjust)
574     - if [ $FPBXSTATUS == 'enabled' ]; then
575     - $FPBXENGINE restart > /dev/null 2>&1
576     - else
577     - $FPBXENGINE stop > /dev/null 2>&1
578     - fi
579     - echo -n "Adjusting FreePBX: "
580     - RETVAL=$?
581     - ;;
582     - *)
583     - echo "Usage: $0 {start|stop|restart|reload|adjust|kill}"
584     - exit 1
585     -esac
586     -
587     -if [ $RETVAL -eq 0 ]; then
588     - echo_success
589     -else
590     - echo_failure
591     -fi
592     -echo
593     -
594     -exit $RETVAL
595     -
596 jpp 1.3 diff -Nur --no-dereference smeserver-freepbx-13.old/root/usr/lib/systemd/system/asterisk.service.d/50-koozali.conf smeserver-freepbx-13/root/usr/lib/systemd/system/asterisk.service.d/50-koozali.conf
597     --- smeserver-freepbx-13.old/root/usr/lib/systemd/system/asterisk.service.d/50-koozali.conf 1969-12-31 19:00:00.000000000 -0500
598     +++ smeserver-freepbx-13/root/usr/lib/systemd/system/asterisk.service.d/50-koozali.conf 2022-03-27 16:13:01.588000000 -0400
599     @@ -0,0 +1,3 @@
600 jpp 1.1 +[Service]
601     +ExecStart=
602     +ExecStart=/dev/null
603     diff -Nur --no-dereference smeserver-freepbx-13.old/root/usr/lib/systemd/system/freepbx.service smeserver-freepbx-13/root/usr/lib/systemd/system/freepbx.service
604     --- smeserver-freepbx-13.old/root/usr/lib/systemd/system/freepbx.service 1969-12-31 19:00:00.000000000 -0500
605     +++ smeserver-freepbx-13/root/usr/lib/systemd/system/freepbx.service 2022-03-24 23:17:16.044000000 -0400
606     @@ -0,0 +1,19 @@
607     +[Unit]
608     +Description=FreePBX VoIP Server
609     +Requires=mariadb.service
610     +
611     +[Service]
612     +Type=forking
613     +
614     +ExecStartPre=/sbin/e-smith/service-status freepbx
615     +
616     +ExecStart=/usr/local/bin/fwconsole start -q
617     +ExecStop=/usr/local/bin/fwconsole stop -q
618     +ExecReload=/usr/local/bin/fwconsole reload -q
619     +SyslogIdentifier=FreePBX
620     +Restart=on-failure
621     +StartLimitInterval=0
622     +RestartSec=30
623     +
624     +[Install]
625     +WantedBy=multi-user.target sme-server.target
626     diff -Nur --no-dereference smeserver-freepbx-13.old/root/usr/lib/systemd/system/httpd-fpbx.service smeserver-freepbx-13/root/usr/lib/systemd/system/httpd-fpbx.service
627     --- smeserver-freepbx-13.old/root/usr/lib/systemd/system/httpd-fpbx.service 1969-12-31 19:00:00.000000000 -0500
628     +++ smeserver-freepbx-13/root/usr/lib/systemd/system/httpd-fpbx.service 2022-03-24 23:40:24.092000000 -0400
629     @@ -0,0 +1,21 @@
630     +[Unit]
631     +Description=The Koozali SME Server FreePBX web service
632     +After=network.service remote-fs.target
633     +Documentation=man:httpd(8)
634     +Documentation=man:apachectl(8)
635     +
636     +[Service]
637     +Type=notify
638     +EnvironmentFile=/etc/sysconfig/httpd
639     +ExecStartPre=/sbin/e-smith/service-status httpd-fpbx
640     +ExecStartPre=/sbin/e-smith/expand-template /etc/httpd/fpbx-conf/httpd.conf
641     +ExecStart=/usr/sbin/httpd -f /etc/httpd/fpbx-conf/httpd.conf -DFOREGROUND
642     +ExecReload=/usr/sbin/httpd -f /etc/httpd/fpbx-conf/httpd.conf -k graceful
643     +ExecStop=/bin/kill -WINCH ${MAINPID}
644     +KillSignal=SIGCONT
645     +PrivateTmp=true
646     +
647     +
648     +[Install]
649     +WantedBy=sme-server.target
650     +
651 jpp 1.3 diff -Nur --no-dereference smeserver-freepbx-13.old/root/usr/sbin/safe_asterisk smeserver-freepbx-13/root/usr/sbin/safe_asterisk
652     --- smeserver-freepbx-13.old/root/usr/sbin/safe_asterisk 1969-12-31 19:00:00.000000000 -0500
653     +++ smeserver-freepbx-13/root/usr/sbin/safe_asterisk 2022-03-24 23:26:33.185000000 -0400
654 jpp 1.1 @@ -0,0 +1,228 @@
655     +#!/bin/sh
656     +
657     +ASTETCDIR="/etc/asterisk"
658     +ASTSBINDIR="/usr/sbin"
659     +ASTVARRUNDIR="/var/run/asterisk"
660     +ASTVARLOGDIR="/var/log/asterisk"
661     +
662     +CLIARGS="$*" # Grab any args passed to safe_asterisk
663     +TTY=9 # TTY (if you want one) for Asterisk to run on
664     +CONSOLE=yes # Whether or not you want a console
665     +#NOTIFY=root@localhost # Who to notify about crashes
666     +#EXEC=/path/to/somescript # Run this command if Asterisk crashes
667     +#LOGFILE="${ASTVARLOGDIR}/safe_asterisk.log" # Where to place the normal logfile (disabled if blank)
668     +#SYSLOG=local0 # Which syslog facility to use (disabled if blank)
669     +MACHINE=`hostname` # To specify which machine has crashed when getting the mail
670     +DUMPDROP="${DUMPDROP:-/tmp}"
671     +RUNDIR="${RUNDIR:-/tmp}"
672     +SLEEPSECS=4
673     +ASTPIDFILE="${ASTVARRUNDIR}/asterisk.pid"
674     +
675     +# comment this line out to have this script _not_ kill all mpg123 processes when
676     +# asterisk exits
677     +KILLALLMPG123=1
678     +
679     +# run asterisk with this priority
680     +PRIORITY=0
681     +
682     +# set system filemax on supported OSes if this variable is set
683     +# SYSMAXFILES=262144
684     +
685     +# Asterisk allows full permissions by default, so set a umask, if you want
686     +# restricted permissions.
687     +#UMASK=022
688     +
689     +# set max files open with ulimit. On linux systems, this will be automatically
690     +# set to the system's maximum files open devided by two, if not set here.
691     +# MAXFILES=32768
692     +
693     +message() {
694     + if test -n "$TTY" && test "$TTY" != "no"; then
695     + echo "$1" >/dev/${TTY}
696     + fi
697     + if test -n "$SYSLOG"; then
698     + logger -p "${SYSLOG}.warn" -t safe_asterisk[$$] "$1"
699     + fi
700     + if test -n "$LOGFILE"; then
701     + echo "safe_asterisk[$$]: $1" >>"$LOGFILE"
702     + fi
703     +}
704     +
705     +# Check if Asterisk is already running. If it is, then bug out, because
706     +# starting safe_asterisk when Asterisk is running is very bad.
707     +VERSION=`"${ASTSBINDIR}/asterisk" -nrx 'core show version' 2>/dev/null`
708     +if test "`echo $VERSION | cut -c 1-8`" = "Asterisk"; then
709     + message "Asterisk is already running. $0 will exit now."
710     + exit 1
711     +fi
712     +
713     +# since we're going to change priority and open files limits, we need to be
714     +# root. if running asterisk as other users, pass that to asterisk on the command
715     +# line.
716     +# if we're not root, fall back to standard everything.
717     +if test `id -u` != 0; then
718     + echo "Oops. I'm not root. Falling back to standard prio and file max." >&2
719     + echo "This is NOT suitable for large systems." >&2
720     + PRIORITY=0
721     + message "safe_asterisk was started by `id -n` (uid `id -u`)."
722     +else
723     + if `uname -s | grep Linux >/dev/null 2>&1`; then
724     + # maximum number of open files is set to the system maximum
725     + # divided by two if MAXFILES is not set.
726     + if test -z "$MAXFILES"; then
727     + # just check if file-max is readable
728     + if test -r /proc/sys/fs/file-max; then
729     + MAXFILES=$((`cat /proc/sys/fs/file-max` / 2))
730     + # don't exceed upper limit of 2^20 for open
731     + # files on systems where file-max is > 2^21
732     + if test $MAXFILES -gt 1048576; then
733     + MAXFILES=1048576
734     + fi
735     + fi
736     + fi
737     + SYSCTL_MAXFILES="fs.file-max"
738     + elif `uname -s | grep Darwin /dev/null 2>&1`; then
739     + SYSCTL_MAXFILES="kern.maxfiles"
740     + fi
741     +
742     +
743     + if test -n "$SYSMAXFILES"; then
744     + if test -n "$SYSCTL_MAXFILES"; then
745     + sysctl -w $SYSCTL_MAXFILES=$SYSMAXFILES
746     + fi
747     + fi
748     +
749     + # set the process's filemax to whatever set above
750     + ulimit -n $MAXFILES
751     +
752     + if test ! -d "${ASTVARRUNDIR}"; then
753     + mkdir -p "${ASTVARRUNDIR}"
754     + chmod 770 "${ASTVARRUNDIR}"
755     + fi
756     +
757     +fi
758     +
759     +if test -n "$UMASK"; then
760     + umask $UMASK
761     +fi
762     +
763     +#
764     +# Let Asterisk dump core
765     +#
766     +ulimit -c unlimited
767     +
768     +#
769     +# Don't fork when running "safely"
770     +#
771     +ASTARGS=""
772     +if test -n "$TTY" && test "$TTY" != "no"; then
773     + if test -c /dev/tty${TTY}; then
774     + TTY=tty${TTY}
775     + elif test -c /dev/vc/${TTY}; then
776     + TTY=vc/${TTY}
777     + elif test "$TTY" = "9"; then # ignore default if it was untouched
778     + # If there is no /dev/tty9 and not /dev/vc/9 we don't
779     + # necessarily want to die at this point. Pretend that
780     + # TTY wasn't set.
781     + TTY=
782     + else
783     + message "Cannot find specified TTY (${TTY})"
784     + exit 1
785     + fi
786     + if test -n "$TTY"; then
787     + ASTARGS="${ASTARGS} -vvvg"
788     + if test "$CONSOLE" != "no"; then
789     + ASTARGS="${ASTARGS} -c"
790     + fi
791     + fi
792     +fi
793     +
794     +if test ! -d "${RUNDIR}"; then
795     + message "${RUNDIR} does not exist, creating"
796     + if ! mkdir -p "${RUNDIR}"; then
797     + message "Unable to create ${RUNDIR}"
798     + exit 1
799     + fi
800     +fi
801     +
802     +if test ! -w "${DUMPDROP}"; then
803     + message "Cannot write to ${DUMPDROP}"
804     + exit 1
805     +fi
806     +
807     +#
808     +# Don't die if stdout/stderr can't be written to
809     +#
810     +trap '' PIPE
811     +
812     +#
813     +# Run scripts to set any environment variables or do any other system-specific setup needed
814     +#
815     +
816     +if test -d "${ASTETCDIR}/startup.d"; then
817     + for script in "${ASTETCDIR}/startup.d/"*.sh; do
818     + if test -r "${script}"; then
819     + . "${script}"
820     + fi
821     + done
822     +fi
823     +
824     +run_asterisk()
825     +{
826     + while :; do
827     + if test -n "$TTY" && test "$TTY" != "no"; then
828     + cd "${RUNDIR}"
829     + stty sane </dev/${TTY}
830     + nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/${TTY} 2>&1 </dev/${TTY}
831     + else
832     + cd "${RUNDIR}"
833     + nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} >/dev/null 2>&1 </dev/null
834     + fi
835     + EXITSTATUS=$?
836     + message "Asterisk ended with exit status $EXITSTATUS"
837     + if test $EXITSTATUS -eq 0; then
838     + # Properly shutdown....
839     + message "Asterisk shutdown normally."
840     + exit 0
841     + elif test $EXITSTATUS -gt 128; then
842     + EXITSIGNAL=$((EXITSTATUS - 128))
843     + message "Asterisk exited on signal $EXITSIGNAL."
844     + if test -n "$NOTIFY"; then
845     + echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL. Might want to take a peek." | \
846     + mail -s "Asterisk on $MACHINE died (sig $EXITSIGNAL)" $NOTIFY
847     + fi
848     + if test -n "$EXEC"; then
849     + $EXEC
850     + fi
851     +
852     + PID=`cat ${ASTPIDFILE}`
853     + DATE=`date "+%Y-%m-%dT%H:%M:%S%z"`
854     + if test -f "${RUNDIR}/core.${PID}"; then
855     + mv "${RUNDIR}/core.${PID}" "${DUMPDROP}/core.`hostname`-$DATE" &
856     + elif test -f "${RUNDIR}/core"; then
857     + mv "${RUNDIR}/core" "${DUMPDROP}/core.`hostname`-$DATE" &
858     + fi
859     + else
860     + message "Asterisk died with code $EXITSTATUS."
861     +
862     + PID=`cat ${ASTPIDFILE}`
863     + DATE=`date "+%Y-%m-%dT%H:%M:%S%z"`
864     + if test -f "${RUNDIR}/core.${PID}"; then
865     + mv "${RUNDIR}/core.${PID}" "${DUMPDROP}/core.`hostname`-$DATE" &
866     + elif test -f "${RUNDIR}/core"; then
867     + mv "${RUNDIR}/core" "${DUMPDROP}/core.`hostname`-$DATE" &
868     + fi
869     + fi
870     + message "Automatically restarting Asterisk."
871     + sleep $SLEEPSECS
872     + if test "0$KILLALLMPG123" -gt 0; then
873     + pkill -9 mpg123
874     + fi
875     + done
876     +}
877     +
878     +if test -n "$ASTSAFE_FOREGROUND"; then
879     + run_asterisk
880     +else
881     + run_asterisk &
882     +fi
883 jpp 1.3 diff -Nur --no-dereference smeserver-freepbx-13.old/root/usr/share/freepbx/sql/asterisk.sql smeserver-freepbx-13/root/usr/share/freepbx/sql/asterisk.sql
884     --- smeserver-freepbx-13.old/root/usr/share/freepbx/sql/asterisk.sql 1969-12-31 19:00:00.000000000 -0500
885     +++ smeserver-freepbx-13/root/usr/share/freepbx/sql/asterisk.sql 2022-03-27 16:11:54.792000000 -0400
886     @@ -0,0 +1,687 @@
887     +-- MySQL dump 10.13 Distrib 5.1.69, for redhat-linux-gnu (x86_64)
888     +--
889     +-- Host: localhost Database: asterisk
890     +-- ------------------------------------------------------
891     +-- Server version 5.1.69
892     +
893     +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
894     +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
895     +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
896     +/*!40101 SET NAMES utf8 */;
897     +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
898     +/*!40103 SET TIME_ZONE='+00:00' */;
899     +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
900     +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
901     +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
902     +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
903     +set @@default_storage_engine = 'MyISAM';
904     +
905     +--
906     +-- Table structure for table `admin`
907     +--
908     +
909     +DROP TABLE IF EXISTS `admin`;
910     +/*!40101 SET @saved_cs_client = @@character_set_client */;
911     +/*!40101 SET character_set_client = utf8 */;
912     +CREATE TABLE `admin` (
913     + `variable` varchar(20) NOT NULL DEFAULT '',
914     + `value` varchar(80) NOT NULL DEFAULT '',
915     + PRIMARY KEY (`variable`)
916     +);
917     +/*!40101 SET character_set_client = @saved_cs_client */;
918     +
919     +--
920     +-- Dumping data for table `admin`
921     +--
922     +
923     +LOCK TABLES `admin` WRITE;
924     +/*!40000 ALTER TABLE `admin` DISABLE KEYS */;
925     +INSERT INTO `admin` VALUES ('need_reload','true'),('version','2.11.0rc1'),('default_directory','1'),('directory28_migrated','1');
926     +/*!40000 ALTER TABLE `admin` ENABLE KEYS */;
927     +UNLOCK TABLES;
928     +
929     +--
930     +-- Table structure for table `ampusers`
931     +--
932     +
933     +DROP TABLE IF EXISTS `ampusers`;
934     +/*!40101 SET @saved_cs_client = @@character_set_client */;
935     +/*!40101 SET character_set_client = utf8 */;
936     +CREATE TABLE `ampusers` (
937     + `username` varchar(255) NOT NULL,
938     + `password_sha1` varchar(40) NOT NULL,
939     + `extension_low` varchar(20) NOT NULL DEFAULT '',
940     + `extension_high` varchar(20) NOT NULL DEFAULT '',
941     + `deptname` varchar(20) NOT NULL DEFAULT '',
942     + `sections` blob NOT NULL,
943     + PRIMARY KEY (`username`)
944     +);
945     +/*!40101 SET character_set_client = @saved_cs_client */;
946     +
947     +--
948     +-- Dumping data for table `ampusers`
949     +--
950     +
951     +LOCK TABLES `ampusers` WRITE;
952     +/*!40000 ALTER TABLE `ampusers` DISABLE KEYS */;
953     +/*!40000 ALTER TABLE `ampusers` ENABLE KEYS */;
954     +UNLOCK TABLES;
955     +
956     +
957     +--
958     +-- Table structure for table `cronmanager`
959     +--
960     +
961     +DROP TABLE IF EXISTS `cronmanager`;
962     +/*!40101 SET @saved_cs_client = @@character_set_client */;
963     +/*!40101 SET character_set_client = utf8 */;
964     +CREATE TABLE `cronmanager` (
965     + `module` varchar(24) NOT NULL DEFAULT '',
966     + `id` varchar(24) NOT NULL DEFAULT '',
967     + `time` varchar(5) DEFAULT NULL,
968     + `freq` int(11) NOT NULL DEFAULT '0',
969     + `lasttime` int(11) NOT NULL DEFAULT '0',
970     + `command` varchar(255) NOT NULL DEFAULT '',
971     + PRIMARY KEY (`module`,`id`)
972     +);
973     +/*!40101 SET character_set_client = @saved_cs_client */;
974     +
975     +--
976     +-- Dumping data for table `cronmanager`
977     +--
978     +
979     +LOCK TABLES `cronmanager` WRITE;
980     +/*!40000 ALTER TABLE `cronmanager` DISABLE KEYS */;
981     +INSERT INTO `cronmanager` VALUES ('module_admin','UPDATES','22',24,0,'/var/lib/asterisk/bin/module_admin listonline > /dev/null 2>&1');
982     +/*!40000 ALTER TABLE `cronmanager` ENABLE KEYS */;
983     +UNLOCK TABLES;
984     +
985     +--
986     +-- Table structure for table `dahdi`
987     +--
988     +
989     +DROP TABLE IF EXISTS `dahdi`;
990     +/*!40101 SET @saved_cs_client = @@character_set_client */;
991     +/*!40101 SET character_set_client = utf8 */;
992     +CREATE TABLE `dahdi` (
993     + `id` varchar(20) NOT NULL DEFAULT '-1',
994     + `keyword` varchar(30) NOT NULL DEFAULT '',
995     + `data` varchar(255) NOT NULL DEFAULT '',
996     + `flags` int(1) NOT NULL DEFAULT '0',
997     + PRIMARY KEY (`id`,`keyword`)
998     +);
999     +/*!40101 SET character_set_client = @saved_cs_client */;
1000     +
1001     +--
1002     +-- Dumping data for table `dahdi`
1003     +--
1004     +
1005     +LOCK TABLES `dahdi` WRITE;
1006     +/*!40000 ALTER TABLE `dahdi` DISABLE KEYS */;
1007     +/*!40000 ALTER TABLE `dahdi` ENABLE KEYS */;
1008     +UNLOCK TABLES;
1009     +
1010     +--
1011     +-- Table structure for table `devices`
1012     +--
1013     +
1014     +DROP TABLE IF EXISTS `devices`;
1015     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1016     +/*!40101 SET character_set_client = utf8 */;
1017     +CREATE TABLE `devices` (
1018     + `id` varchar(20) NOT NULL DEFAULT '',
1019     + `tech` varchar(10) NOT NULL DEFAULT '',
1020     + `dial` varchar(255) NOT NULL DEFAULT '',
1021     + `devicetype` varchar(5) NOT NULL DEFAULT '',
1022     + `user` varchar(50) DEFAULT NULL,
1023     + `description` varchar(50) DEFAULT NULL,
1024     + `emergency_cid` varchar(100) DEFAULT NULL,
1025     + KEY `id` (`id`),
1026     + KEY `tech` (`tech`)
1027     +);
1028     +/*!40101 SET character_set_client = @saved_cs_client */;
1029     +
1030     +--
1031     +-- Dumping data for table `devices`
1032     +--
1033     +
1034     +LOCK TABLES `devices` WRITE;
1035     +/*!40000 ALTER TABLE `devices` DISABLE KEYS */;
1036     +/*!40000 ALTER TABLE `devices` ENABLE KEYS */;
1037     +UNLOCK TABLES;
1038     +
1039     +--
1040     +-- Table structure for table `extensions`
1041     +--
1042     +
1043     +DROP TABLE IF EXISTS `extensions`;
1044     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1045     +/*!40101 SET character_set_client = utf8 */;
1046     +CREATE TABLE `extensions` (
1047     + `context` varchar(45) NOT NULL DEFAULT 'default',
1048     + `extension` varchar(45) NOT NULL DEFAULT '',
1049     + `priority` varchar(5) NOT NULL DEFAULT '1',
1050     + `application` varchar(45) NOT NULL DEFAULT '',
1051     + `args` varchar(255) DEFAULT NULL,
1052     + `descr` text,
1053     + `flags` int(1) NOT NULL DEFAULT '0',
1054     + PRIMARY KEY (`context`,`extension`,`priority`)
1055     +);
1056     +/*!40101 SET character_set_client = @saved_cs_client */;
1057     +
1058     +--
1059     +-- Dumping data for table `extensions`
1060     +--
1061     +
1062     +LOCK TABLES `extensions` WRITE;
1063     +/*!40000 ALTER TABLE `extensions` DISABLE KEYS */;
1064     +INSERT INTO `extensions` VALUES ('outrt-001-9_outside','_9.','1','Macro','dialout-trunk,1,${EXTEN:1}',NULL,0),('outrt-001-9_outside','_9.','2','Macro','outisbusy','No available circuits',0),('outbound-allroutes','include','1','outrt-001-9_outside','','',2);
1065     +/*!40000 ALTER TABLE `extensions` ENABLE KEYS */;
1066     +UNLOCK TABLES;
1067     +
1068     +--
1069     +-- Table structure for table `fax_details`
1070     +--
1071     +
1072     +DROP TABLE IF EXISTS `featurecodes`;
1073     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1074     +/*!40101 SET character_set_client = utf8 */;
1075     +CREATE TABLE `featurecodes` (
1076     + `modulename` varchar(50) NOT NULL DEFAULT '',
1077     + `featurename` varchar(50) NOT NULL DEFAULT '',
1078     + `description` varchar(200) NOT NULL DEFAULT '',
1079     + `helptext` varchar(250) NOT NULL DEFAULT '',
1080     + `defaultcode` varchar(20) DEFAULT NULL,
1081     + `customcode` varchar(20) DEFAULT NULL,
1082     + `enabled` tinyint(4) NOT NULL DEFAULT '0',
1083     + `providedest` tinyint(4) NOT NULL DEFAULT '0',
1084     + PRIMARY KEY (`modulename`,`featurename`),
1085     + KEY `enabled` (`enabled`)
1086     +);
1087     +/*!40101 SET character_set_client = @saved_cs_client */;
1088     +
1089     +--
1090     +-- Dumping data for table `featurecodes`
1091     +--
1092     +
1093     +LOCK TABLES `featurecodes` WRITE;
1094     +/*!40000 ALTER TABLE `featurecodes` DISABLE KEYS */;
1095     +INSERT INTO `featurecodes` VALUES ('core','userlogon','User Logon','','*11',NULL,1,0),('core','userlogoff','User Logoff','','*12',NULL,1,0),('core','zapbarge','ZapBarge','','888',NULL,1,1),('core','chanspy','ChanSpy','','555',NULL,1,1),('core','simu_pstn','Simulate Incoming Call','','7777',NULL,1,1),('core','pickup','Directed Call Pickup','','**',NULL,1,0),('core','pickupexten','Asterisk General Call Pickup','','*8',NULL,1,0),('core','blindxfer','In-Call Asterisk Blind Transfer','','##',NULL,1,0),('core','atxfer','In-Call Asterisk Attended Transfer','','*2',NULL,1,0),('core','automon','In-Call Asterisk Toggle Call Recording','','*1',NULL,1,0),('core','disconnect','In-Call Asterisk Disconnect Code','','**',NULL,1,0),('pbdirectory','app-pbdirectory','Phonebook dial-by-name directory','','411',NULL,1,1),('donotdisturb','dnd_on','DND Activate','','*78',NULL,1,0),('donotdisturb','dnd_off','DND Deactivate','','*79',NULL,1,0),('donotdisturb','dnd_toggle','DND Toggle','','*76',NULL,1,0),('recordings','record_save','Save Recording','','*77',NULL,1,0),('recordings','record_check','Check Recording','','*99',NULL,1,0),('callwaiting','cwon','Call Waiting - Activate','','*70',NULL,1,0),('callwaiting','cwoff','Call Waiting - Deactivate','','*71',NULL,1,0),('voicemail','myvoicemail','My Voicemail','','*97',NULL,1,0),('voicemail','dialvoicemail','Dial Voicemail','','*98',NULL,1,1),('voicemail','directdialvoicemail','Direct Dial Prefix','','*',NULL,1,0),('paging','intercom-prefix','Intercom prefix','','*80',NULL,1,0),('paging','intercom-on','User Intercom Allow','','*54',NULL,1,0),('paging','intercom-off','User Intercom Disallow','','*55',NULL,1,0),('blacklist','blacklist_add','Blacklist a number','','*30',NULL,1,1),('blacklist','blacklist_remove','Remove a number from the blacklist','','*31',NULL,1,1),('blacklist','blacklist_last','Blacklist the last caller','','*32',NULL,1,0),('fax','simu_fax','Dial System FAX','','666',NULL,1,1),('dictate','dodictate','Perform dictation','','*34',NULL,1,0),('dictate','senddictate','Email completed dictation','','*35',NULL,1,0),('findmefollow','fmf_toggle','Findme Follow Toggle','','*21',NULL,1,0),('campon','request','Camp-On Request','','*82',NULL,1,0),('campon','cancel','Camp-On Cancel','','*83',NULL,1,0),('campon','toggle','Camp-On Toggle','','*84',NULL,1,0),('parking','parkedcall','Pickup ParkedCall Prefix','','*85',NULL,1,1),('infoservices','calltrace','Call Trace','','*69',NULL,1,0),('infoservices','echotest','Echo Test','','*43',NULL,1,1),('infoservices','speakingclock','Speaking Clock','','*60',NULL,1,1),('infoservices','speakextennum','Speak Your Exten Number','','*65',NULL,1,0),('callforward','cfon','Call Forward All Activate','','*72',NULL,1,0),('callforward','cfoff','Call Forward All Deactivate','','*73',NULL,1,0),('callforward','cfoff_any','Call Forward All Prompting Deactivate','','*74',NULL,1,0),('callforward','cfbon','Call Forward Busy Activate','','*90',NULL,1,0),('callforward','cfboff','Call Forward Busy Deactivate','','*91',NULL,1,0),('callforward','cfboff_any','Call Forward Busy Prompting Deactivate','','*92',NULL,1,0),('callforward','cfuon','Call Forward No Answer/Unavailable Activate','','*52',NULL,1,0),('callforward','cfuoff','Call Forward No Answer/Unavailable Deactivate','','*53',NULL,1,0),('callforward','cf_toggle','Call Forward Toggle','','*740',NULL,1,0),('queues','que_toggle','Queue Toggle','','*45',NULL,1,0),('queues','que_pause_toggle','Queue Pause Toggle','','*46',NULL,1,0),('speeddial','callspeeddial','Speeddial prefix','','*0',NULL,1,0),('speeddial','setspeeddial','Set user speed dial','','*75',NULL,1,0),('hotelwakeup','hotelwakeup','Wake Up Calls','','*68',NULL,1,0);
1096     +/*!40000 ALTER TABLE `featurecodes` ENABLE KEYS */;
1097     +UNLOCK TABLES;
1098     +
1099     +--
1100     +-- Table structure for table `freepbx_log`
1101     +--
1102     +
1103     +DROP TABLE IF EXISTS `freepbx_log`;
1104     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1105     +/*!40101 SET character_set_client = utf8 */;
1106     +CREATE TABLE `freepbx_log` (
1107     + `id` int(11) NOT NULL AUTO_INCREMENT,
1108     + `time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1109     + `section` varchar(50) DEFAULT NULL,
1110     + `level` enum('error','warning','debug','devel-debug') NOT NULL DEFAULT 'error',
1111     + `status` int(11) NOT NULL DEFAULT '0',
1112     + `message` text NOT NULL,
1113     + PRIMARY KEY (`id`),
1114     + KEY `time` (`time`,`level`)
1115     +) AUTO_INCREMENT=3;
1116     +/*!40101 SET character_set_client = @saved_cs_client */;
1117     +
1118     +--
1119     +-- Dumping data for table `freepbx_log`
1120     +--
1121     +
1122     +LOCK TABLES `freepbx_log` WRITE;
1123     +/*!40000 ALTER TABLE `freepbx_log` DISABLE KEYS */;
1124     +/*!40000 ALTER TABLE `freepbx_log` ENABLE KEYS */;
1125     +UNLOCK TABLES;
1126     +
1127     +--
1128     +-- Table structure for table `freepbx_settings`
1129     +--
1130     +
1131     +DROP TABLE IF EXISTS `freepbx_settings`;
1132     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1133     +/*!40101 SET character_set_client = utf8 */;
1134     +CREATE TABLE `freepbx_settings` (
1135     + `keyword` varchar(50) NOT NULL DEFAULT '',
1136     + `value` varchar(255) DEFAULT NULL,
1137     + `name` varchar(80) DEFAULT NULL,
1138     + `level` tinyint(1) DEFAULT '0',
1139     + `description` text,
1140     + `type` varchar(25) DEFAULT NULL,
1141     + `options` text,
1142     + `defaultval` varchar(255) DEFAULT NULL,
1143     + `readonly` tinyint(1) DEFAULT '0',
1144     + `hidden` tinyint(1) DEFAULT '0',
1145     + `category` varchar(50) DEFAULT NULL,
1146     + `module` varchar(25) DEFAULT NULL,
1147     + `emptyok` tinyint(1) DEFAULT '1',
1148     + `sortorder` int(11) DEFAULT '0',
1149     + PRIMARY KEY (`keyword`)
1150     +);
1151     +/*!40101 SET character_set_client = @saved_cs_client */;
1152     +
1153     +--
1154     +-- Table structure for table `globals`
1155     +--
1156     +
1157     +DROP TABLE IF EXISTS `globals`;
1158     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1159     +/*!40101 SET character_set_client = utf8 */;
1160     +CREATE TABLE `globals` (
1161     + `variable` varchar(255) NOT NULL,
1162     + `value` varchar(255) NOT NULL,
1163     + PRIMARY KEY (`variable`)
1164     +);
1165     +/*!40101 SET character_set_client = @saved_cs_client */;
1166     +
1167     +LOCK TABLES `globals` WRITE;
1168     +/*!40000 ALTER TABLE `globals` DISABLE KEYS */;
1169     +/*!40000 ALTER TABLE `globals` ENABLE KEYS */;
1170     +UNLOCK TABLES;
1171     +
1172     +--
1173     +-- Table structure for table `iax`
1174     +--
1175     +
1176     +DROP TABLE IF EXISTS `iax`;
1177     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1178     +/*!40101 SET character_set_client = utf8 */;
1179     +CREATE TABLE `iax` (
1180     + `id` varchar(20) NOT NULL DEFAULT '-1',
1181     + `keyword` varchar(30) NOT NULL DEFAULT '',
1182     + `data` varchar(255) NOT NULL,
1183     + `flags` int(1) NOT NULL DEFAULT '0',
1184     + PRIMARY KEY (`id`,`keyword`)
1185     +);
1186     +/*!40101 SET character_set_client = @saved_cs_client */;
1187     +
1188     +--
1189     +-- Dumping data for table `iax`
1190     +--
1191     +
1192     +LOCK TABLES `iax` WRITE;
1193     +/*!40000 ALTER TABLE `iax` DISABLE KEYS */;
1194     +/*!40000 ALTER TABLE `iax` ENABLE KEYS */;
1195     +UNLOCK TABLES;
1196     +
1197     +--
1198     +-- Table structure for table `incoming`
1199     +--
1200     +
1201     +DROP TABLE IF EXISTS `incoming`;
1202     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1203     +/*!40101 SET character_set_client = utf8 */;
1204     +CREATE TABLE `incoming` (
1205     + `cidnum` varchar(20) DEFAULT NULL,
1206     + `extension` varchar(50) NOT NULL,
1207     + `destination` varchar(50) DEFAULT NULL,
1208     + `faxexten` varchar(20) DEFAULT NULL,
1209     + `faxemail` varchar(50) DEFAULT NULL,
1210     + `answer` tinyint(1) DEFAULT NULL,
1211     + `wait` int(2) DEFAULT NULL,
1212     + `privacyman` tinyint(1) DEFAULT NULL,
1213     + `alertinfo` varchar(255) DEFAULT NULL,
1214     + `ringing` varchar(20) DEFAULT NULL,
1215     + `mohclass` varchar(80) NOT NULL DEFAULT 'default',
1216     + `description` varchar(80) DEFAULT NULL,
1217     + `grppre` varchar(80) DEFAULT NULL,
1218     + `delay_answer` int(2) DEFAULT NULL,
1219     + `pricid` varchar(20) DEFAULT NULL,
1220     + `pmmaxretries` varchar(2) DEFAULT NULL,
1221     + `pmminlength` varchar(2) DEFAULT NULL
1222     +);
1223     +/*!40101 SET character_set_client = @saved_cs_client */;
1224     +
1225     +--
1226     +-- Dumping data for table `incoming`
1227     +--
1228     +
1229     +LOCK TABLES `incoming` WRITE;
1230     +/*!40000 ALTER TABLE `incoming` DISABLE KEYS */;
1231     +/*!40000 ALTER TABLE `incoming` ENABLE KEYS */;
1232     +UNLOCK TABLES;
1233     +
1234     +--
1235     +-- Table structure for table `module_xml`
1236     +--
1237     +
1238     +DROP TABLE IF EXISTS `module_xml`;
1239     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1240     +/*!40101 SET character_set_client = utf8 */;
1241     +CREATE TABLE `module_xml` (
1242     + `id` varchar(20) NOT NULL DEFAULT 'xml',
1243     + `time` int(11) NOT NULL DEFAULT '0',
1244     + `data` longblob NOT NULL,
1245     + PRIMARY KEY (`id`)
1246     +);
1247     +/*!40101 SET character_set_client = @saved_cs_client */;
1248     +
1249     +--
1250     +-- Table structure for table `modules`
1251     +--
1252     +
1253     +DROP TABLE IF EXISTS `modules`;
1254     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1255     +/*!40101 SET character_set_client = utf8 */;
1256     +CREATE TABLE `modules` (
1257     + `id` int(11) NOT NULL AUTO_INCREMENT,
1258     + `modulename` varchar(50) NOT NULL DEFAULT '',
1259     + `version` varchar(20) NOT NULL DEFAULT '',
1260     + `enabled` tinyint(4) NOT NULL DEFAULT '0',
1261     + `signature` blob,
1262     + PRIMARY KEY (`id`)
1263     +) AUTO_INCREMENT=1;
1264     +/*!40101 SET character_set_client = @saved_cs_client */;
1265     +
1266     +--
1267     +-- Table structure for table `notifications`
1268     +--
1269     +
1270     +DROP TABLE IF EXISTS `notifications`;
1271     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1272     +/*!40101 SET character_set_client = utf8 */;
1273     +CREATE TABLE `notifications` (
1274     + `module` varchar(24) NOT NULL DEFAULT '',
1275     + `id` varchar(24) NOT NULL DEFAULT '',
1276     + `level` int(11) NOT NULL DEFAULT '0',
1277     + `display_text` varchar(255) NOT NULL DEFAULT '',
1278     + `extended_text` blob NOT NULL,
1279     + `link` varchar(255) NOT NULL DEFAULT '',
1280     + `reset` tinyint(4) NOT NULL DEFAULT '0',
1281     + `candelete` tinyint(4) NOT NULL DEFAULT '0',
1282     + `timestamp` int(11) NOT NULL DEFAULT '0',
1283     + PRIMARY KEY (`module`,`id`)
1284     +);
1285     +/*!40101 SET character_set_client = @saved_cs_client */;
1286     +
1287     +--
1288     +-- Table structure for table `outbound_route_patterns`
1289     +--
1290     +
1291     +DROP TABLE IF EXISTS `outbound_route_patterns`;
1292     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1293     +/*!40101 SET character_set_client = utf8 */;
1294     +CREATE TABLE `outbound_route_patterns` (
1295     + `route_id` int(11) NOT NULL,
1296     + `match_pattern_prefix` varchar(60) NOT NULL DEFAULT '',
1297     + `match_pattern_pass` varchar(60) NOT NULL DEFAULT '',
1298     + `match_cid` varchar(60) NOT NULL DEFAULT '',
1299     + `prepend_digits` varchar(100) NOT NULL DEFAULT '',
1300     + PRIMARY KEY (`route_id`,`match_pattern_prefix`,`match_pattern_pass`,`match_cid`,`prepend_digits`)
1301     +);
1302     +/*!40101 SET character_set_client = @saved_cs_client */;
1303     +
1304     +--
1305     +-- Dumping data for table `outbound_route_patterns`
1306     +--
1307     +
1308     +LOCK TABLES `outbound_route_patterns` WRITE;
1309     +/*!40000 ALTER TABLE `outbound_route_patterns` DISABLE KEYS */;
1310     +/*!40000 ALTER TABLE `outbound_route_patterns` ENABLE KEYS */;
1311     +UNLOCK TABLES;
1312     +
1313     +--
1314     +-- Table structure for table `outbound_route_sequence`
1315     +--
1316     +
1317     +DROP TABLE IF EXISTS `outbound_route_sequence`;
1318     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1319     +/*!40101 SET character_set_client = utf8 */;
1320     +CREATE TABLE `outbound_route_sequence` (
1321     + `route_id` int(11) NOT NULL,
1322     + `seq` int(11) NOT NULL,
1323     + PRIMARY KEY (`route_id`,`seq`)
1324     +);
1325     +/*!40101 SET character_set_client = @saved_cs_client */;
1326     +
1327     +--
1328     +-- Dumping data for table `outbound_route_sequence`
1329     +--
1330     +
1331     +LOCK TABLES `outbound_route_sequence` WRITE;
1332     +/*!40000 ALTER TABLE `outbound_route_sequence` DISABLE KEYS */;
1333     +/*!40000 ALTER TABLE `outbound_route_sequence` ENABLE KEYS */;
1334     +UNLOCK TABLES;
1335     +
1336     +--
1337     +-- Table structure for table `outbound_route_trunks`
1338     +--
1339     +
1340     +DROP TABLE IF EXISTS `outbound_route_trunks`;
1341     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1342     +/*!40101 SET character_set_client = utf8 */;
1343     +CREATE TABLE `outbound_route_trunks` (
1344     + `route_id` int(11) NOT NULL,
1345     + `trunk_id` int(11) NOT NULL,
1346     + `seq` int(11) NOT NULL,
1347     + PRIMARY KEY (`route_id`,`trunk_id`,`seq`)
1348     +);
1349     +/*!40101 SET character_set_client = @saved_cs_client */;
1350     +
1351     +--
1352     +-- Dumping data for table `outbound_route_trunks`
1353     +--
1354     +
1355     +LOCK TABLES `outbound_route_trunks` WRITE;
1356     +/*!40000 ALTER TABLE `outbound_route_trunks` DISABLE KEYS */;
1357     +/*!40000 ALTER TABLE `outbound_route_trunks` ENABLE KEYS */;
1358     +UNLOCK TABLES;
1359     +
1360     +--
1361     +-- Table structure for table `outbound_routes`
1362     +--
1363     +
1364     +DROP TABLE IF EXISTS `outbound_routes`;
1365     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1366     +/*!40101 SET character_set_client = utf8 */;
1367     +CREATE TABLE `outbound_routes` (
1368     + `route_id` int(11) NOT NULL AUTO_INCREMENT,
1369     + `name` varchar(40) DEFAULT NULL,
1370     + `outcid` varchar(40) DEFAULT NULL,
1371     + `outcid_mode` varchar(20) DEFAULT NULL,
1372     + `password` varchar(30) DEFAULT NULL,
1373     + `emergency_route` varchar(4) DEFAULT NULL,
1374     + `intracompany_route` varchar(4) DEFAULT NULL,
1375     + `mohclass` varchar(80) DEFAULT NULL,
1376     + `time_group_id` int(11) DEFAULT NULL,
1377     + `dest` varchar(255) DEFAULT NULL,
1378     + PRIMARY KEY (`route_id`)
1379     +);
1380     +/*!40101 SET character_set_client = @saved_cs_client */;
1381     +
1382     +--
1383     +-- Dumping data for table `outbound_routes`
1384     +--
1385     +
1386     +LOCK TABLES `outbound_routes` WRITE;
1387     +/*!40000 ALTER TABLE `outbound_routes` DISABLE KEYS */;
1388     +/*!40000 ALTER TABLE `outbound_routes` ENABLE KEYS */;
1389     +UNLOCK TABLES;
1390     +
1391     +--
1392     +-- Table structure for table `sip`
1393     +--
1394     +
1395     +DROP TABLE IF EXISTS `sip`;
1396     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1397     +/*!40101 SET character_set_client = utf8 */;
1398     +CREATE TABLE `sip` (
1399     + `id` varchar(20) NOT NULL DEFAULT '-1',
1400     + `keyword` varchar(30) NOT NULL DEFAULT '',
1401     + `data` varchar(255) NOT NULL,
1402     + `flags` int(1) NOT NULL DEFAULT '0',
1403     + PRIMARY KEY (`id`,`keyword`)
1404     +);
1405     +/*!40101 SET character_set_client = @saved_cs_client */;
1406     +
1407     +--
1408     +-- Dumping data for table `sip`
1409     +--
1410     +
1411     +LOCK TABLES `sip` WRITE;
1412     +/*!40000 ALTER TABLE `sip` DISABLE KEYS */;
1413     +/*!40000 ALTER TABLE `sip` ENABLE KEYS */;
1414     +UNLOCK TABLES;
1415     +
1416     +--
1417     +-- Table structure for table `sip`
1418     +--
1419     +
1420     +DROP TABLE IF EXISTS `pjsip`;
1421     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1422     +/*!40101 SET character_set_client = utf8 */;
1423     +CREATE TABLE `pjsip` (
1424     + `id` varchar(20) NOT NULL DEFAULT '-1',
1425     + `keyword` varchar(30) NOT NULL DEFAULT '',
1426     + `data` varchar(255) NOT NULL,
1427     + `flags` int(1) NOT NULL DEFAULT '0',
1428     + PRIMARY KEY (`id`,`keyword`)
1429     +);
1430     +/*!40101 SET character_set_client = @saved_cs_client */;
1431     +
1432     +--
1433     +-- Dumping data for table `pjsip`
1434     +--
1435     +
1436     +LOCK TABLES `pjsip` WRITE;
1437     +/*!40000 ALTER TABLE `pjsip` DISABLE KEYS */;
1438     +/*!40000 ALTER TABLE `pjsip` ENABLE KEYS */;
1439     +UNLOCK TABLES;
1440     +
1441     +--
1442     +-- Table structure for table `trunk_dialpatterns`
1443     +--
1444     +
1445     +DROP TABLE IF EXISTS `trunk_dialpatterns`;
1446     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1447     +/*!40101 SET character_set_client = utf8 */;
1448     +CREATE TABLE `trunk_dialpatterns` (
1449     + `trunkid` int(11) NOT NULL DEFAULT '0',
1450     + `match_pattern_prefix` varchar(50) NOT NULL DEFAULT '',
1451     + `match_pattern_pass` varchar(50) NOT NULL DEFAULT '',
1452     + `prepend_digits` varchar(50) NOT NULL DEFAULT '',
1453     + `seq` int(11) NOT NULL DEFAULT '0',
1454     + PRIMARY KEY (`trunkid`,`match_pattern_prefix`,`match_pattern_pass`,`prepend_digits`,`seq`)
1455     +);
1456     +/*!40101 SET character_set_client = @saved_cs_client */;
1457     +
1458     +--
1459     +-- Dumping data for table `trunk_dialpatterns`
1460     +--
1461     +
1462     +LOCK TABLES `trunk_dialpatterns` WRITE;
1463     +/*!40000 ALTER TABLE `trunk_dialpatterns` DISABLE KEYS */;
1464     +/*!40000 ALTER TABLE `trunk_dialpatterns` ENABLE KEYS */;
1465     +UNLOCK TABLES;
1466     +
1467     +--
1468     +-- Table structure for table `trunks`
1469     +--
1470     +
1471     +DROP TABLE IF EXISTS `trunks`;
1472     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1473     +/*!40101 SET character_set_client = utf8 */;
1474     +CREATE TABLE `trunks` (
1475     + `trunkid` int(11) NOT NULL DEFAULT '0',
1476     + `name` varchar(50) NOT NULL DEFAULT '',
1477     + `tech` varchar(20) NOT NULL,
1478     + `outcid` varchar(40) NOT NULL DEFAULT '',
1479     + `keepcid` varchar(4) DEFAULT 'off',
1480     + `maxchans` varchar(6) DEFAULT '',
1481     + `failscript` varchar(255) NOT NULL DEFAULT '',
1482     + `dialoutprefix` varchar(255) NOT NULL DEFAULT '',
1483     + `channelid` varchar(255) NOT NULL DEFAULT '',
1484     + `usercontext` varchar(255) DEFAULT NULL,
1485     + `provider` varchar(40) DEFAULT NULL,
1486     + `disabled` varchar(4) DEFAULT 'off',
1487     + `continue` varchar(4) DEFAULT 'off',
1488     + PRIMARY KEY (`trunkid`,`tech`,`channelid`)
1489     +);
1490     +/*!40101 SET character_set_client = @saved_cs_client */;
1491     +
1492     +--
1493     +-- Dumping data for table `trunks`
1494     +--
1495     +
1496     +LOCK TABLES `trunks` WRITE;
1497     +/*!40000 ALTER TABLE `trunks` DISABLE KEYS */;
1498     +INSERT INTO `trunks` VALUES (1,'','dahdi','','','','','','g0','',NULL,'off','off');
1499     +/*!40000 ALTER TABLE `trunks` ENABLE KEYS */;
1500     +UNLOCK TABLES;
1501     +
1502     +--
1503     +-- Table structure for table `users`
1504     +--
1505     +
1506     +DROP TABLE IF EXISTS `users`;
1507     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1508     +/*!40101 SET character_set_client = utf8 */;
1509     +CREATE TABLE `users` (
1510     + `extension` varchar(20) NOT NULL DEFAULT '',
1511     + `password` varchar(20) DEFAULT NULL,
1512     + `name` varchar(50) DEFAULT NULL,
1513     + `voicemail` varchar(50) DEFAULT NULL,
1514     + `ringtimer` int(3) DEFAULT NULL,
1515     + `noanswer` varchar(100) DEFAULT NULL,
1516     + `recording` varchar(50) DEFAULT NULL,
1517     + `outboundcid` varchar(50) DEFAULT NULL,
1518     + `sipname` varchar(50) DEFAULT NULL,
1519     + `noanswer_cid` varchar(20) NOT NULL DEFAULT '',
1520     + `busy_cid` varchar(20) NOT NULL DEFAULT '',
1521     + `chanunavail_cid` varchar(20) NOT NULL DEFAULT '',
1522     + `noanswer_dest` varchar(255) NOT NULL DEFAULT '',
1523     + `busy_dest` varchar(255) NOT NULL DEFAULT '',
1524     + `chanunavail_dest` varchar(255) NOT NULL DEFAULT '',
1525     + `mohclass` varchar(80) DEFAULT 'default',
1526     + KEY `extension` (`extension`)
1527     +);
1528     +/*!40101 SET character_set_client = @saved_cs_client */;
1529     +
1530     +--
1531     +-- Dumping data for table `users`
1532     +--
1533     +
1534     +LOCK TABLES `users` WRITE;
1535     +/*!40000 ALTER TABLE `users` DISABLE KEYS */;
1536     +/*!40000 ALTER TABLE `users` ENABLE KEYS */;
1537     +UNLOCK TABLES;
1538     +
1539     +--
1540     +-- Table structure for table `dahdichandids`
1541     +--
1542     +
1543     +DROP TABLE IF EXISTS `dahdichandids`;
1544     +/*!40101 SET @saved_cs_client = @@character_set_client */;
1545     +/*!40101 SET character_set_client = utf8 */;
1546     +CREATE TABLE `dahdichandids` (
1547     + `channel` int(11) NOT NULL DEFAULT '0',
1548     + `description` varchar(40) NOT NULL DEFAULT '',
1549     + `did` varchar(60) NOT NULL DEFAULT '',
1550     + PRIMARY KEY (`channel`)
1551     +);
1552     +/*!40101 SET character_set_client = @saved_cs_client */;
1553     +
1554     +--
1555     +-- Dumping data for table `dahdichandids`
1556     +--
1557     +
1558     +LOCK TABLES `dahdichandids` WRITE;
1559     +/*!40000 ALTER TABLE `dahdichandids` DISABLE KEYS */;
1560     +/*!40000 ALTER TABLE `dahdichandids` ENABLE KEYS */;
1561     +UNLOCK TABLES;
1562     +
1563     +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1564     +
1565     +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1566     +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1567     +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1568     +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1569     +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1570     +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1571     +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1572     +
1573     +-- Dump completed on 2013-12-04 1:30:59
1574     diff -Nur --no-dereference smeserver-freepbx-13.old/root/var/lib/asterisk/agi-bin/trunk_alert_mail.agi smeserver-freepbx-13/root/var/lib/asterisk/agi-bin/trunk_alert_mail.agi
1575     --- smeserver-freepbx-13.old/root/var/lib/asterisk/agi-bin/trunk_alert_mail.agi 2016-06-13 08:03:08.000000000 -0400
1576     +++ smeserver-freepbx-13/root/var/lib/asterisk/agi-bin/trunk_alert_mail.agi 1969-12-31 19:00:00.000000000 -0500
1577     @@ -1,44 +0,0 @@
1578     -#!/bin/bash
1579     -
1580     -declare -a array
1581     -while read -e ARG && [ "$ARG" ] ; do
1582     -array=(` echo $ARG | sed -e 's/://'`)
1583     -export ${array[0]}=${array[1]}
1584     -done
1585     -
1586     -TRUNK=$1
1587     -DOMAIN=`dnsdomainname`
1588     -HOST=`hostname`
1589     -
1590     -EMAIL=admin@$DOMAIN
1591     -
1592     -DATE=`date "+%d-%m-%Y %H:%M"`
1593     -
1594     -CID=`echo $agi_callerid`
1595     -CIDNAME=`echo $agi_calleridname`
1596     -EXTENSION=`echo $agi_extension`
1597     -#CHANNEL=`echo $agi_channel`
1598     -TYPE=`echo $agi_type`
1599     -DNID=`echo $agi_dnid`
1600     -
1601     -REPORT=$EXTENSION
1602     -
1603     -if [ "$EXTENSION" = "s-CHANUNAVAIL" ]; then
1604     - REPORT="Channel Unavailable"
1605     -elif [ "$EXTENSION" = "s-CONGESTION" ]; then
1606     - REPORT="Congestion"
1607     -fi
1608     -
1609     -# Message Formating
1610     -
1611     -MSG="\n\n A call from \"$CIDNAME\" <$CID> (Type $TYPE)\n"
1612     -MSG="$MSG To : $DNID\n"
1613     -MSG="$MSG Using Trunk : $TRUNK\n"
1614     -MSG="$MSG Has failed on host $HOST.$DOMAIN at $DATE\n\n"
1615     -MSG="$MSG The error is : $REPORT \n\n"
1616     -
1617     -# Send an email
1618     -
1619     -echo -e "$MSG" | mail -s "[FAILED CALL] on host $HOST.$DOMAIN" "$EMAIL"
1620     -
1621     -

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed