diff --git a/bin/AST_CRON_mix_recordings.pl b/bin/AST_CRON_mix_recordings.pl index f14198e3..7df290af 100644 --- a/bin/AST_CRON_mix_recordings.pl +++ b/bin/AST_CRON_mix_recordings.pl @@ -27,10 +27,11 @@ # Copyright (C) 2006 Matt Florell LICENSE: GPLv2 # # -# 51021-1058 Added quotes around CLI executed commands -# 51122-1458 Added soxmix binary path check -# 60318-0921 Added ability to mix gsm audio files -# +# 51021-1058 - Added quotes around CLI executed commands +# 51122-1458 - Added soxmix binary path check +# 60318-0921 - Added ability to mix gsm audio files +# 60807-1308 - Modified to use /etc/astguiclient.conf for settings +# #$v=1; @@ -41,8 +42,50 @@ $FTP_user = 'cron'; $FTP_pass = 'test'; $FTP_dir = 'RECORDINGS'; + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + ### directory where in/out recordings are saved to by Asterisk -$dir1 = '/var/spool/asterisk/monitor'; +$dir1 = "$PATHmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} diff --git a/bin/AST_CRON_mix_recordings_BASIC.pl b/bin/AST_CRON_mix_recordings_BASIC.pl index 87dce180..ef2f661d 100644 --- a/bin/AST_CRON_mix_recordings_BASIC.pl +++ b/bin/AST_CRON_mix_recordings_BASIC.pl @@ -27,17 +27,56 @@ # Copyright (C) 2006 Matt Florell LICENSE: GPLv2 # # -# 51021-1058 Added quotes around CLI executed commands -# 51122-1456 Added soxmix binary path check -# 60318-0921 Added ability to mix gsm audio files +# 51021-1058 - Added quotes around CLI executed commands +# 51122-1456 - Added soxmix binary path check +# 60318-0921 - Added ability to mix gsm audio files +# 60807-1308 - Modified to use /etc/astguiclient.conf for settings # -#$v=1; +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP ### directory where in/out recordings are saved to by Asterisk -$dir1 = '/var/spool/asterisk/monitor'; +$dir1 = "$PATHmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} diff --git a/bin/AST_CRON_mix_recordings_GSM.pl b/bin/AST_CRON_mix_recordings_GSM.pl index 02c5ef63..a4d95720 100644 --- a/bin/AST_CRON_mix_recordings_GSM.pl +++ b/bin/AST_CRON_mix_recordings_GSM.pl @@ -28,13 +28,12 @@ # Copyright (C) 2006 Matt Florell LICENSE: GPLv2 # # -# 51021-1058 Added quotes around CLI executed commands -# 51122-1455 Added soxmix and sox binary path check +# 51021-1058 - Added quotes around CLI executed commands +# 51122-1455 - Added soxmix and sox binary path check +# 60807-1308 - Modified to use /etc/astguiclient.conf for settings # -#$v=1; - # Customize variables for FTP $FTP_host = '10.0.0.4'; $FTP_user = 'cron'; @@ -42,8 +41,50 @@ $FTP_pass = 'test'; $FTP_dir = 'RECORDINGS'; $FTP_port = '21'; + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + ### directory where in/out recordings are saved to by Asterisk -$dir1 = '/var/spool/asterisk/monitor'; +$dir1 = "$PATHmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';} diff --git a/bin/AST_CRON_mix_recordings_MP3.pl b/bin/AST_CRON_mix_recordings_MP3.pl index 2133f485..127c0147 100644 --- a/bin/AST_CRON_mix_recordings_MP3.pl +++ b/bin/AST_CRON_mix_recordings_MP3.pl @@ -31,11 +31,10 @@ # 51021-1058 - Added quotes around CLI executed commands # 51122-1455 - Added soxmix and sox binary path check # 60616-1027 - Modified to convert to MP3 format +# 60807-1308 - Modified to use /etc/astguiclient.conf for settings # -#$v=1; - # Customize variables for FTP $FTP_host = '10.0.0.4'; $FTP_user = 'cron'; @@ -43,8 +42,50 @@ $FTP_pass = 'test'; $FTP_dir = 'recordings'; $FTP_port = '21'; + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP + ### directory where in/out recordings are saved to by Asterisk -$dir1 = '/var/spool/asterisk/monitor'; +$dir1 = "$PATHmonitor"; $soxmixbin = ''; if ( -e ('/usr/bin/soxmix')) {$soxmixbin = '/usr/bin/soxmix';}