/[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.4 - (hide annotations) (download)
Sun Mar 27 20:19:53 2022 UTC (2 years, 7 months ago) by jpp
Branch: MAIN
Changes since 1.3: +10 -7 lines
* Wed Nov 10 2021 Jean-Philippe Pialasse <tests@pialasse.com> 13-17.sme
- first import to SME10 [SME: 11613]
- make it Freepbx 14 compatible [SME: 10705] 
  add dependencies for SME10 mariadb nodejs >= 10 php70*
  remove missing rpms asterisk-sounds-extra-en-ulaw asterisk-resample asterisk-addons
  remove double owned folders /etc/asterisk /var/lib/asterisk
  systemd ready for asterisk(disabled), freepbx, httpd-fpbx
  smeserver-freepbx-update event created NEED TEST
  php70-php-fpm fragment
  update httpd-fpbx template for php-fpm use
  TODO : update httpd-e-smith to use php-fpm for fpbx
  update install script for php74
  add a copy of safe_asterisk
  TODO : create php folders and set rights
  improve logrotate

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

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