added option to copy sample conf files to /etc/asterisk in install.pl script

git-svn-id: svn://192.168.202.10@533 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-02-19 20:55:12 +00:00
parent baa7d46a9e
commit 0e7766a89d
9 changed files with 63 additions and 28 deletions
-3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/dnsmgr.conf:
; This file is very useful for DNS refreshing when using VOIP providers
[general]
enable=yes ; enable creation of managed DNS lookups
refreshinterval=300 ; refresh managed DNS lookups every <n> seconds
+2 -3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/meetme.conf:
; This is the sample meetme conferencing configuration file
[general]
static=yes
writeprotect=no
@@ -110,6 +107,8 @@ exten => 4001,1,Dial,Zap/1|30| ; ring Zap device 1
exten => 4001,2,Voicemail,u4001 ; Send to voicemail...
; FastAGI for VICIDIAL/astGUIclient call logging
exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log)
exten => h,2,DeadAGI(agi://127.0.0.1:4577/VD_hangup--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}))
+1 -5
View File
@@ -1,7 +1,3 @@
; /etc/asterisk/iax.conf:
; Here is an example of a configuration where there is one IAX phone, one IAX
; server as a friend and one IAX trunk from a service provider (binfone.com)
[general]
bindport=4569
iaxcompat=yes
@@ -11,7 +7,7 @@ allow=gsm ; Always allow GSM, it's cool :)
jitterbuffer=no
tos=lowdelay
register => 1112223333:PASSWORD@iax.binfone.com
;register => 1112223333:PASSWORD@iax.binfone.com
[1112223333]
auth=md5
-3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/logger.conf:
; This is the sample Asterisk Logging configuration file
[logfiles]
console => notice,warning,error
messages => notice,warning,error,debug,verbose
-3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/manager.conf:
; This is the sample manager API configuration file
[general]
enabled = yes
port = 5038
-3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/meetme.conf:
; This is the sample meetme conferencing configuration file
[rooms]
conf => 8600
conf => 8601,1234
-4
View File
@@ -1,7 +1,3 @@
; /etc/asterisk/sip.conf:
; Here is an example of a configuration where there are three SIP phones
; and one SIP trunk connected
[general]
port = 5060
bindaddr = 0.0.0.0
-3
View File
@@ -1,6 +1,3 @@
; /etc/asterisk/voicemail.conf:
; This is the sample voicemail configuration file
[general]
format=wav49|gsm|wav
serveremail=asterisk
+60 -1
View File
@@ -2,7 +2,7 @@
# install.pl
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
############################################
@@ -124,6 +124,7 @@ if (length($ARGV[0])>1)
print " 5 - AST_VDadapt (If multi-server system, this must only be on one server)\n";
print " 6 - FastAGI_log\n";
print " 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n";
print " [--copy_sample_conf_files] = copies the sample conf files to /etc/asterisk/\n";
print " [--fastagi_log_min_servers=3] = define FastAGI log min servers\n";
print " [--fastagi_log_max_servers=16] = define FastAGI log max servers\n";
print " [--fastagi_log_min_spare_servers=2] = define FastAGI log min spare servers\n";
@@ -313,6 +314,15 @@ if (length($ARGV[0])>1)
print " CLI active keepalive procs: $VARactive_keepalives\n";
}
}
if ($args =~ /--copy_sample_conf_files/i) # CLI defined conf files
{
$CLIcopy_conf_files='y';
print " CLI copy conf files: YES\n";
}
else
{
$CLIcopy_conf_files='n';
}
if ($args =~ /--fastagi_log_min_servers=/i) # CLI defined fastagi min servers
{
@CLIDB_minserARY = split(/--fastagi_log_min_servers=/,$args);
@@ -996,6 +1006,41 @@ else
}
##### END active_keepalives prompting and check #####
##### BEGIN copy asterisk sample conf files prompt #####
$continue='NO';
while ($continue =~/NO/)
{
print("\nCopy sample configuration files to /etc/asterisk/ ? [$CLIcopy_conf_files] ");
$PROMPTcopy_conf_files = <STDIN>;
chomp($PROMPTcopy_conf_files);
if (length($PROMPTcopy_conf_files)<1)
{$PROMPTcopy_conf_files = $CLIcopy_conf_files;}
if ($PROMPTcopy_conf_files =~ /y/i)
{
if (!-e "/etc/asterisk")
{
print("/etc/asterisk does not exist, would you like me to create it?(y/n) [y] ");
$createPROMPTmonitor = <STDIN>;
chomp($createPROMPTmonitor);
if ($createPROMPTmonitor =~ /n/i)
{
$continue='NO';
}
else
{
`mkdir -p /etc/asterisk`;
print " /etc/asterisk directory created\n";
$continue='YES';
}
}
else
{
$continue='YES';
}
}
}
##### END copy asterisk sample conf files prompt #####
##### BEGIN fastagi_log_min_servers prompting and check #####
$continue='NO';
while ($continue =~/NO/)
@@ -1151,6 +1196,7 @@ else
print " defined DB_pass: $VARDB_pass\n";
print " defined DB_port: $VARDB_port\n";
print " defined active_keepalives $VARactive_keepalives\n";
print " defined copying conf files: $PROMPTcopy_conf_files\n";
print " defined fastagi_log_min_servers: $VARfastagi_log_min_servers\n";
print " defined fastagi_log_max_servers: $VARfastagi_log_max_servers\n";
print " defined fastagi_log_min_spare_servers: $VARfastagi_log_min_spare_servers\n";
@@ -1276,6 +1322,19 @@ if ($NOWEB < 1)
`chmod 0777 $PATHweb/vicidial/agent_reports/`;
}
if ($PROMPTcopy_conf_files =~ /y/i)
{
print "Copying sample conf files to /etc/asterisk/...\n";
cp -f ./docs/conf_examples/extensions.conf.sample /etc/asterisk/extensions.conf`;
cp -f ./docs/conf_examples/meetme.conf.sample /etc/asterisk/meetme.conf`;
cp -f ./docs/conf_examples/manager.conf.sample /etc/asterisk/manager.conf`;
cp -f ./docs/conf_examples/voicemail.conf.sample /etc/asterisk/voicemail.conf`;
cp -f ./docs/conf_examples/sip.conf.sample /etc/asterisk/sip.conf`;
cp -f ./docs/conf_examples/logger.conf.sample /etc/asterisk/logger.conf`;
cp -f ./docs/conf_examples/iax.conf.sample /etc/asterisk/iax.conf`;
cp -f ./docs/conf_examples/dnsmgr.conf.sample /etc/asterisk/dnsmgr.conf`;
}
print "\nASTGUICLIENT INSTALLATION FINISHED! ENJOY!\n";
$secy = time(); $secz = ($secy - $secX); $minz = ($secz/60); # calculate script runtime so far