From bc5d5c22c611a436ca1e29a74b3b83e831a760d7 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 19 Feb 2007 20:55:12 +0000 Subject: [PATCH] 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 --- .../docs/conf_examples/dnsmgr.conf.sample | 3 - .../docs/conf_examples/extensions.conf.sample | 5 +- .../trunk/docs/conf_examples/iax.conf.sample | 6 +- .../docs/conf_examples/logger.conf.sample | 3 - .../docs/conf_examples/manager.conf.sample | 3 - .../docs/conf_examples/meetme.conf.sample | 3 - .../trunk/docs/conf_examples/sip.conf.sample | 4 -- .../docs/conf_examples/voicemail.conf.sample | 3 - agc_2-X/trunk/install.pl | 61 ++++++++++++++++++- 9 files changed, 63 insertions(+), 28 deletions(-) diff --git a/agc_2-X/trunk/docs/conf_examples/dnsmgr.conf.sample b/agc_2-X/trunk/docs/conf_examples/dnsmgr.conf.sample index 2dd3f7fe..160aecc4 100644 --- a/agc_2-X/trunk/docs/conf_examples/dnsmgr.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/dnsmgr.conf.sample @@ -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 seconds diff --git a/agc_2-X/trunk/docs/conf_examples/extensions.conf.sample b/agc_2-X/trunk/docs/conf_examples/extensions.conf.sample index 16e9dd1c..d8729eec 100644 --- a/agc_2-X/trunk/docs/conf_examples/extensions.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/extensions.conf.sample @@ -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})) diff --git a/agc_2-X/trunk/docs/conf_examples/iax.conf.sample b/agc_2-X/trunk/docs/conf_examples/iax.conf.sample index eed52c6b..2f08a53f 100644 --- a/agc_2-X/trunk/docs/conf_examples/iax.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/iax.conf.sample @@ -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 diff --git a/agc_2-X/trunk/docs/conf_examples/logger.conf.sample b/agc_2-X/trunk/docs/conf_examples/logger.conf.sample index cfea55f6..0c4c74a3 100644 --- a/agc_2-X/trunk/docs/conf_examples/logger.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/logger.conf.sample @@ -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 diff --git a/agc_2-X/trunk/docs/conf_examples/manager.conf.sample b/agc_2-X/trunk/docs/conf_examples/manager.conf.sample index 77533401..ac195fa5 100644 --- a/agc_2-X/trunk/docs/conf_examples/manager.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/manager.conf.sample @@ -1,6 +1,3 @@ -; /etc/asterisk/manager.conf: -; This is the sample manager API configuration file - [general] enabled = yes port = 5038 diff --git a/agc_2-X/trunk/docs/conf_examples/meetme.conf.sample b/agc_2-X/trunk/docs/conf_examples/meetme.conf.sample index 2b342a0f..a7f98ebe 100644 --- a/agc_2-X/trunk/docs/conf_examples/meetme.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/meetme.conf.sample @@ -1,6 +1,3 @@ -; /etc/asterisk/meetme.conf: -; This is the sample meetme conferencing configuration file - [rooms] conf => 8600 conf => 8601,1234 diff --git a/agc_2-X/trunk/docs/conf_examples/sip.conf.sample b/agc_2-X/trunk/docs/conf_examples/sip.conf.sample index a7c7052d..21f1617e 100644 --- a/agc_2-X/trunk/docs/conf_examples/sip.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/sip.conf.sample @@ -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 diff --git a/agc_2-X/trunk/docs/conf_examples/voicemail.conf.sample b/agc_2-X/trunk/docs/conf_examples/voicemail.conf.sample index be18efb5..4b3546ac 100644 --- a/agc_2-X/trunk/docs/conf_examples/voicemail.conf.sample +++ b/agc_2-X/trunk/docs/conf_examples/voicemail.conf.sample @@ -1,6 +1,3 @@ -; /etc/asterisk/voicemail.conf: -; This is the sample voicemail configuration file - [general] format=wav49|gsm|wav serveremail=asterisk diff --git a/agc_2-X/trunk/install.pl b/agc_2-X/trunk/install.pl index 1e593e01..2888d751 100644 --- a/agc_2-X/trunk/install.pl +++ b/agc_2-X/trunk/install.pl @@ -2,7 +2,7 @@ # install.pl # -# Copyright (C) 2006 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell 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 = ; + 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 = ; + 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