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

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