Added option for Auto-inactive of expired lists
Fixed issue with using CALLID at beginning of recording filename Added partial experimantal Asterisk 13 compatibility git-svn-id: svn://192.168.202.10@2817 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -194,6 +194,12 @@ OTHER CHANGES:
|
||||
|
||||
46. Added Agent Inbound Status Summary Report
|
||||
|
||||
47. Added experimental support for Asterisk 13. See the ASTERISK_13.txt doc
|
||||
for notes on changes needed to get it to work.
|
||||
|
||||
48. Added System Settings option to set lists to inactive once they pass their
|
||||
expiration date
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@
|
||||
# 170621-2031 - Added missing list_id in log inserts
|
||||
# 170816-2245 - Added ask survey options
|
||||
# 170903-0929 - Added additional xfer_log details
|
||||
# 170914-1634 - Added Asterisk 13 compatibility
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -708,7 +709,7 @@ if ($channel =~ /Local/i)
|
||||
|
||||
### Grab Server values from the database
|
||||
$cbc=0;
|
||||
$stmtA = "SELECT voicemail_dump_exten,ext_context,answer_transfer_agent,local_gmt,asterisk_version,max_vicidial_trunks,voicemail_dump_exten_no_inst FROM servers where server_ip = '$VARserver_ip';";
|
||||
$stmtA = "SELECT voicemail_dump_exten,ext_context,answer_transfer_agent,local_gmt,asterisk_version,max_vicidial_trunks,voicemail_dump_exten_no_inst,routing_prefix FROM servers where server_ip = '$VARserver_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -723,6 +724,7 @@ while ($sthArows > $cbc)
|
||||
$asterisk_version = $aryA[4];
|
||||
$DBmax_vicidial_trunks = $aryA[5];
|
||||
$voicemail_dump_exten_no_inst = $aryA[6];
|
||||
$routing_prefix = $aryA[7];
|
||||
if ($DBvoicemail_dump_exten) {$voicemail_dump_exten = $DBvoicemail_dump_exten;}
|
||||
if ($DBext_context) {$ext_context = $DBext_context;}
|
||||
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
|
||||
@@ -3223,7 +3225,11 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
|
||||
$RAFaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='02167'; $MEL_aff_rows=$RAFaffected_rows; &mysql_error_logging;
|
||||
|
||||
$RINGALLexten = "8331*$auto_call_id*$callerid*$ARuser[$ragp]*$ARdialplan_number[$ragp]";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{ $RINGALLexten = "8331*$auto_call_id*$callerid*$ARuser[$ragp]*$ARdialplan_number[$ragp]"; }
|
||||
else
|
||||
{ $RINGALLexten = "$routing_prefix" . "8331*$auto_call_id*$callerid*$ARuser[$ragp]*$ARdialplan_number[$ragp]"; }
|
||||
|
||||
$PADauto_call_id = sprintf("%011s", $auto_call_id); while (length($PADauto_call_id) > 11) {chop($PADauto_call_id);}
|
||||
$RINGALLqueryCID = "RINGAGENT$PADauto_call_id";
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# agi_VDAD_local_optimize.agi
|
||||
#
|
||||
# This script looks up the Local channel in the cid_channels_recent table
|
||||
# and redirects the actual channel to the current extension with the first
|
||||
# two digits stripped off. IE 138368 -> 8368. This is to overcome the change
|
||||
# to Local channels in Asterisk 12 and later.
|
||||
#
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 170104-1700 - First build
|
||||
# 170420-1100 - Indexed call_date and added it to the channel lookup
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
my $script = 'agi_VDAD_local_optimize.agi';
|
||||
|
||||
# constants and globals
|
||||
my ($servConf, $SYSLOG);
|
||||
my %conf;
|
||||
$conf{PATHconf} = '/etc/astguiclient.conf'; # default path to astguiclient configuration file:
|
||||
|
||||
# Begin Parsing astguiclient config file.
|
||||
open(CONF, $conf{PATHconf}) || die "can't open " . $conf{PATHconf} . ": " . $! . "\n";
|
||||
while (my $line = <CONF>)
|
||||
{
|
||||
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||
foreach my $key (qw( PATHhome PATHlogs PATHagi PATHweb PATHsounds PATHmontior
|
||||
VARserver_ip VARDB_server VARDB_database VARDB_user VARDB_pass VARDB_port))
|
||||
{
|
||||
if ($line =~ /^$key/)
|
||||
{
|
||||
$conf{$key} = $line;
|
||||
$conf{$key} =~ s/.*=//gi;
|
||||
}
|
||||
}
|
||||
}
|
||||
$conf{VARDB_port} = '3306' unless ($conf{VARDB_port});
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
$year = ($year + 1900);
|
||||
$mon++;
|
||||
if ($mon < 10) {$mon = "0$mon";}
|
||||
if ($mday < 10) {$mday = "0$mday";}
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
my $SQLdate = "$year-$mon-$mday $hour:$min:$sec";
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time - 120);
|
||||
$year = ($year + 1900);
|
||||
$mon++;
|
||||
if ($mon < 10) {$mon = "0$mon";}
|
||||
if ($mday < 10) {$mday = "0$mday";}
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
my $SQL2mindate = "$year-$mon-$mday $hour:$min:$sec";
|
||||
|
||||
use DBI;
|
||||
use Asterisk::AGI;
|
||||
use Time::HiRes ('gettimeofday','usleep','sleep');
|
||||
|
||||
my ($seconds, $microseconds) = gettimeofday;
|
||||
|
||||
print STDERR "$seconds.$microseconds\n";
|
||||
|
||||
my $AGI = new Asterisk::AGI;
|
||||
|
||||
my $dbhA = DBI->connect("DBI:mysql:" . $conf{VARDB_database} . ":" . $conf{VARDB_server} . ":" . $conf{VARDB_port},
|
||||
$conf{VARDB_user}, $conf{VARDB_pass}) or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
my %agi_vars = $AGI->ReadParse();
|
||||
|
||||
my $channel = $agi_vars{'channel'};
|
||||
my $cid_name = $agi_vars{'calleridname'};
|
||||
my $connected_line_name = $agi_vars{'arg_1'};
|
||||
my $extension = $agi_vars{'extension'};
|
||||
my $context = $agi_vars{'context'};
|
||||
my $uniqueid = $agi_vars{'uniqueid'};
|
||||
my $dest_channel = "";
|
||||
|
||||
my $new_extension = substr( $extension, 2 );
|
||||
|
||||
# find the local channel's real channel
|
||||
my $stmtA = "SELECT dest_channel FROM cid_channels_recent where (caller_id_name = '$cid_name' or connected_line_name = '$connected_line_name' or caller_id_name = '$connected_line_name' or connected_line_name = '$cid_name') and ( linkedid = '$uniqueid' or dest_uniqueid = '$uniqueid' or uniqueid = '$uniqueid') and call_date > '$SQL2mindate'";
|
||||
my $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
|
||||
print STDERR "$stmtA\n";
|
||||
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
my $sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
my @aryA = $sthA->fetchrow_array;
|
||||
$dest_channel = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ( $dest_channel ne "" )
|
||||
{
|
||||
print STDERR "$sthArows|$dest_channel\n";
|
||||
|
||||
### insert a NEW record to the vicidial_manager table to be processed
|
||||
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','SENT','N','$conf{VARserver_ip}','','Redirect','$cid_name','Channel: $dest_channel','Context: $context','Exten: $new_extension','Priority: 1','','','','','','')";
|
||||
|
||||
print STDERR "$stmtA\n";
|
||||
|
||||
my $affected_rows = $dbhA->do($stmtA);
|
||||
my $man_id = $dbhA->{'mysql_insertid'};
|
||||
|
||||
### Grab Server values from the database
|
||||
$servConf = getServerConfig($dbhA, $conf{VARserver_ip});
|
||||
$SYSLOG = 1 if ($servConf->{vd_server_logs} =~ /Y/);
|
||||
my $event_string='LOGGED INTO MYSQL SERVER ON 1 CONNECTION|';
|
||||
eventLogger($conf{PATHlogs}, 'process', $event_string);
|
||||
|
||||
my $cPATHlogs = $conf{PATHlogs};
|
||||
|
||||
my $launch = $conf{PATHhome} . "/AST_send_action_child.pl";
|
||||
$launch .= " --SYSLOG";
|
||||
$launch .= " --PATHlogs=" . $cPATHlogs;
|
||||
$launch .= " --telnet_host=" . $servConf->{telnet_host};
|
||||
$launch .= " --telnet_port=" . $servConf->{telnet_port};
|
||||
$launch .= " --ASTmgrUSERNAME=" . $servConf->{ASTmgrUSERNAME};
|
||||
$launch .= " --ASTmgrSECRET=" . $servConf->{ASTmgrSECRET};
|
||||
$launch .= " --ASTmgrUSERNAMEsend=" . $servConf->{ASTmgrUSERNAMEsend};
|
||||
$launch .= " --man_id=" . $man_id;
|
||||
$launch .= " --action=Redirect";
|
||||
$launch .= " --cmd_line_b='Channel: $dest_channel'";
|
||||
$launch .= " --cmd_line_c='Context: $context'";
|
||||
$launch .= " --cmd_line_d='Exten: $new_extension'";
|
||||
$launch .= " --cmd_line_e='Priority: 1'";
|
||||
|
||||
eventLogger($conf{'PATHlogs'}, 'launch', $launch . " " .
|
||||
$cid_name . " " . $uniqueid . " " . $dest_channel);
|
||||
|
||||
$launch .= " >> " . $conf{PATHlogs} . "/action_send." . logDate() if ($SYSLOG);
|
||||
system($launch . ' &');
|
||||
|
||||
print STDERR "$launch\n";
|
||||
|
||||
usleep(1*10*1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "NO DestChannel for callid $cid_name|$agi_vars{'channel'}!!!\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
exit;
|
||||
|
||||
# getServerConfig usage:
|
||||
# getServerConfig($dbh, $serverIP);
|
||||
# Requires:
|
||||
# $dbh : Database handle to current open DB.
|
||||
# $serverIP : IP of server to get config for.
|
||||
# Returns:
|
||||
# hashref with conents of table entry.
|
||||
sub getServerConfig
|
||||
{
|
||||
my ($dbhA, $serverip) = @_;
|
||||
my $stmtA = "SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret FROM servers where server_ip = '" . $serverip ."';";
|
||||
my $sthA = $dbhA->prepare($stmtA) or die "preparing: " . $dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA " . $dbhA->errstr;
|
||||
my $servConf = $sthA->fetchrow_hashref;
|
||||
$SYSLOG = 1 if ($servConf->{vd_server_logs} =~ /Y/);
|
||||
$sthA->finish();
|
||||
return $servConf;
|
||||
}
|
||||
|
||||
# eventLogger usage:
|
||||
# eventLgger($LogFileDir, $LogType, $EventString);
|
||||
# Requires:
|
||||
# $LogFilePath : Directory where log files are.
|
||||
# $LogType : Type of log, ie process, send, launch, full
|
||||
# $EventString : String to record in log.
|
||||
sub eventLogger
|
||||
{
|
||||
my ($path,$type,$string) = @_;
|
||||
open(LOG, ">>" . $path . "/action_" . $type . "." . logDate())
|
||||
|| die "Can't open " . $path . "/action_" . $type . "." .
|
||||
logDate() . ": " . $! . "\n";
|
||||
print LOG nowDate() . "|" . $string . "|\n";
|
||||
close(LOG);
|
||||
}
|
||||
|
||||
# logDate usage:
|
||||
# logDate($SecondsSinceEpoch);
|
||||
# Options:
|
||||
# $SecondsSinceEpoch : Request time in seconds, defaults to current date/time.
|
||||
# Returns:
|
||||
# scalar date string ie "2007-01-01"
|
||||
sub logDate
|
||||
{
|
||||
my ($tms) = @_;
|
||||
my($sec,$min,$hour,$mday,$mon,$year) = getTime($tms);
|
||||
return $year . '-' . $mon . '-' . $mday;
|
||||
}
|
||||
|
||||
# nowDate usage:
|
||||
# nowDate($SecondsSinceEpoch);
|
||||
# Options:
|
||||
# $SecondsSinceEpoch : Request time in seconds, defaults to current date/time.
|
||||
# Returns:
|
||||
# scalar date/time string (MySQL formatted) ie "2007-01-01 00:00:00"
|
||||
sub nowDate
|
||||
{
|
||||
my ($tms) = @_;
|
||||
my($sec,$min,$hour,$mday,$mon,$year) = getTime($tms);
|
||||
return $year.'-'.$mon.'-'.$mday.' '.$hour.':'.$min.':'.$sec;
|
||||
}
|
||||
|
||||
# getTime usage:
|
||||
# getTime($SecondsSinceEpoch);
|
||||
# Options:
|
||||
# $SecondsSinceEpoch : Request time in seconds, defaults to current date/time.
|
||||
# Returns:
|
||||
# ($sec, $min, $hour. $day, $mon, $year)
|
||||
sub getTime
|
||||
{
|
||||
my ($tms) = @_;
|
||||
$tms = time unless ($tms);
|
||||
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($tms);
|
||||
$year += 1900;
|
||||
$mon++;
|
||||
$mon = "0" . $mon if ($mon < 10);
|
||||
$mday = "0" . $mday if ($mday < 10);
|
||||
$min = "0" . $min if ($min < 10);
|
||||
$sec = "0" . $sec if ($sec < 10);
|
||||
return ($sec,$min,$hour,$mday,$mon,$year);
|
||||
}
|
||||
+172
-163
@@ -122,9 +122,11 @@
|
||||
# 170711-0824 - Fixed help documentation for delay seconds, issue #1025
|
||||
# 170725-0017 - Added vicidial_campaign_hour_counts and vicidial_carrier_hour_counts rolling
|
||||
# 170816-2323 - Added In-Group Ask-Post-Call Survey AGI dialplan entries
|
||||
# 170916-1009 - Added Asterisk 13 'h' exten for dialplan generation and triggering of AMI2 scripts
|
||||
# 170920-2214 - Added expired_lists_inactive option, checks once per hour
|
||||
#
|
||||
|
||||
$build = '170816-2323';
|
||||
$build = '170920-2214';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
$teodDB=0; # flag to log Timeclock End of Day processes to log file
|
||||
@@ -150,6 +152,7 @@ if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
$now_date = "$year-$mon-$mday $hour:$min:$sec";
|
||||
$today_start = "$year-$mon-$mday 00:00:00";
|
||||
$today_date = "$year-$mon-$mday";
|
||||
$reset_test = "$hour$min";
|
||||
|
||||
### calculate the date and time for slightly less than 24 hours ago
|
||||
@@ -322,7 +325,6 @@ else
|
||||
}
|
||||
### end parsing run-time options ###
|
||||
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
@@ -338,8 +340,26 @@ foreach(@conf)
|
||||
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
|
||||
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) )
|
||||
{$VARactive_keepalives = $line; $VARactive_keepalives =~ 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_custom_user/) && ($CLIDB_custom_user < 1) )
|
||||
{$VARDB_custom_user = $line; $VARDB_custom_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_custom_pass/) && ($CLIDB_custom_pass < 1) )
|
||||
{$VARDB_custom_pass = $line; $VARDB_custom_pass =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
|
||||
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -357,6 +377,73 @@ foreach(@conf)
|
||||
# E - Email parser script
|
||||
# - Other setting are set by configuring them in the database
|
||||
|
||||
# Customized Variables
|
||||
$server_ip = $VARserver_ip; # Asterisk server IP
|
||||
$THISserver_voicemail=0;
|
||||
$voicemail_server_id='';
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
##### Get the settings from system_settings #####
|
||||
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive FROM system_settings;";
|
||||
# print "$stmtA\n";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$sounds_central_control_active = $aryA[0];
|
||||
$active_voicemail_server = $aryA[1];
|
||||
$SScustom_dialplan_entry = $aryA[2];
|
||||
$SSdefault_codecs = $aryA[3];
|
||||
$SSgenerate_cross_server_exten = $aryA[4];
|
||||
$SSvoicemail_timezones = $aryA[5];
|
||||
$SSdefault_voicemail_timezone = $aryA[6];
|
||||
$SScall_menu_qualify_enabled = $aryA[7];
|
||||
$SSallow_voicemail_greeting = $aryA[8];
|
||||
$SSreload_timestamp = $aryA[9];
|
||||
$meetme_enter_login_filename = $aryA[10];
|
||||
$meetme_enter_leave3way_filename = $aryA[11];
|
||||
$SSallow_chats = $aryA[12];
|
||||
$SSenable_auto_reports = $aryA[13];
|
||||
$SSenable_drop_lists = $aryA[14];
|
||||
$SSexpired_lists_inactive = $aryA[15];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
|
||||
|
||||
##### Get the settings for this server's server_ip #####
|
||||
$stmtA = "SELECT active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,asterisk_version,sounds_update,conf_secret,custom_dialplan_entry,auto_restart_asterisk,asterisk_temp_no_restart,gather_asterisk_output,conf_qualify FROM servers where server_ip='$server_ip';";
|
||||
# print "$stmtA\n";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$active_asterisk_server = $aryA[0];
|
||||
$generate_vicidial_conf = $aryA[1];
|
||||
$rebuild_conf_files = $aryA[2];
|
||||
$asterisk_version = $aryA[3];
|
||||
$sounds_update = $aryA[4];
|
||||
$self_conf_secret = $aryA[5];
|
||||
$SERVERcustom_dialplan_entry = $aryA[6];
|
||||
$auto_restart_asterisk = $aryA[7];
|
||||
$asterisk_temp_no_restart = $aryA[8];
|
||||
$gather_asterisk_output = $aryA[9];
|
||||
$conf_qualify = $aryA[10];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if ($DBX) {print "Asterisk version: $ast_ver_str{major} $ast_ver_str{minor}\n";}
|
||||
|
||||
if ($VARactive_keepalives =~ /X/)
|
||||
{
|
||||
if ($DB) {print "X in active_keepalives, skipping this section...\n";}
|
||||
@@ -473,7 +560,7 @@ else
|
||||
$runningASTERISK++;
|
||||
if ($DB) {print "asterisk RUNNING: |$psoutput[$i]|\n";}
|
||||
}
|
||||
if ($psline[1] =~ /$REGhome\/AST_update\.pl/)
|
||||
if ($psline[1] =~ /$REGhome\/AST_update/)
|
||||
{
|
||||
$runningAST_update++;
|
||||
if ($DB) {print "AST_update RUNNING: |$psline[1]|\n";}
|
||||
@@ -630,7 +717,7 @@ else
|
||||
$runningASTERISK++;
|
||||
if ($DB) {print "asterisk RUNNING: |$psoutput2[$i]|\n";}
|
||||
}
|
||||
if ($psline[1] =~ /$REGhome\/AST_update\.pl/)
|
||||
if ($psline[1] =~ /$REGhome\/AST_update/)
|
||||
{
|
||||
$runningAST_update++;
|
||||
if ($DB) {print "AST_update RUNNING: |$psline[1]|\n";}
|
||||
@@ -693,7 +780,10 @@ else
|
||||
{
|
||||
if ($DB) {print "starting AST_update...\n";}
|
||||
# add a '-L' to the command below to activate logging
|
||||
`/usr/bin/screen -d -m -S ASTupdate $PATHhome/AST_update.pl`;
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} >= 12))
|
||||
{`/usr/bin/screen -d -m -S ASTupdate $PATHhome/AST_update_AMI2.pl`;}
|
||||
else
|
||||
{`/usr/bin/screen -d -m -S ASTupdate $PATHhome/AST_update.pl`;}
|
||||
}
|
||||
if ( ($AST_send_listen > 0) && ($runningAST_send < 1) )
|
||||
{
|
||||
@@ -705,10 +795,15 @@ else
|
||||
{
|
||||
if ($DB) {print "starting AST_manager_listen...\n";}
|
||||
# add a '-L' to the command below to activate logging
|
||||
if ($lstn_buffer > 0)
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listenBUFFER.pl`;}
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} >= 12))
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listen_AMI2.pl`;}
|
||||
else
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listen.pl`;}
|
||||
{
|
||||
if ($lstn_buffer > 0)
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listenBUFFER.pl`;}
|
||||
else
|
||||
{`/usr/bin/screen -d -m -S ASTlisten $PATHhome/AST_manager_listen.pl`;}
|
||||
}
|
||||
}
|
||||
if ( ($AST_VDauto_dial > 0) && ($runningAST_VDauto_dial < 1) )
|
||||
{
|
||||
@@ -785,80 +880,6 @@ if ($timeclock_auto_logout > 0)
|
||||
##### tally tables at Timeclock end-of-day
|
||||
################################################################################
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||
@conf = <conf>;
|
||||
close(conf);
|
||||
$i=0;
|
||||
foreach(@conf)
|
||||
{
|
||||
$line = $conf[$i];
|
||||
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
|
||||
{$PATHsounds = $line; $PATHsounds =~ 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_custom_user/) && ($CLIDB_custom_user < 1) )
|
||||
{$VARDB_custom_user = $line; $VARDB_custom_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_custom_pass/) && ($CLIDB_custom_pass < 1) )
|
||||
{$VARDB_custom_pass = $line; $VARDB_custom_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
|
||||
$THISserver_voicemail=0;
|
||||
$voicemail_server_id='';
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
|
||||
##### Get the settings from system_settings #####
|
||||
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists FROM system_settings;";
|
||||
# print "$stmtA\n";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$sounds_central_control_active = $aryA[0];
|
||||
$active_voicemail_server = $aryA[1];
|
||||
$SScustom_dialplan_entry = $aryA[2];
|
||||
$SSdefault_codecs = $aryA[3];
|
||||
$SSgenerate_cross_server_exten = $aryA[4];
|
||||
$SSvoicemail_timezones = $aryA[5];
|
||||
$SSdefault_voicemail_timezone = $aryA[6];
|
||||
$SScall_menu_qualify_enabled = $aryA[7];
|
||||
$SSallow_voicemail_greeting = $aryA[8];
|
||||
$SSreload_timestamp = $aryA[9];
|
||||
$meetme_enter_login_filename = $aryA[10];
|
||||
$meetme_enter_leave3way_filename = $aryA[11];
|
||||
$SSallow_chats = $aryA[12];
|
||||
$SSenable_auto_reports = $aryA[13];
|
||||
$SSenable_drop_lists = $aryA[14];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
|
||||
|
||||
$timeclock_end_of_day_NOW=0;
|
||||
### determine if it is the timeclock end of day right now
|
||||
$stmtA = "SELECT count(*) from system_settings where timeclock_end_of_day LIKE \"%$reset_test%\";";
|
||||
@@ -873,29 +894,6 @@ if ($sthArows > 0)
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
##### Get the settings for this server's server_ip #####
|
||||
$stmtA = "SELECT active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,asterisk_version,sounds_update,conf_secret,custom_dialplan_entry,auto_restart_asterisk,asterisk_temp_no_restart,gather_asterisk_output,conf_qualify FROM servers where server_ip='$server_ip';";
|
||||
# print "$stmtA\n";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$active_asterisk_server = $aryA[0];
|
||||
$generate_vicidial_conf = $aryA[1];
|
||||
$rebuild_conf_files = $aryA[2];
|
||||
$asterisk_version = $aryA[3];
|
||||
$sounds_update = $aryA[4];
|
||||
$self_conf_secret = $aryA[5];
|
||||
$SERVERcustom_dialplan_entry = $aryA[6];
|
||||
$auto_restart_asterisk = $aryA[7];
|
||||
$asterisk_temp_no_restart = $aryA[8];
|
||||
$gather_asterisk_output = $aryA[9];
|
||||
$conf_qualify = $aryA[10];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
if ($timeclock_end_of_day_NOW > 0)
|
||||
{
|
||||
@@ -1914,6 +1912,19 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
{
|
||||
if ($DB) {print "generating new auto-gen conf files\n";}
|
||||
|
||||
$hangup_exten_line = 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if ($DBX) {print "Asterisk version: $ast_ver_str{major} $ast_ver_str{minor}\n";}
|
||||
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
$hangup_exten_line = 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} >= 12))
|
||||
{
|
||||
$hangup_exten_line = 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))';
|
||||
}
|
||||
|
||||
$stmtA="UPDATE servers SET rebuild_conf_files='N' where server_ip='$server_ip';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
@@ -1921,9 +1932,9 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
$S='*';
|
||||
if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ )
|
||||
{
|
||||
$a = leading_zero($1);
|
||||
$b = leading_zero($2);
|
||||
$c = leading_zero($3);
|
||||
$a = leading_zero($1);
|
||||
$b = leading_zero($2);
|
||||
$c = leading_zero($3);
|
||||
$d = leading_zero($4);
|
||||
$VARremDIALstr = "$a$S$b$S$c$S$d";
|
||||
}
|
||||
@@ -2709,14 +2720,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
$meetme_custom_ext .= "exten => _8600XXX,1,Meetme(\${EXTEN},FG($meetme_enter_login_filename))\n";
|
||||
$meetme_custom_ext .= "exten => _8600XXX,n,Hangup()\n";
|
||||
$meetme_custom_ext .= "\n";
|
||||
$meetme_custom_ext .= 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
$meetme_custom_ext .= $hangup_exten_line;
|
||||
$meetme_custom_ext .= "\n\n";
|
||||
$meetme_custom_ext .= '[meetme-enter-leave3way]';
|
||||
$meetme_custom_ext .= "\n; meetme entry for Vicidial agent leaving 3way call, Asterisk 1.8+ compatible only\n";
|
||||
$meetme_custom_ext .= "exten => _8600XXX,1,Meetme(\${EXTEN},FG($meetme_enter_leave3way_filename))\n";
|
||||
$meetme_custom_ext .= "exten => _8600XXX,n,Hangup()\n";
|
||||
$meetme_custom_ext .= "\n";
|
||||
$meetme_custom_ext .= 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
$meetme_custom_ext .= $hangup_exten_line;
|
||||
$meetme_custom_ext .= "\n\n";
|
||||
|
||||
if ($DBX>0) {print "Custom Meetme login and leave3way entries generated: |$meetme_enter_login_filename|$meetme_enter_leave3way_filename|\n";}
|
||||
@@ -3193,15 +3204,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
$call_menu_ext .= "$call_menu_invalid_ext";
|
||||
}
|
||||
$call_menu_ext .= "; hangup\n";
|
||||
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
$call_menu_ext .= 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
$call_menu_ext .= 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
|
||||
$call_menu_ext .= $hangup_exten_line;
|
||||
|
||||
if (length($custom_dialplan_entry[$i]) > 4)
|
||||
{
|
||||
@@ -3432,70 +3435,35 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
if (length($SScustom_dialplan_entry)>5)
|
||||
{
|
||||
print ext "[vicidial-auto-system-setting-custom]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "; System Setting Custom Dialplan\n$SScustom_dialplan_entry\n\n";
|
||||
}
|
||||
if (length($SERVERcustom_dialplan_entry)>5)
|
||||
{
|
||||
print ext "[vicidial-auto-server-custom]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "; Server Custom Dialplan\n$SERVERcustom_dialplan_entry\n\n";
|
||||
}
|
||||
print ext "[vicidial-auto-external]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "$Lext\n";
|
||||
|
||||
print ext "[vicidial-auto-internal]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "$Vext\n";
|
||||
|
||||
print ext "[vicidial-auto-phones]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "$Pext\n";
|
||||
|
||||
print ext "[vicidial-auto]\n";
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
print ext 'exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
} else {
|
||||
print ext 'exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})';
|
||||
}
|
||||
|
||||
print ext $hangup_exten_line;
|
||||
print ext "\n";
|
||||
print ext "\n";
|
||||
print ext "include => vicidial-auto-internal\n";
|
||||
@@ -4123,10 +4091,11 @@ if ($SSenable_drop_lists > 0)
|
||||
|
||||
|
||||
################################################################################
|
||||
##### BEGIN reset lists
|
||||
##### BEGIN reset lists, and expired lists to inactive check
|
||||
################################################################################
|
||||
if ($AST_VDadapt > 0)
|
||||
{
|
||||
### reset lists if reset time matches
|
||||
$stmtA = "SELECT list_id FROM vicidial_lists where reset_time LIKE \"%$reset_test%\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -4160,9 +4129,49 @@ if ($AST_VDadapt > 0)
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
### set expired lists to inactive, only run at 12 minutes past the hour
|
||||
if ( ($SSexpired_lists_inactive > 0) && ($min =~ /12/) )
|
||||
{
|
||||
if ($DB) {print "STARTING EXPIRED LIST TO INACTIVE CHECK: |$SSexpired_lists_inactive|$min";}
|
||||
|
||||
$stmtA = "SELECT list_id FROM vicidial_lists where active='Y' and expiration_date < \"$today_date\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthCrows=$sthA->rows;
|
||||
$i=0;
|
||||
while ($sthCrows > $i)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$expired_list_id[$i] = "$aryA[0]";
|
||||
$i++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($DBX) {print "EXPIRED LIST CHECK: $i|$sthCrows|$min";}
|
||||
|
||||
$i=0;
|
||||
while ($sthCrows > $i)
|
||||
{
|
||||
$stmtA="UPDATE vicidial_lists set active='N' where list_id='$expired_list_id[$i]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
$SQL_log = "$stmtA|";
|
||||
$SQL_log =~ s/;|\\|\'|\"//gi;
|
||||
|
||||
if ($DB) {print "DONE\n";}
|
||||
if ($DB) {print "$trigger_results\n";}
|
||||
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date='$now_date', user='VDAD', ip_address='1.1.1.1', event_section='LISTS', event_type='MODIFY', record_id='$expired_list_id[$i]', event_code='ADMIN EXPIRED LIST INACTIVE', event_sql=\"$SQL_log\", event_notes='$affected_rows list expired';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "FINISHED: $affected_rows|$Iaffected_rows|$stmtA";}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
##### END reset lists
|
||||
##### END reset lists, and expired lists to inactive check
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
+55
-1
@@ -124,6 +124,7 @@
|
||||
# 170313-1041 - Added CHAT option to inbound_queue_no_dial
|
||||
# 170325-1106 - Added optional vicidial_drop_log logging
|
||||
# 170527-2347 - Fix for rare inbound logging issue #1017
|
||||
# 170915-1817 - Added support for per server routing prefix needed for Asterisk 13+
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -243,7 +244,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
### Grab Server values from the database
|
||||
$stmtA = "SELECT telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,max_vicidial_trunks,answer_transfer_agent,local_gmt,ext_context,vd_server_logs,vicidial_recording_limit FROM servers where server_ip = '$server_ip';";
|
||||
$stmtA = "SELECT telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,max_vicidial_trunks,answer_transfer_agent,local_gmt,ext_context,vd_server_logs,vicidial_recording_limit,asterisk_version,routing_prefix FROM servers where server_ip = '$server_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -263,6 +264,8 @@ if ($sthArows > 0)
|
||||
$DBext_context = $aryA[10];
|
||||
$DBvd_server_logs = $aryA[11];
|
||||
$DBvicidial_recording_limit = $aryA[12];
|
||||
$asterisk_version = $aryA[13];
|
||||
$routing_prefix = $aryA[14];
|
||||
if ($DBtelnet_host) {$telnet_host = $DBtelnet_host;}
|
||||
if ($DBtelnet_port) {$telnet_port = $DBtelnet_port;}
|
||||
if ($DBASTmgrUSERNAME) {$ASTmgrUSERNAME = $DBASTmgrUSERNAME;}
|
||||
@@ -276,6 +279,7 @@ if ($sthArows > 0)
|
||||
if ($DBext_context) {$ext_context = $DBext_context;}
|
||||
if ($DBvd_server_logs =~ /Y/) {$SYSLOG = '1';}
|
||||
else {$SYSLOG = '0';}
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
@@ -1214,6 +1218,12 @@ while($one_day_interval > 0)
|
||||
if (length($DBIPvdadexten[$user_CIPct]) > 0) {$VDAD_dial_exten = "$DBIPvdadexten[$user_CIPct]";}
|
||||
else {$VDAD_dial_exten = "$answer_transfer_agent";}
|
||||
|
||||
# add the routing prefix if using Asterisk 13
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} > 11))
|
||||
{
|
||||
$VDAD_dial_exten = $routing_prefix . $VDAD_dial_exten;
|
||||
}
|
||||
|
||||
if (length($DBIPcampaigncid[$user_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$user_CIPct]"; $CCID_on++;}
|
||||
if (length($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;}
|
||||
if ($DBIPuse_custom_cid[$user_CIPct] =~ /Y/)
|
||||
@@ -3532,3 +3542,47 @@ sub jam_event_logger
|
||||
}
|
||||
$jam_string='';
|
||||
}
|
||||
|
||||
|
||||
# subroutine to parse the asterisk version
|
||||
# and return a hash with the various part
|
||||
sub parse_asterisk_version
|
||||
{
|
||||
# grab the arguments
|
||||
my $ast_ver_str = $_[0];
|
||||
|
||||
# get everything after the - and put it in $ast_ver_postfix
|
||||
my @hyphen_parts = split( /-/ , $ast_ver_str );
|
||||
|
||||
my $ast_ver_postfix = $hyphen_parts[1];
|
||||
|
||||
# now split everything before the - up by the .
|
||||
my @dot_parts = split( /\./ , $hyphen_parts[0] );
|
||||
|
||||
my %ast_ver_hash;
|
||||
|
||||
if ( $dot_parts[0] <= 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => $dot_parts[0],
|
||||
"minor" => $dot_parts[1],
|
||||
"build" => $dot_parts[2],
|
||||
"revision" => $dot_parts[3],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
# digium dropped the 1 from asterisk 10 but we still need it
|
||||
if ( $dot_parts[0] > 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => 1,
|
||||
"minor" => $dot_parts[0],
|
||||
"build" => $dot_parts[1],
|
||||
"revision" => $dot_parts[2],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
return ( %ast_ver_hash );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_VDauto_dial_FILL.pl version 2.12
|
||||
# AST_VDauto_dial_FILL.pl version 2.14
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# Places auto_dial calls on the VICIDIAL dialer system across all servers only
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# Should only be run on one server in a multi-server Asterisk/VICIDIAL cluster
|
||||
#
|
||||
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 61115-1246 - First build, framework setup, non-functional
|
||||
@@ -38,6 +38,7 @@
|
||||
# 131016-0658 - Fix for disable_auto_dial system option
|
||||
# 131122-1237 - Formatting fixes and missing sthA->finish
|
||||
# 151006-0937 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes
|
||||
# 170915-1915 - Added support for per server routing prefix needed for Asterisk 13+
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -446,7 +447,7 @@ while($one_day_interval > 0)
|
||||
@DB_camp_server_available=@MT;
|
||||
@DB_camp_server_trunks_to_dial=@MT;
|
||||
##### Get the trunk settings for the campaign across all servers
|
||||
$stmtA = "SELECT server_ip,max_vicidial_trunks,balance_trunks_offlimits,vicidial_balance_rank FROM servers where vicidial_balance_active = 'Y' and server_ip NOT IN($full_serversSQL) order by vicidial_balance_rank desc, server_ip;";
|
||||
$stmtA = "SELECT server_ip,max_vicidial_trunks,balance_trunks_offlimits,vicidial_balance_rank,asterisk_version,routing_prefix FROM servers where vicidial_balance_active = 'Y' and server_ip NOT IN($full_serversSQL) order by vicidial_balance_rank desc, server_ip;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -457,6 +458,8 @@ while($one_day_interval > 0)
|
||||
$DB_camp_server_server_ip[$DB_camp_servers] = $aryA[0];
|
||||
$DB_camp_server_max_vicidial_trunks[$DB_camp_servers] = $aryA[1];
|
||||
$DB_camp_server_balance_trunks_offlimits[$DB_camp_servers] = $aryA[2];
|
||||
$DB_camp_server_asterisk_version[$DB_camp_servers] = $aryA[4];
|
||||
$DB_camp_server_routing_prefix[$DB_camp_servers] = $aryA[5];
|
||||
$DB_camp_servers++;
|
||||
$rec_count++;
|
||||
}
|
||||
@@ -835,11 +838,19 @@ while($one_day_interval > 0)
|
||||
|
||||
if ($staggered < 1)
|
||||
{
|
||||
%ast_ver_str = parse_asterisk_version($DB_camp_server_asterisk_version[$server_CIPct]);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} > 11))
|
||||
{
|
||||
$VDAD_dial_exten = "$DB_camp_server_routing_prefix[$server_CIPct]$VDAD_dial_exten";
|
||||
$event_string = "|VDAD_dial_exten = $VDAD_dial_exten|";
|
||||
&event_logger;
|
||||
}
|
||||
|
||||
### insert a NEW record to the vicidial_manager table to be processed
|
||||
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$DB_camp_server_server_ip[$server_CIPct]','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $DBfill_campaign[$camp_CIPct]|$lead_id|$phone_code|$phone_number|OUTBALANCE|$alt_dial|$DBIPqueue_priority[$camp_CIPct]')";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
$event_string = "| number call dialed|$DBfill_campaign[$camp_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|$alt_dial|";
|
||||
$event_string = "| number call dialed|$DBfill_campaign[$camp_CIPct]|$VqueryCID|$stmtA|$gmt_offset_now|$alt_dial|$DB_camp_server_server_ip[$server_CIPct]|$DB_camp_server_asterisk_version[$server_CIPct]";
|
||||
&event_logger;
|
||||
|
||||
### insert a SENT record to the vicidial_auto_calls table
|
||||
@@ -919,7 +930,7 @@ while($one_day_interval > 0)
|
||||
$staggered_rank_ct=0;
|
||||
while ( ($st_ct > $staggered_rank_ct) && ($staggered_ct > $staggered_fill) )
|
||||
{
|
||||
$stmtA = "SELECT server_ip FROM servers where vicidial_balance_rank='$ST_rank[$staggered_rank_ct]' and vicidial_balance_active = 'Y' order by server_ip LIMIT $ST_count[$staggered_rank_ct];";
|
||||
$stmtA = "SELECT server_ip,asterisk_version,routing_prefix FROM servers where vicidial_balance_rank='$ST_rank[$staggered_rank_ct]' and vicidial_balance_active = 'Y' order by server_ip LIMIT $ST_count[$staggered_rank_ct];";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArowsSIPS=$sthA->rows;
|
||||
@@ -928,7 +939,9 @@ while($one_day_interval > 0)
|
||||
while ($sthArowsSIPS > $st_si_ct)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$ST_server_ip[$st_si_ct] = $aryA[0];
|
||||
$ST_server_ip[$st_si_ct] = $aryA[0];
|
||||
$ST_asterisk_version[$st_si_ct] = $aryA[1];
|
||||
$ST_routing_prefix[$st_si_ct] = $aryA[2];
|
||||
|
||||
$io=0;
|
||||
foreach(@DB_camp_server_server_ip)
|
||||
@@ -950,6 +963,8 @@ while($one_day_interval > 0)
|
||||
$RANK_calls_placed=0;
|
||||
$st_si_loop=0;
|
||||
$TEMP_server_ip = '';
|
||||
$TEMP_asterisk_version = '';
|
||||
$TEMP_routing_prefix = '';
|
||||
$TEMP_vm_insert = '';
|
||||
$TEMP_vac_insert = '';
|
||||
$TEMP_vl_update = '';
|
||||
@@ -962,6 +977,8 @@ while($one_day_interval > 0)
|
||||
while ( ($TOTAL_available > $RANK_calls_placed) && ($failsafe_ct < 99999) && ($staggered_fill <= $staggered_ct) )
|
||||
{
|
||||
$TEMP_server_ip = $ST_server_ip[$st_si_loop];
|
||||
$TEMP_asterisk_version = $ST_asterisk_version[$st_si_loop];
|
||||
$TEMP_routing_prefix = $ST_routing_prefix[$st_si_loop];
|
||||
|
||||
$TEMP_vm_insert = $vm_inserts[$staggered_fill];
|
||||
$TEMP_vac_insert = $vac_inserts[$staggered_fill];
|
||||
@@ -973,6 +990,11 @@ while($one_day_interval > 0)
|
||||
$TEMP_vac_insert =~ s/XXXXXXXXXXXXXXX/$TEMP_server_ip/gi;
|
||||
$TEMP_vddl_inserts =~ s/XXXXXXXXXXXXXXX/$TEMP_server_ip/gi;
|
||||
|
||||
# add the routing prefix for Asterisk 13+ systems
|
||||
%ast_ver_str = parse_asterisk_version($TEMP_asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} > 11))
|
||||
{ $TEMP_vm_insert =~ s/Exten: /Exten: $TEMP_routing_prefix/gi; }
|
||||
|
||||
if (length($TEMP_vm_insert) > 20)
|
||||
{
|
||||
$affected_rows_vl = $dbhA->do($TEMP_vl_update);
|
||||
@@ -981,7 +1003,7 @@ while($one_day_interval > 0)
|
||||
$affected_rows_vddl = $dbhA->do($TEMP_vddl_inserts);
|
||||
}
|
||||
|
||||
$event_string = "| number call stagger dialed|$TEMP_server_ip|$staggered_fill|$staggered_ct|$affected_rows_vm|$affected_rows_vac|$affected_rows_vl|$affected_rows_vddl $TEMP_st_logged";
|
||||
$event_string = "| number call stagger dialed|$TEMP_vm_insert|$TEMP_server_ip|$staggered_fill|$staggered_ct|$affected_rows_vm|$affected_rows_vac|$affected_rows_vl|$affected_rows_vddl $TEMP_st_logged";
|
||||
&event_logger;
|
||||
|
||||
### sleep for 2.5 hundredths of a second to not flood the server with new calls
|
||||
@@ -1244,3 +1266,48 @@ sub event_logger
|
||||
}
|
||||
$event_string='';
|
||||
}
|
||||
|
||||
|
||||
|
||||
# subroutine to parse the asterisk version
|
||||
# and return a hash with the various part
|
||||
sub parse_asterisk_version
|
||||
{
|
||||
# grab the arguments
|
||||
my $ast_ver_str = $_[0];
|
||||
|
||||
# get everything after the - and put it in $ast_ver_postfix
|
||||
my @hyphen_parts = split( /-/ , $ast_ver_str );
|
||||
|
||||
my $ast_ver_postfix = $hyphen_parts[1];
|
||||
|
||||
# now split everything before the - up by the .
|
||||
my @dot_parts = split( /\./ , $hyphen_parts[0] );
|
||||
|
||||
my %ast_ver_hash;
|
||||
|
||||
if ( $dot_parts[0] <= 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => $dot_parts[0],
|
||||
"minor" => $dot_parts[1],
|
||||
"build" => $dot_parts[2],
|
||||
"revision" => $dot_parts[3],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
# digium dropped the 1 from asterisk 10 but we still need it
|
||||
if ( $dot_parts[0] > 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => 1,
|
||||
"minor" => $dot_parts[0],
|
||||
"build" => $dot_parts[1],
|
||||
"revision" => $dot_parts[2],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
return ( %ast_ver_hash );
|
||||
}
|
||||
|
||||
+109
-39
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_conf_update.pl version 2.12
|
||||
# AST_conf_update.pl version 2.14
|
||||
#
|
||||
# This script checks if there are channels in reserved conferences
|
||||
#
|
||||
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# 50810-1532 - Added database server variable definitions lookup
|
||||
# 50823-1456 - Added commandline arguments for debug at runtime
|
||||
@@ -18,6 +18,7 @@
|
||||
# 100928-1506 - Changed from hard-coded 60 minute limit to servers.vicidial_recording_limit
|
||||
# 130108-1712 - Changes for Asterisk 1.8 compatibility
|
||||
# 150610-1200 - Added support for AMI version 1.3
|
||||
# 170916-0947 - Added support for AMI version 2+
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -248,19 +249,32 @@ if ($no_vc_3way_check < 1)
|
||||
|
||||
if (!$telnet_port) {$telnet_port = '5038';}
|
||||
|
||||
$max_buffer = 4*1024*1024; # 4 meg buffer
|
||||
|
||||
### connect to asterisk manager through telnet
|
||||
$t = new Net::Telnet (Port => $telnet_port,
|
||||
Prompt => '/.*[\$%#>] $/',
|
||||
Output_record_separator => '',);
|
||||
#$fh = $t->dump_log("$telnetlog"); # uncomment for telnet log
|
||||
if (length($ASTmgrUSERNAMEsend) > 3) {$telnet_login = $ASTmgrUSERNAMEsend;}
|
||||
else {$telnet_login = $ASTmgrUSERNAME;}
|
||||
$t = new Net::Telnet (
|
||||
Port => $telnet_port,
|
||||
Prompt => '/\r\n/',
|
||||
Output_record_separator => "\n\n",
|
||||
Max_buffer_length => $max_buffer,
|
||||
Telnetmode => 0,
|
||||
);
|
||||
$LItelnetlog = "$PATHlogs/listen_telnet_log.txt"; # uncomment for telnet log
|
||||
#$fh = $t->dump_log("$LItelnetlog"); # uncomment for telnet log
|
||||
if (length($ASTmgrUSERNAMEsend) > 3) {$telnet_login = $ASTmgrUSERNAMEsend;}
|
||||
else {$telnet_login = $ASTmgrUSERNAME;}
|
||||
$t->open("$telnet_host");
|
||||
$t->waitfor('/Asterisk Call Manager\//');
|
||||
|
||||
$t->open("$telnet_host");
|
||||
$t->waitfor('/[0123]\n$/'); # print login
|
||||
$t->print("Action: Login\nUsername: $telnet_login\nSecret: $ASTmgrSECRET\n\n");
|
||||
$t->waitfor('/Authentication accepted/'); # waitfor auth accepted
|
||||
# get the AMI version number
|
||||
$ami_version = $t->getline(Errmode => Return, Timeout => 1,);
|
||||
$ami_version =~ s/\n//gi;
|
||||
if ($DB) {print "----- AMI Version $ami_version -----\n";}
|
||||
|
||||
$t->print("Action: Login\nUsername: $telnet_login\nSecret: $ASTmgrSECRET");
|
||||
$t->waitfor('/Authentication accepted/'); # waitfor auth accepted
|
||||
|
||||
$t->buffer_empty;
|
||||
|
||||
$i=0;
|
||||
if ( !( ( @PTextensions == 1 ) && ( $PTextensions[0] eq '') ) )
|
||||
@@ -269,16 +283,38 @@ if ($no_vc_3way_check < 1)
|
||||
{
|
||||
@list_channels=@MT;
|
||||
$t->buffer_empty;
|
||||
$COMMAND = "Action: Command\nCommand: Meetme list $PT_conf_extens[$i]\n\nAction: Ping\n\n";
|
||||
if ($DB) {print "|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
|
||||
if ($ami_version =~ /^1\./i)
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Pong.*/');
|
||||
$COMMAND = "Action: Command\nCommand: Meetme list $PT_conf_extens[$i]\n\nAction: Ping\n\n";
|
||||
if ($DB) {print "|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Pong.*/');
|
||||
}
|
||||
else
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Success\nPing: Pong.*/');
|
||||
}
|
||||
}
|
||||
else
|
||||
elsif ($ami_version =~ /^2\./i)
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Success\nPing: Pong.*/');
|
||||
# get the current time
|
||||
( $now_sec, $now_micro_sec ) = gettimeofday();
|
||||
|
||||
# figure out how many micro seconds since epoch
|
||||
$now_micro_epoch = $now_sec * 1000000;
|
||||
$now_micro_epoch = $now_micro_epoch + $now_micro_sec;
|
||||
|
||||
$begin_micro_epoch = $now_micro_epoch;
|
||||
|
||||
# create a new action id
|
||||
$action_id = "$now_sec.$now_micro_sec";
|
||||
|
||||
$COMMAND = "Action: Command\nActionID:$action_id\nCommand: Meetme list $PT_conf_extens[$i]";
|
||||
if ($DB) {print "\n\n|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/--END COMMAND--\n\n/');
|
||||
}
|
||||
|
||||
$j=0;
|
||||
@@ -336,7 +372,7 @@ if ($no_vc_3way_check < 1)
|
||||
|
||||
$i++;
|
||||
### sleep for 10 hundredths of a second
|
||||
usleep(1*100*1000);
|
||||
usleep(10*100*100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,19 +413,32 @@ $sthA->finish();
|
||||
|
||||
if (!$telnet_port) {$telnet_port = '5038';}
|
||||
|
||||
$max_buffer = 4*1024*1024; # 4 meg buffer
|
||||
|
||||
### connect to asterisk manager through telnet
|
||||
$t = new Net::Telnet (Port => $telnet_port,
|
||||
Prompt => '/.*[\$%#>] $/',
|
||||
Output_record_separator => '',);
|
||||
#$fh = $t->dump_log("$telnetlog"); # uncomment for telnet log
|
||||
$t = new Net::Telnet (
|
||||
Port => $telnet_port,
|
||||
Prompt => '/\r\n/',
|
||||
Output_record_separator => "\n\n",
|
||||
Max_buffer_length => $max_buffer,
|
||||
Telnetmode => 0,
|
||||
);
|
||||
$LItelnetlog = "$PATHlogs/listen_telnet_log.txt"; # uncomment for telnet log
|
||||
#$fh = $t->dump_log("$LItelnetlog"); # uncomment for telnet log
|
||||
if (length($ASTmgrUSERNAMEsend) > 3) {$telnet_login = $ASTmgrUSERNAMEsend;}
|
||||
else {$telnet_login = $ASTmgrUSERNAME;}
|
||||
$t->open("$telnet_host");
|
||||
$t->waitfor('/Asterisk Call Manager\//');
|
||||
|
||||
$t->open("$telnet_host");
|
||||
$t->waitfor('/[0123]\n$/'); # print login
|
||||
$t->print("Action: Login\nUsername: $telnet_login\nSecret: $ASTmgrSECRET\n\n");
|
||||
$t->waitfor('/Authentication accepted/'); # waitfor auth accepted
|
||||
# get the AMI version number
|
||||
$ami_version = $t->getline(Errmode => Return, Timeout => 1,);
|
||||
$ami_version =~ s/\n//gi;
|
||||
if ($DB) {print "----- AMI Version $ami_version -----\n";}
|
||||
|
||||
$t->print("Action: Login\nUsername: $telnet_login\nSecret: $ASTmgrSECRET");
|
||||
$t->waitfor('/Authentication accepted/'); # waitfor auth accepted
|
||||
|
||||
$t->buffer_empty;
|
||||
|
||||
$i=0;
|
||||
if ( !( ( @PTextensions == 1 ) && ( $PTextensions[0] eq '') ) )
|
||||
@@ -400,18 +449,39 @@ if ( !( ( @PTextensions == 1 ) && ( $PTextensions[0] eq '') ) )
|
||||
{
|
||||
@list_channels=@MT;
|
||||
$t->buffer_empty;
|
||||
$COMMAND = "Action: Command\nCommand: Meetme list $PT_conf_extens[$i]\n\nAction: Ping\n\n";
|
||||
if ($DB) {print "|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Pong.*/');
|
||||
}
|
||||
else
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Success\nPing: Pong.*/');
|
||||
}
|
||||
|
||||
if ($ami_version =~ /^1\./i)
|
||||
{
|
||||
$COMMAND = "Action: Command\nCommand: Meetme list $PT_conf_extens[$i]\n\nAction: Ping\n\n";
|
||||
if ($DB) {print "|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Pong.*/');
|
||||
}
|
||||
else
|
||||
{
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/Response: Success\nPing: Pong.*/');
|
||||
}
|
||||
}
|
||||
elsif ($ami_version =~ /^2\./i)
|
||||
{
|
||||
# get the current time
|
||||
( $now_sec, $now_micro_sec ) = gettimeofday();
|
||||
|
||||
# figure out how many micro seconds since epoch
|
||||
$now_micro_epoch = $now_sec * 1000000;
|
||||
$now_micro_epoch = $now_micro_epoch + $now_micro_sec;
|
||||
|
||||
$begin_micro_epoch = $now_micro_epoch;
|
||||
|
||||
# create a new action id
|
||||
$action_id = "$now_sec.$now_micro_sec";
|
||||
|
||||
$COMMAND = "Action: Command\nActionID: $action_id\nCommand: Meetme list $PT_conf_extens[$i]";
|
||||
if ($DB) {print "|$PTextensions[$i]|$PT_conf_extens[$i]|$COMMAND|\n";}
|
||||
@list_channels = $t->cmd(String => "$COMMAND", Prompt => '/--END COMMAND--/');
|
||||
}
|
||||
|
||||
$j=0;
|
||||
$conf_empty[$i]=0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_manager_listen.pl version 2.12
|
||||
# AST_manager_listen.pl version 2.14
|
||||
#
|
||||
# Part of the Asterisk Central Queue System (ACQS)
|
||||
#
|
||||
@@ -17,7 +17,7 @@
|
||||
# the ADMIN_keepalive_ALL.pl script, which makes sure it is always running in a
|
||||
# screen, provided that the astguiclient.conf keepalive setting "2" is set.
|
||||
#
|
||||
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 50322-1300 - changed callerid parsing to remove quotes and number
|
||||
@@ -47,6 +47,7 @@
|
||||
# 150610-1200 - Added support for AMI version 1.3
|
||||
# 150709-1506 - Added DTMF logging for Asterisk 1.8 and higher
|
||||
# 151031-0918 - Added better capture of errors in telnet connection, other small fixes
|
||||
# 170920-1416 - Fix for issue with recordings beginning with CALLID variable
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -411,7 +412,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[3];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
if ( ($channel !~ /local/i) && ($channel !~ /CXFER/i) )
|
||||
{
|
||||
@@ -432,7 +433,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[4];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
print STDERR "|$stmtA|\n";
|
||||
my $affected_rows = $dbhA->do($stmtA);
|
||||
@@ -444,7 +445,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[2];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
print STDERR "|$stmtA|\n";
|
||||
my $affected_rows = $dbhA->do($stmtA);
|
||||
@@ -1053,7 +1054,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[3];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
if ( ($channel !~ /local/i) && ($channel !~ /CXFER/i) )
|
||||
{
|
||||
print STDERR "|$stmtA|\n";
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
# 150610-1200 - Added support for AMI version 1.3
|
||||
# 150709-1506 - Added DTMF logging for Asterisk 1.8 and higher
|
||||
# 151031-0651 - Added perl telnet buffer options, requires newer versions of Net::Telnet CPAN module
|
||||
# 170920-1417 - Fix for issue with recordings beginning with CALLID variable
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -412,7 +413,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[3];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
if ( ($channel !~ /local/i) && ($channel !~ /CXFER/i) )
|
||||
{
|
||||
@@ -433,7 +434,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[4];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
print STDERR "|$stmtA|\n";
|
||||
my $affected_rows = $dbhA->do($stmtA);
|
||||
@@ -445,7 +446,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[2];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
|
||||
print STDERR "|$stmtA|\n";
|
||||
my $affected_rows = $dbhA->do($stmtA);
|
||||
@@ -1054,7 +1055,7 @@ while($one_day_interval > 0)
|
||||
$channel =~ s/Channel: |\s*$//gi;
|
||||
$uniqueid = $command_line[3];
|
||||
$uniqueid =~ s/Uniqueid: |\s*$//gi;
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\";";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid' and callerid NOT LIKE \"DCagcW%\" and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
if ( ($channel !~ /local/i) && ($channel !~ /CXFER/i) )
|
||||
{
|
||||
print STDERR "|$stmtA|\n";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_manager_send.pl version 2.10
|
||||
# AST_manager_send.pl version 2.14
|
||||
#
|
||||
# Part of the Asterisk Central Queue System (ACQS)
|
||||
#
|
||||
@@ -16,7 +16,7 @@
|
||||
# scalability over just using a single process. Also, this means that a single
|
||||
# action execution lock cannot bring the entire system down.
|
||||
#
|
||||
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 50823-1514 - Added commandline debug options with debug printouts
|
||||
@@ -30,6 +30,7 @@
|
||||
# 80418-0901 - reduced time between Actions being sent, raised endless loop timer
|
||||
# 91129-2146 - removed SELECT STAR and formatting fixes
|
||||
# 141113-1356 - Added more logging, check for number of running instances, processing of QUEUE but not SENT commands
|
||||
# 170920-1419 - Fix for issue with recordings beginning with CALLID variable
|
||||
#
|
||||
|
||||
$|++;
|
||||
@@ -192,7 +193,7 @@ while ($one_day_interval > 0)
|
||||
$originate_command .= "\n";
|
||||
|
||||
my $SENDNOW=1;
|
||||
if ($originate_command =~ /Action: Hangup|Action: Redirect/)
|
||||
if ( ($originate_command =~ /Action: Hangup|Action: Redirect/) && ($originate_command !~ /Exten: 8309\n|Exten: 8310\n/) )
|
||||
{
|
||||
$SENDNOW=0;
|
||||
print STDERR "\n|checking for dead call before executing|" . $vdm->{callerid} . "|" . $vdm->{uniqueid} . "|\n" if ($DB);
|
||||
@@ -269,7 +270,7 @@ while ($one_day_interval > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD' where man_id='" . $vdm->{man_id} . "'";
|
||||
$stmtA = "UPDATE vicidial_manager set status='DEAD' where man_id='" . $vdm->{man_id} . "' and cmd_line_d!='Exten: 8309' and cmd_line_d!='Exten: 8310';";
|
||||
print STDERR "\n|$stmtA|\n" if ($DB);
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$event_string="COMMAND NOT SENT, SQL_QUERY|$stmtA|";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+118
-26
@@ -79,6 +79,7 @@
|
||||
# 170427-1125 - Fix for drop call logging of answered calls hung up by customer first
|
||||
# 170508-1148 - Added blind monitor call end logging
|
||||
# 170527-2340 - Fix for rare inbound logging issue #1017
|
||||
# 170915-1753 - Asterisk 13 compatibility
|
||||
#
|
||||
|
||||
# defaults for PreFork
|
||||
@@ -151,14 +152,15 @@ $dbhB = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
### Grab Server values from the database
|
||||
$stmtB = "SELECT vd_server_logs FROM servers where server_ip = '$VARserver_ip';";
|
||||
$stmtB = "SELECT vd_server_logs,asterisk_version FROM servers where server_ip = '$VARserver_ip';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$SERVERLOG = $aryB[0];
|
||||
$SERVERLOG = $aryB[0];
|
||||
$asterisk_version = $aryB[1];
|
||||
}
|
||||
$sthB->finish();
|
||||
$dbhB->disconnect();
|
||||
@@ -250,7 +252,7 @@ sub process_request
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
### Grab Server values from the database
|
||||
$stmtA = "SELECT agi_output FROM servers where server_ip = '$VARserver_ip';";
|
||||
$stmtA = "SELECT agi_output,asterisk_version FROM servers where server_ip = '$VARserver_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -259,16 +261,21 @@ sub process_request
|
||||
$AGILOG = '0';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = $aryA[0];
|
||||
$asterisk_version = $aryA[1];
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$h_exten_reason=0;
|
||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} >= 12))
|
||||
{$h_exten_reason=1;}
|
||||
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "+++++++++++++++++ FastAGI Start ++++++++++++++++++++++++++++++++++++++++";
|
||||
$agi_string = "+++++++++++++++++ FastAGI Start ++++ Asterisk version: $ast_ver_str{major} $ast_ver_str{minor} ++++++ hER: $h_exten_reason ++++++";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
@@ -334,15 +341,16 @@ sub process_request
|
||||
$PRI = $ARGV_vars[0];
|
||||
$PRI =~ s/.*--HVcauses--//gi;
|
||||
$DEBUG = $ARGV_vars[1];
|
||||
$hangup_cause = $ARGV_vars[2];
|
||||
$dialstatus = $ARGV_vars[3];
|
||||
$dial_time = $ARGV_vars[4];
|
||||
$answered_time = $ARGV_vars[5];
|
||||
$hangup_cause = $ARGV_vars[2];
|
||||
$dialstatus = $ARGV_vars[3];
|
||||
$dial_time = $ARGV_vars[4];
|
||||
$answered_time = $ARGV_vars[5];
|
||||
$tech_hangup_cause = $ARGV_vars[6];
|
||||
if( $dial_time > $answered_time )
|
||||
{$ring_time = $dial_time - $answered_time;}
|
||||
else
|
||||
{$ring_time = 0;}
|
||||
$agi_string = "URL HVcauses: |$PRI|$DEBUG|$hangup_cause|$dialstatus|$dial_time|$ring_time|";
|
||||
$agi_string = "URL HVcauses: |$PRI|$DEBUG|$hangup_cause|$dialstatus|$dial_time|$ring_time|$tech_hangup_cause|";
|
||||
&agi_output;
|
||||
}
|
||||
if (!$fullCID) # if no fullCID sent
|
||||
@@ -601,16 +609,17 @@ sub process_request
|
||||
@ARGV_vars = split(/-----/, $request);
|
||||
$PRI = $ARGV_vars[0];
|
||||
$PRI =~ s/.*--HVcauses--//gi;
|
||||
$DEBUG = $ARGV_vars[1];
|
||||
$hangup_cause = $ARGV_vars[2];
|
||||
$dialstatus = $ARGV_vars[3];
|
||||
$dial_time = $ARGV_vars[4];
|
||||
$answered_time = $ARGV_vars[5];
|
||||
$DEBUG = $ARGV_vars[1];
|
||||
$hangup_cause = $ARGV_vars[2];
|
||||
$dialstatus = $ARGV_vars[3];
|
||||
$dial_time = $ARGV_vars[4];
|
||||
$answered_time = $ARGV_vars[5];
|
||||
$tech_hangup_cause = $ARGV_vars[6];
|
||||
if( $dial_time > $answered_time )
|
||||
{$ring_time = $dial_time - $answered_time;}
|
||||
else
|
||||
{$ring_time = 0;}
|
||||
$agi_string = "URL HVcauses: |$PRI|$DEBUG|$hangup_cause|$dialstatus|$dial_time|$ring_time|";
|
||||
$agi_string = "URL HVcauses: |$PRI|$DEBUG|$hangup_cause|$dialstatus|$dial_time|$ring_time|$tech_hangup_cause|";
|
||||
&agi_output;
|
||||
|
||||
if ( (length($dialstatus) > 0) && ($callerid =~ /^V|^M/) )
|
||||
@@ -649,21 +658,61 @@ sub process_request
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
$sip_hangup_cause=0;
|
||||
$sip_hangup_reason='';
|
||||
|
||||
$stmtA = "SELECT sip_hangup_cause,sip_hangup_reason FROM vicidial_dial_log where lead_id='$CIDlead_id' and server_ip='$VARserver_ip' and caller_code='$callerid' order by call_date desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
### if using Asterisk 11 and older method for hangup reasons, check vicidial_dial_log
|
||||
if ($h_exten_reason < 1)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$sip_hangup_cause = $aryA[0];
|
||||
$sip_hangup_reason = $aryA[1];
|
||||
$sip_hangup_cause=0;
|
||||
$sip_hangup_reason='';
|
||||
|
||||
$stmtA = "SELECT sip_hangup_cause,sip_hangup_reason FROM vicidial_dial_log where lead_id='$CIDlead_id' and server_ip='$VARserver_ip' and caller_code='$callerid' order by call_date desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$sip_hangup_cause = $aryA[0];
|
||||
$sip_hangup_reason = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$sthArows|$stmtA|$sip_hangup_cause|$sip_hangup_reason|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
### if using Asterisk 12 and newer method for hangup reasons, check variables
|
||||
else
|
||||
{
|
||||
if ( $tech_hangup_cause =~ /SIP/ )
|
||||
{
|
||||
# we got the tech hangup cause from Asterisk (available in asterisk 13+)
|
||||
( $tech, $sip_hangup_cause, @error ) = split( / /, $tech_hangup_cause );
|
||||
$sip_hangup_reason = join( ' ', @error );
|
||||
|
||||
# the vicidial_dial_log does not have the sip hangup data so populate it
|
||||
$stmtA = "UPDATE vicidial_dial_log SET sip_hangup_cause='$sip_hangup_cause',sip_hangup_reason='$sip_hangup_reason',uniqueid='$uniqueid' where caller_code='$callerid' and server_ip='$VARserver_ip' and lead_id='$CIDlead_id';";
|
||||
$dbhA->do($stmtA);
|
||||
}
|
||||
else
|
||||
{
|
||||
# tech hangup cause was unavailable
|
||||
$sip_hangup_cause=0;
|
||||
$sip_hangup_reason='';
|
||||
|
||||
$stmtA = "SELECT sip_hangup_cause,sip_hangup_reason FROM vicidial_dial_log where lead_id='$CIDlead_id' and server_ip='$VARserver_ip' and caller_code='$callerid' order by call_date desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$sip_hangup_cause = $aryA[0];
|
||||
$sip_hangup_reason = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
|
||||
if ($AGILOG) {$agi_string = "$sthArows|$stmtA|$sip_hangup_cause|$sip_hangup_reason|"; &agi_output;}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT IGNORE INTO vicidial_carrier_log set uniqueid='$uniqueid',call_date='$now_date',server_ip='$VARserver_ip',lead_id='$CIDlead_id',hangup_cause='$hangup_cause',dialstatus='$dialstatus',channel='$channel',dial_time='$dial_time',answered_time='$answered_time',sip_hangup_cause='$sip_hangup_cause',sip_hangup_reason='$sip_hangup_reason',caller_code='$callerid';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
@@ -1962,3 +2011,46 @@ sub agi_output
|
||||
}
|
||||
$agi_string='';
|
||||
}
|
||||
|
||||
# subroutine to parse the asterisk version
|
||||
# and return a hash with the various part
|
||||
sub parse_asterisk_version
|
||||
{
|
||||
# grab the arguments
|
||||
my $ast_ver_str = $_[0];
|
||||
|
||||
# get everything after the - and put it in $ast_ver_postfix
|
||||
my @hyphen_parts = split( /-/ , $ast_ver_str );
|
||||
|
||||
my $ast_ver_postfix = $hyphen_parts[1];
|
||||
|
||||
# now split everything before the - up by the .
|
||||
my @dot_parts = split( /\./ , $hyphen_parts[0] );
|
||||
|
||||
my %ast_ver_hash;
|
||||
|
||||
if ( $dot_parts[0] <= 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => $dot_parts[0],
|
||||
"minor" => $dot_parts[1],
|
||||
"build" => $dot_parts[2],
|
||||
"revision" => $dot_parts[3],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
# digium dropped the 1 from asterisk 10 but we still need it
|
||||
if ( $dot_parts[0] > 1 )
|
||||
{
|
||||
%ast_ver_hash = (
|
||||
"major" => 1,
|
||||
"minor" => $dot_parts[0],
|
||||
"build" => $dot_parts[1],
|
||||
"revision" => $dot_parts[2],
|
||||
"postfix" => $ast_ver_postfix
|
||||
);
|
||||
}
|
||||
|
||||
return ( %ast_ver_hash );
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
AGENT MONITOR DOC Started: 2013-07-16 Updated: 2013-07-16
|
||||
AGENT MONITOR DOC Started: 2013-07-16 Updated: 2017-09-15
|
||||
|
||||
|
||||
Requirements:
|
||||
@@ -40,6 +40,9 @@ and the dialplan entries below should replace the older dialplan entries used.
|
||||
### ADD THE LINES BELOW TO THE SYSTEM SETTINGS CUSTOM DIALPLAN
|
||||
#########################################################################
|
||||
|
||||
NOTE: For Asteirsk 13 only, you should use the following 'h' line instead of the ones included in the below example:
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
|
||||
|
||||
|
||||
; quiet entry, listen-only, exit-on-dtmf conferences for VICIDIAL (listen)
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
ASTERISK 13 COMPATIBILITY START: 2017-09-16 UPDATE: 2017-09-16
|
||||
|
||||
|
||||
|
||||
Adding support for Asterisk 13 was much more involved and complex than adding support for previous versions, mostly because several core asterisk functions were removed or made unstable since Asterisk 11. This caused us to have to find other ways of performing the same tasks, which lead to some new processes having to be written. Although, there were also some new features that helped VICIdial to run more efficiently, so hopefully all of the changes taken together will yield the same or better overall running efficiency.
|
||||
|
||||
VERY IMPORTANT: Make sure you set the "Asterisk Version" properly in the Modify Server page, then force a rebuild of the conf files on that server if you have upgraded from a previous version.
|
||||
|
||||
These changes in Asterisk have necessitated some changes in the default Asterisk configurations for VICIdial:
|
||||
NOTE: These are installed by the install.pl script if you select Asterisk version 13 and choose to copy sample conf files
|
||||
|
||||
|
||||
In extensions.conf (from extensions.conf.sample-13):
|
||||
|
||||
The 'h' extension now needs to looks like this(changed in several places):
|
||||
|
||||
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
|
||||
|
||||
The following is needed in the default context:
|
||||
|
||||
|
||||
; Local channel resolution fix for Asterisk 13
|
||||
exten => _1383XX,1,AGI(agi-VDAD_local_optimize.agi,${CONNECTEDLINE(name)})
|
||||
exten => _1383XX,n,Wait(2)
|
||||
exten => _1383XX,n,Hangup()
|
||||
|
||||
exten => _138331*.,1,AGI(agi-VDAD_local_optimize.agi,${CONNECTEDLINE(name)})
|
||||
exten => _138331*.,n,Wait(2)
|
||||
exten => _138331*.,n,Hangup()
|
||||
|
||||
|
||||
In manager.conf (from manager.conf.sample-13):
|
||||
|
||||
The updatecron user needs new permissions added:
|
||||
|
||||
|
||||
[updatecron]
|
||||
secret = 1234
|
||||
read = command,call,system
|
||||
write = command,call,system
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
For Asterisk 13 support, a stock asterisk build with meetme enabled should work with VICIdial, but we do recommend using the vicidial enter/leave sounds for a more optimized call handling process. See the example compilation instructions below.
|
||||
|
||||
|
||||
|
||||
|
||||
#### Compiling Asterisk 13 (pre-patched and tested VICIdial build)
|
||||
# NOTE: The below instructions assume that you already have all prerequisite compilation tools and libraries installed on your system
|
||||
|
||||
wget http://download.vicidial.com/beta-apps/dahdi-linux-complete-2.11.1.tar.gz
|
||||
tar xvfz dahdi-linux-complete-2.11.1.tar.gz
|
||||
cd dahdi-linux-complete-2.11.1+2.11.1/
|
||||
make
|
||||
make install
|
||||
cd tools
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cd ../../
|
||||
|
||||
wget http://download.vicidial.com/beta-apps/asterisk-13.17.1-vici.tar.gz
|
||||
tar xvfz asterisk-13.17.1-vici.tar.gz
|
||||
cd asterisk-13.17.1-vici/
|
||||
./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-ogg=/usr/lib64/
|
||||
make menuselect <MAKE SURE APP_MEETME IS SELECTED IN APPLICATIONS!!!!!!!!!!!!!!!!!!!!!!!!!!>
|
||||
make
|
||||
make install
|
||||
asterisk -vvvvvvvvvvvvvvvvvvgc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Stock Asterisk from Digium example install
|
||||
|
||||
#### Asterisk 13
|
||||
# NOTE: The below instructions assume that you already have all prerequisite compilation tools and libraries installed on your system
|
||||
|
||||
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
|
||||
tar xvfz dahdi-linux-complete-current.tar.gz
|
||||
cd dahdi-linux-complete-2.11.1+2.11.1/
|
||||
make
|
||||
make install
|
||||
cd tools
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cd ../../
|
||||
|
||||
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
|
||||
tar xvfz asterisk-13-current.tar.gz
|
||||
cd asterisk-13.17.1/
|
||||
wget http://download.vicidial.com/asterisk-patches/leave.h
|
||||
wget http://download.vicidial.com/asterisk-patches/enter.h
|
||||
mv -f enter.h apps/enter.h
|
||||
mv -f leave.h apps/leave.h
|
||||
./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-ogg=/usr/lib64/
|
||||
make menuselect <MAKE SURE APP_MEETME IS SELECTED IN APPLICATIONS!!!!!!!!!!!!!!!!!!!!!!!!!!>
|
||||
make
|
||||
make install
|
||||
asterisk -vvvvvvvvvvvvvvvvvvgc
|
||||
|
||||
|
||||
@@ -625,6 +625,42 @@ asterisk -vvvvvvvvvvvvvvvvvvgc
|
||||
|
||||
|
||||
|
||||
#### Asterisk 13
|
||||
# NOTE: The below instructions assume that you already have all prerequisite compilation tools and libraries installed on your system
|
||||
|
||||
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
|
||||
tar xvfz dahdi-linux-complete-current.tar.gz
|
||||
cd dahdi-linux-complete-2.11.1+2.11.1/
|
||||
make
|
||||
make install
|
||||
cd tools
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cd ../../
|
||||
|
||||
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
|
||||
tar xvfz asterisk-13-current.tar.gz
|
||||
cd asterisk-13.17.1/
|
||||
wget http://download.vicidial.com/asterisk-patches/leave.h
|
||||
wget http://download.vicidial.com/asterisk-patches/enter.h
|
||||
mv -f enter.h apps/enter.h
|
||||
mv -f leave.h apps/leave.h
|
||||
./configure --with-dahdi=/usr/src/asterisk/dahdi-linux-complete-2.11.1+2.11.1/ --with-gsm=internal --with-ogg=/usr/lib64/
|
||||
make menuselect <MAKE SURE APP_MEETME IS SELECTED IN APPLICATIONS!!!!!!!!!!!!!!!!!!!!!!!!!!>
|
||||
make
|
||||
make install
|
||||
asterisk -vvvvvvvvvvvvvvvvvvgc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### pureftpd FTP server installation instructions ####
|
||||
|
||||
|
||||
@@ -0,0 +1,684 @@
|
||||
[general]
|
||||
static=yes
|
||||
writeprotect=no
|
||||
|
||||
[globals]
|
||||
CONSOLE=Console/dsp ; Console interface for demo
|
||||
TRUNK=DAHDI/r1 ; Trunk interface
|
||||
TRUNKX=DAHDI/r2 ; 2nd trunk interface
|
||||
TRUNKIAX=IAX2/ASTtest1:test@10.10.10.16:4569 ; IAX trunk interface
|
||||
TRUNKIAX1=IAX2/ASTtest1:test@10.10.10.16:4569 ; IAX trunk interface
|
||||
TRUNKBINFONE=IAX2/1112223333:PASSWORD@iax.binfone.com ; IAX trunk interface
|
||||
SIPtrunk=SIP/1234:PASSWORD@sip.provider.net ; SIP trunk
|
||||
|
||||
#include extensions-vicidial.conf
|
||||
|
||||
[trunkinbound]
|
||||
; DID call routing process
|
||||
; exten => _XXXXXXXXXX,1,AGI(agi-DID_route.agi) ; use this one instead of the one below if you are having delay issues, and match to number of received digits
|
||||
exten => _X.,1,AGI(agi-DID_route.agi)
|
||||
exten => _X.,n,Hangup()
|
||||
; If you have DIDs that arrive with a plus sign at the beginning then uncomment
|
||||
;exten => _+X.,1,AGI(agi-DID_route.agi)
|
||||
;exten => _+X.,n,Hangup()
|
||||
; If you have DIDs that arrive with a plus and 1 at the beginning that you want to filter out, then uncomment
|
||||
;exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)
|
||||
|
||||
; FastAGI for VICIDIAL/astGUIclient call logging
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
|
||||
[loopback-no-log]
|
||||
; This context is to accept calls that have already been logged in another context in Vicidial
|
||||
; and has been sent through one of the loopbacks. This is why this context is missing the h extension.
|
||||
; Do not put any extensions in this context unless you specifically understand what this means.
|
||||
|
||||
;exten => _91NXXNXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},,To)
|
||||
;exten => _91NXXNXXXXXX,n,Hangup()
|
||||
|
||||
; special Canadian PRI callerIDname settings FOR USE IN LOOPBACK CONTEXT ONLY
|
||||
;exten => _91NXXNXXXXXX,1,Set(CALLERID(name)="ACME Widgets")
|
||||
;exten => _91NXXNXXXXXX,n,AGI(agi-CANADA_PRI_CIDname.agi)
|
||||
;exten => _91NXXNXXXXXX,n,Dial(${TRUNKX}/${EXTEN:1},,To)
|
||||
;exten => _91NXXNXXXXXX,n,Hangup()
|
||||
|
||||
exten => _999XX11112,1,Wait(2)
|
||||
exten => _999XX11112,n,Answer()
|
||||
exten => _999XX11112,n,Playback(ss-noservice)
|
||||
exten => _999XX11112,n,Playback(vm-goodbye)
|
||||
exten => _999XX11112,n,Hangup()
|
||||
|
||||
[default]
|
||||
include => vicidial-auto
|
||||
|
||||
; Local agent alert extensions
|
||||
exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)
|
||||
exten => _8600XXX*.,n,Hangup()
|
||||
exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)
|
||||
exten => _78600XXX*.,n,Hangup()
|
||||
|
||||
; Local blind monitoring
|
||||
exten => _08600XXX,1,Dial(${TRUNKblind}/6${EXTEN:1},55,To)
|
||||
exten => _08600XXX,n,Hangup()
|
||||
|
||||
|
||||
; playback of recorded prompts
|
||||
exten => _851XXXXX,1,Answer()
|
||||
exten => _851XXXXX,n,Playback(${EXTEN})
|
||||
exten => _851XXXXX,n,Hangup()
|
||||
|
||||
; this is used for playing a message to an answering machine forwarded from AMD in VICIDIAL
|
||||
exten => _6851XXXXX,1,Answer()
|
||||
exten => _6851XXXXX,n,WaitForSilence(2000,1,90)
|
||||
exten => _6851XXXXX,n,Playback(sip-silence)
|
||||
exten => _6851XXXXX,n,Playback(${EXTEN:1})
|
||||
exten => _6851XXXXX,n,Hangup()
|
||||
exten => _7851XXXXX,1,WaitForSilence(2000,2) ; AMD got machine. leave message after recording
|
||||
exten => _7851XXXXX,n,Playback(${EXTEN:1})
|
||||
exten => _7851XXXXX,n,AGI(VD_amd_post.agi,${EXTEN:1})
|
||||
exten => _7851XXXXX,n,Hangup()
|
||||
|
||||
|
||||
; FastAGI for VICIDIAL/astGUIclient call logging
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
|
||||
; Example phone extensions
|
||||
; 100-350 phone extensions now auto-generated, so no need to uncommend them
|
||||
; extensions for other SIP and IAX call center phones
|
||||
; cc100-cc150 SIP Phones
|
||||
;exten => _1[0-5]X,1,Dial(sip/cc${EXTEN},20,to)
|
||||
;exten => _1[0-5]X,n,Hangup()
|
||||
; cc300-cc350 IAX Phones
|
||||
;exten => _3[0-5]X,1,Dial(IAX2/cc${EXTEN},20,to)
|
||||
;exten => _3[0-5]X,n,Hangup()
|
||||
; extensions if using a T1 channelbank
|
||||
;exten => _19XX,1,Dial(Zap/${EXTEN:2},30,o)
|
||||
;exten => _19XX,n,Hangup()
|
||||
; Extension 4001 rings Zap phone (this example for FXS on Zap port 1)
|
||||
;exten => 4001,1,Dial(Zap/1,30,o) ; ring Zap device 1
|
||||
;exten => 4001,n,Voicemail(u4001) ; Send to voicemail...
|
||||
;exten => 4001,n,Hangup()
|
||||
|
||||
|
||||
; # timeout invalid rules
|
||||
exten => #,1,Playback(invalid) ; "Thanks for trying the demo"
|
||||
exten => #,2,Hangup() ; Hang them up.
|
||||
exten => t,1,Goto(#,1) ; If they take too long, give up
|
||||
exten => t,n,Hangup()
|
||||
exten => i,1,Playback(invalid) ; "That's not valid, try again"
|
||||
exten => i,n,Hangup()
|
||||
|
||||
|
||||
; Extensions for performance testing
|
||||
;exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91999NXXXXXX,n,Dial(${TRUNKloop}/${EXTEN:2},,tTo)
|
||||
;exten => _91999NXXXXXX,n,Hangup()
|
||||
;exten => 999999999999,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => 999999999999,n,Dial(${TRUNKloop}/${EXTEN:1},,tTo)
|
||||
;exten => 999999999999,n,Hangup()
|
||||
|
||||
; This is a loopback dialaround to allow for hearing of ringing for 3way calls
|
||||
exten => _881NXXNXXXXXX,1,Answer()
|
||||
exten => _881NXXNXXXXXX,n,Dial(${TRUNKloop}/9${EXTEN:2},,To)
|
||||
exten => _881NXXNXXXXXX,n,Hangup()
|
||||
|
||||
; Vtiger fax and email log extensions
|
||||
exten => _9118XXXXXXXX,1,Dial(${TRUNKblind}/9998818112,55,to)
|
||||
exten => _9118XXXXXXXX,n,Hangup()
|
||||
exten => _9119XXXXXXXX,1,Dial(${TRUNKblind}/9998819112,55,to)
|
||||
exten => _9119XXXXXXXX,n,Hangup()
|
||||
|
||||
|
||||
; CARRIER DIALING EXTENSIONS, USE THE ADMIN INTERFACE TO PROGRAM THESE
|
||||
; dial an 800 outbound number
|
||||
;exten => _91800NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91800NXXXXXX,n,Dial(${TRUNK}/${EXTEN:1},,To)
|
||||
;exten => _91800NXXXXXX,n,Hangup()
|
||||
;exten => _91888NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91888NXXXXXX,n,Dial(${TRUNK}/${EXTEN:1},,To)
|
||||
;exten => _91888NXXXXXX,n,Hangup()
|
||||
;exten => _91877NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91877NXXXXXX,n,Dial(${TRUNK}/${EXTEN:1},,To)
|
||||
;exten => _91877NXXXXXX,n,Hangup()
|
||||
;exten => _91866NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91866NXXXXXX,n,Dial(${TRUNK}/${EXTEN:1},,To)
|
||||
;exten => _91866NXXXXXX,n,Hangup()
|
||||
;exten => _91855NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91855NXXXXXX,n,Dial(${TRUNK}/${EXTEN:1},,To)
|
||||
;exten => _91855NXXXXXX,n,Hangup()
|
||||
|
||||
; dial a long distance outbound number
|
||||
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls
|
||||
;exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _91NXXNXXXXXX,n,Dial(${TRUNKX}/${EXTEN:1},,To)
|
||||
;exten => _91NXXNXXXXXX,n,Hangup()
|
||||
|
||||
; dial a local outbound number (modified because of only LD T1)
|
||||
;exten => _9NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _9NXXXXXX,n,Dial(${TRUNK}/1727${EXTEN:1},,To)
|
||||
;exten => _9NXXXXXX,n,Hangup()
|
||||
|
||||
; dial a local 727 outbound number with area code
|
||||
;exten => _9727NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _9727NXXXXXX,n,Dial(${TRUNK}/1${EXTEN:1},,To)
|
||||
;exten => _9727NXXXXXX,n,Hangup()
|
||||
|
||||
; dial a long distance outbound number to the UK
|
||||
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
|
||||
;exten => _901144XXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _901144XXXXXXXXXX,n,Dial(${TRUNKX}/${EXTEN:1},55,To)
|
||||
;exten => _901144XXXXXXXXXX,n,Hangup()
|
||||
|
||||
; dial a long distance outbound number to Australia
|
||||
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
|
||||
;exten => _901161XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _901161XXXXXXXXX,n,Dial(${TRUNKX}/${EXTEN:1},,To)
|
||||
;exten => _901161XXXXXXXXX,n,Hangup()
|
||||
|
||||
; dial a long distance outbound number through BINFONE
|
||||
; exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91NXXNXXXXXX,n,Dial(${TRUNKIAX}/${EXTEN:1},55,To)
|
||||
; exten => _91NXXNXXXXXX,n,Hangup()
|
||||
; dial a long distance outbound number through a SIP provider
|
||||
; exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91NXXNXXXXXX,n,Dial(sip/${EXTEN:1}@SIPtrunk,55,o)
|
||||
; exten => _91NXXNXXXXXX,n,Hangup()
|
||||
; special extensions for North America to catch invalid phone numbers
|
||||
; exten => _91XXX[0-1]XXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXX[0-1]XXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXX[0-1]XXXXXX,n,Hangup()
|
||||
; exten => _91[0-1]XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91[0-1]XXXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91[0-1]XXXXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXXXXXXX,n,Hangup()
|
||||
; exten => _91XXXXXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91XXXXXXXXXXXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91XXXXXXXXXXXXX,n,Hangup()
|
||||
; block calls to 555 numbers
|
||||
; exten => _91NXX555NXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91NXX555NXXX,n,Dial(${TRUNKloop}/8889990011112,,to)
|
||||
; exten => _91NXX555NXXX,n,Hangup()
|
||||
; dial a USA long distance outbound number through the loopback-no-log context
|
||||
; exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => _91NXXNXXXXXX,n,Dial(${TRUNKloop}/888${EXTEN:2},55,o)
|
||||
; exten => _91NXXNXXXXXX,n,Hangup()
|
||||
;exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,91${EXTEN:3},1)
|
||||
;exten => _888NXXNXXXXXX,n,Hanguo()
|
||||
|
||||
exten => 8889990011112,1,Goto(loopback-no-log,9990011112,1)
|
||||
exten => 8889990011112,n,Hanguo()
|
||||
|
||||
|
||||
; Inbound call from BINFONE
|
||||
; exten => 1112223333,1,AGI(agi://127.0.0.1:4577/call_log)
|
||||
; exten => 1112223333,n,Dial(sip/gs102,55,o)
|
||||
; exten => 1112223333,n,Hangup()
|
||||
|
||||
; Extension 7275551212 - Inbound local number from PRI with 10 digit delivery
|
||||
;exten => 7275551212,1,Ringing()
|
||||
;exten => 7275551212,n,Wait(1)
|
||||
;exten => 7275551212,n,AGI(agi://127.0.0.1:4577/call_log--fullCID--${EXTEN}-----${CALLERID(all)}-----${CALLERID(num)}-----${CALLERID(name)})
|
||||
;exten => 7275551212,n,Answer()
|
||||
;exten => 7275551212,n,Dial(sip/spa2000&sip/spa2001,30,To)
|
||||
;exten => 7275551212,n,Voicemail(u2000)
|
||||
;exten => 7275551212,n,Hangup()
|
||||
|
||||
; parameters for call_inbound.agi (7 fields separated by five dashes "-----"):
|
||||
; 1. the extension of the phone to ring as defined in the asterisk.phones table
|
||||
; 2. the phone number that was called, for the live_inbound/_log entry
|
||||
; 3. a text description of the number that was called in
|
||||
; 4-7. optional fields, they are also passed as fields in the GUI to web browser
|
||||
; This is not part of VICIDIAL, it is for astGUIclient agent use only
|
||||
|
||||
; Extension 3429 - Inbound 800 number (1-800-555-3429) example of RBS T1
|
||||
; with 10 digit ANI and 4 digit DNIS star separated
|
||||
;exten => _**3429,1,Ringing
|
||||
;exten => _**3429,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _**3429,n,AGI(call_inbound.agi,spa2000-----8005553429-----Inbound 800-----x-----y-----z-----w)
|
||||
;exten => _**3429,n,Answer()
|
||||
;exten => _**3429,n,Dial(sip/spa2000&sip/spa2001,30,to)
|
||||
;exten => _**3429,n,Voicemail(u2000)
|
||||
;exten => _**3429,n,Hangup()
|
||||
; Extension 3429 - with ANI [callerID]
|
||||
;exten => _*NXXNXXXXXX*3429,1,Ringing
|
||||
;exten => _*NXXNXXXXXX*3429,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
;exten => _*NXXNXXXXXX*3429,n,AGI(call_inbound.agi,spa2000-----8005553429-----Inbound 800-----x-----y-----z-----w)
|
||||
;exten => _*NXXNXXXXXX*3429,n,Answer()
|
||||
;exten => _*NXXNXXXXXX*3429,n,Dial(sip/spa2000&sip/spa2001,30,to)
|
||||
;exten => _*NXXNXXXXXX*3429,n,Voicemail(u2000)
|
||||
;exten => _*NXXNXXXXXX*3429,n,Hangup()
|
||||
|
||||
|
||||
; parameters for agi-VDAD_ALL_inbound.agi (upto 12 fields separated by five dashes "-----"):
|
||||
; Below are the parameters needed for the script to be run properly
|
||||
; 1. the method of call handling for the script:
|
||||
; - CID - CID received, add record with phone number
|
||||
; - CIDLOOKUP - Lookup CID to find record in whole system
|
||||
; - CIDLOOKUPRL - Restrict lookup to one list
|
||||
; - CIDLOOKUPRC - Restrict lookup to one campaign's lists
|
||||
; - CLOSER - Closer calls from VICIDIAL fronters
|
||||
; - ANI - ANI received, add record with phone number (based on RBS T1s)
|
||||
; - ANILOOKUP - Lookup ANI to find record in whole system
|
||||
; - ANILOOKUPRL - Restrict lookup to one list
|
||||
; - ANILOOKUPRC - Restrict lookup to one campaign's lists
|
||||
; - VID - Add record with Vendor Lead Code received as argument 12
|
||||
; - VIDLOOKUP - Lookup Vendor Lead Code received as argument 12 to find record in whole system
|
||||
; - VIDLOOKUPRL - Restrict lookup to one list (argument 12)
|
||||
; - VIDLOOKUPRC - Restrict lookup to one campaign's lists (argument 12)
|
||||
; - VIDPROMPT - Prompt Vendor Lead Code to User with IVR to add record with Vendor Lead Code
|
||||
; - VIDPROMPTLOOKUP - Prompt Vendor Lead Code to User with IVR to find record in whole system
|
||||
; - VIDPROMPTLOOKUPRL - Restrict lookup to one list
|
||||
; - VIDPROMPTLOOKUPRC - Restrict lookup to one campaign's lists
|
||||
; - 3DIGITID - Enter 3 digit code to go to agent
|
||||
; - 4DIGITID - Enter 4 digit code to go to agent
|
||||
; - XDIGITID - Enter X digit code to go to agent(variable, i.e. 9DIGITID, 12DIGITID, etc...)
|
||||
; 2. the method of searching for an available agent:
|
||||
; - LO - Load Balance Overflow only (priority to home server)
|
||||
; - LB - <default> Load Balance total system
|
||||
; - SO - Home server only
|
||||
; 3. the full name of the IN GROUP to be used in vicidial for the inbound call
|
||||
; 4. the phone number that was called, for the log entry
|
||||
; 5. the callerID or lead_id of the person that called(usually overridden)
|
||||
; 6. the park extension audio file name if used
|
||||
; 7. the status of the call initially(usually not used)
|
||||
; 8. the list_id to insert the new lead under if it is new (and CID/ANI available)
|
||||
; 9. the phone dialing code to insert with the new lead if new (and CID/ANI available)
|
||||
; 10. the campaign_id to search within lists if CIDLOOKUPRC
|
||||
; 11. the user to queue the call to for AGENTDIRECT in-group calls
|
||||
; 12. vendor_lead_code if external mechanism like custom IVR is used to prompt user for ID
|
||||
;
|
||||
; inbound VICIDIAL call with CID delivery through T1 PRI
|
||||
;exten => 1234,1,Answer() ; Answer the line
|
||||
;exten => 1234,n,AGI(agi-VDAD_ALL_inbound.agi,CID-----LB-----CL_GALLERIA-----7274515134-----Closer-----park----------999-----1)
|
||||
;exten => 1234,n,Hangup()
|
||||
|
||||
; inbound VICIDIAL transfer calls [can arrive through PRI T1 crossover, IAX or SIP channel]
|
||||
exten => _90009.,1,Answer() ; Answer the line
|
||||
exten => _90009.,n,Dial(${TRUNKloop}/9${EXTEN},,to)
|
||||
exten => _90009.,n,Hangup()
|
||||
exten => _990009.,1,Answer() ; Answer the line, Sometimes needs to be removed
|
||||
exten => _990009.,n,AGI(agi-VDAD_ALL_inbound.agi,CLOSER-----LB-----CL_TESTCAMP-----7275551212-----Closer-----park----------999-----1)
|
||||
exten => _990009.,n,Hangup()
|
||||
; DID forwarded calls
|
||||
exten => _99909*.,1,Answer()
|
||||
exten => _99909*.,n,AGI(agi-VDAD_ALL_inbound.agi)
|
||||
exten => _99909*.,n,Hangup()
|
||||
|
||||
|
||||
; barge monitoring extension
|
||||
exten => 8159,1,ZapBarge()
|
||||
exten => 8159,n,Hangup()
|
||||
|
||||
; ZapBarge direct channel extensions
|
||||
exten => _86120XX,1,ZapBarge(${EXTEN:5})
|
||||
exten => _86120XX,n,Hangup()
|
||||
|
||||
; MeetMe Adjustment Extensions
|
||||
exten => _X48600XXX,1,MeetMeAdmin(${EXTEN:2},T,${EXTEN:0:1})
|
||||
exten => _X48600XXX,2,Hangup()
|
||||
|
||||
exten => _X38600XXX,1,MeetMeAdmin(${EXTEN:2},t,${EXTEN:0:1})
|
||||
exten => _X38600XXX,2,Hangup()
|
||||
|
||||
exten => _X28600XXX,1,MeetMeAdmin(${EXTEN:2},m,${EXTEN:0:1})
|
||||
exten => _X28600XXX,2,Hangup()
|
||||
|
||||
exten => _X18600XXX,1,MeetMeAdmin(${EXTEN:2},M,${EXTEN:0:1})
|
||||
exten => _X18600XXX,2,Hangup()
|
||||
|
||||
exten => _55558600XXX,1,MeetMeAdmin(${EXTEN:4},K)
|
||||
exten => _55558600XXX,2,Hangup()
|
||||
|
||||
; immediate hangup extension
|
||||
exten => 8300,1,Hangup()
|
||||
|
||||
; astGUIclient conferences
|
||||
exten => _86000[0-4]X,1,Meetme(${EXTEN},q)
|
||||
exten => _86000[0-4]X,n,Hangup()
|
||||
|
||||
; VICIDIAL conferences
|
||||
exten => _86000[5-9]X,1,Meetme(${EXTEN},F)
|
||||
exten => _86000[5-9]X,n,Hangup()
|
||||
exten => _8600[1-2]XX,1,Meetme(${EXTEN},F)
|
||||
exten => _8600[1-2]XX,n,Hangup()
|
||||
|
||||
; quiet entry and leaving conferences for VICIDIAL (inbound announce, SendDTMF and ring-agent)
|
||||
exten => _78600XXX,1,Meetme(${EXTEN:1},Fq)
|
||||
exten => _78600XXX,n,Hangup()
|
||||
|
||||
; quiet monitor-only extensions for meetme rooms (for room managers)
|
||||
exten => _68600XXX,1,Meetme(${EXTEN:1},Fmq)
|
||||
exten => _68600XXX,n,Hangup()
|
||||
|
||||
; Asterisk 1.8 workaround
|
||||
exten => _58600XXX,1,Meetme(${EXTEN:1},Fmq)
|
||||
exten => _58600XXX,n,Hangup()
|
||||
|
||||
; quiet monitor-only entry and leaving conferences for VICIDIAL (recording)
|
||||
exten => _558600XXX,1,Meetme(${EXTEN:2},Fmq)
|
||||
exten => _558600XXX,n,Hangup()
|
||||
|
||||
; voicelab exten
|
||||
exten => _86009XX,1,Meetme(${EXTEN},Fmq)
|
||||
; voicelab exten moderator
|
||||
exten => _986009XX,1,Meetme(${EXTEN:1})
|
||||
|
||||
|
||||
|
||||
; park channel for client GUI parking, hangup after 30 minutes
|
||||
; create a GSM formatted audio file named "park.gsm" that is 30 minutes long
|
||||
; and put it in /var/lib/asterisk/sounds
|
||||
exten => 8301,1,Answer()
|
||||
exten => 8301,n,AGI(park_CID.agi)
|
||||
exten => 8301,n,Playback(park)
|
||||
exten => 8301,n,Hangup()
|
||||
exten => 8303,1,Answer()
|
||||
exten => 8303,n,AGI(park_CID.agi)
|
||||
exten => 8303,n,Playback(conf)
|
||||
exten => 8303,n,Hangup()
|
||||
|
||||
; park channel for client GUI conferencing, hangup after 30 minutes
|
||||
; create a GSM formatted audio file named "conf.gsm" that is 30 minutes long
|
||||
; and put it in /var/lib/asterisk/sounds
|
||||
exten => 8302,1,Answer()
|
||||
exten => 8302,n,Playback(conf)
|
||||
exten => 8302,n,Hangup()
|
||||
|
||||
exten => 8304,1,Answer()
|
||||
exten => 8304,n,Playback(ding)
|
||||
exten => 8304,n,Hangup()
|
||||
|
||||
; default audio for safe harbor 2-second-after-hello message then hangup
|
||||
; create a GSM formatted audio file complies with safe harbor rules
|
||||
; and put it in /var/lib/asterisk/sounds then change filename below
|
||||
exten => 8307,1,Answer()
|
||||
exten => 8307,n,Playback(vm-goodbye)
|
||||
exten => 8307,n,Hangup()
|
||||
|
||||
; this is used for playing a message to an answering machine forwarded from AMD in VICIDIAL
|
||||
exten => 8320,1,AGI(VD_amd.agi,${EXTEN}-----YES)
|
||||
exten => 8320,n,Hangup()
|
||||
exten => _8320*.,1,AGI(VD_amd.agi,${EXTEN}-----YES)
|
||||
exten => _8320*.,n,Hangup()
|
||||
|
||||
; these are used for the ring_all function in VICIDIAL
|
||||
exten => _8331*.,1,Playback(sip-silence)
|
||||
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
|
||||
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
|
||||
exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
|
||||
exten => _8331*.,n,Hangup()
|
||||
|
||||
|
||||
; use for selective CallerID hangup by area code(hard-coded)
|
||||
exten => 8352,1,AGI(agi-VDADselective_CID_hangup.agi,${EXTEN})
|
||||
exten => 8352,n,Playback(safe_harbor)
|
||||
exten => 8352,n,Hangup()
|
||||
|
||||
; this is used for sending DTMF signals within conference calls, the client app
|
||||
; sends the digits to be played in the callerID field
|
||||
; sound files must be placed in /var/lib/asterisk/sounds
|
||||
exten => 8500998,1,Answer()
|
||||
exten => 8500998,n,Playback(silence)
|
||||
exten => 8500998,n,AGI(agi-dtmf.agi)
|
||||
exten => 8500998,n,Hangup()
|
||||
|
||||
; multi-remote-monitor entry extensions
|
||||
exten => 8162,1,Dial(${TRUNKblind}/34567890123456789,55,to)
|
||||
exten => 8162,n,Hangup()
|
||||
|
||||
exten => 34567890123456789,1,Answer()
|
||||
exten => 34567890123456789,n,Goto(monitor,s,1)
|
||||
exten => 34567890123456789,n,Hangup()
|
||||
|
||||
;#### VDAD STANDARD TRANSFER ENTRIES ####
|
||||
; Below are the parameters needed for the agi-VDAD_ALL_outbound.agi script to be run properly
|
||||
; 1. the method of call handling for the script:
|
||||
; - NORMAL - <default> Standard outbound routing to agent
|
||||
; - TEST - For performance testing only
|
||||
; - BROADCAST - For no-agent broadcast dialing
|
||||
; - SURVEY - For survery question then on to agent
|
||||
; - REMINDER - Reminder campaign
|
||||
; - REMINDX - Reminder with transfer to agent
|
||||
; 2. the method of searching for an available agent:
|
||||
; - LB - <default> Load Balance total system
|
||||
; - LO - Load Balance Overflow only (priority to home server)
|
||||
; - SO - Home server only
|
||||
; 3. the sound file to play when doing a SURVEY, REMINDER, REMINDX campaign
|
||||
; 4. the acceptible dtmf digits for a SURVEY
|
||||
; 5. the out-opt digit for a SURVEY (must be in the digit map)
|
||||
; 6. the sound file to play for a SURVEY when transfering to an agent
|
||||
; 7. the sound file to play for a SURVEY when DNCing the call
|
||||
; 8. OPTIN or OPTOUT: if OPTIN call is only sent to agent with button press
|
||||
; if OPTOUT call is sent to agent if no button press at all
|
||||
; 9. the status that is use for a SURVEY when someone opts out
|
||||
; if the status is DNC it will also add them to the internal dnc table
|
||||
|
||||
; Local channel resolution fix for Asterisk 13
|
||||
exten => _1383XX,1,AGI(agi-VDAD_local_optimize.agi,${CONNECTEDLINE(name)})
|
||||
exten => _1383XX,n,Wait(2)
|
||||
exten => _1383XX,n,Hangup()
|
||||
|
||||
exten => _138331*.,1,AGI(agi-VDAD_local_optimize.agi,${CONNECTEDLINE(name)})
|
||||
exten => _138331*.,n,Wait(2)
|
||||
exten => _138331*.,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script for no-agent campaigns:
|
||||
exten => 8364,1,Playback(sip-silence)
|
||||
exten => 8364,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8364,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8364,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8364,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script:
|
||||
exten => 8365,1,Playback(sip-silence)
|
||||
exten => 8365,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8365,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----SO)
|
||||
exten => 8365,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----SO)
|
||||
exten => 8365,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script SURVEY at beginning:
|
||||
exten => 8366,1,Playback(sip-silence)
|
||||
exten => 8366,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8366,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMP-----LB)
|
||||
exten => 8366,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMP-----LB)
|
||||
exten => 8366,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script Load Balance Overflow:
|
||||
exten => 8367,1,Playback(sip-silence)
|
||||
exten => 8367,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8367,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LO)
|
||||
exten => 8367,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LO)
|
||||
exten => 8367,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script Load Balanced:
|
||||
exten => 8368,1,Playback(sip-silence)
|
||||
exten => 8368,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8368,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8368,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8368,n,Hangup()
|
||||
|
||||
; VICIDIAL_auto_dialer transfer script AMD with Load Balanced:
|
||||
exten => 8369,1,Playback(sip-silence)
|
||||
exten => 8369,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8369,n,AMD(2000,2000,1000,5000,120,50,4,256)
|
||||
exten => 8369,n,AGI(VD_amd.agi,${EXTEN})
|
||||
exten => 8369,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8369,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB)
|
||||
exten => 8369,n,Hangup()
|
||||
|
||||
; VICIDIAL auto-dial reminder script
|
||||
exten => 8372,1,Playback(sip-silence)
|
||||
exten => 8372,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8372,n,AGI(agi-VDADautoREMINDER.agi,${EXTEN})
|
||||
exten => 8372,n,AGI(agi-VDADautoREMINDER.agi,${EXTEN})
|
||||
exten => 8372,n,Hangup()
|
||||
|
||||
; VICIDIAL SURVEY transfer script AMD with Load Balanced:
|
||||
exten => 8373,1,Playback(sip-silence)
|
||||
exten => 8373,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8373,n,AMD(2000,2000,1000,5000,120,50,4,256)
|
||||
exten => 8373,n,AGI(VD_amd.agi,${EXTEN})
|
||||
exten => 8373,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMP-----LB)
|
||||
exten => 8373,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMP-----LB)
|
||||
exten => 8373,n,Hangup()
|
||||
|
||||
; VICIDIAL SURVEY transfer script with Cepstral names:
|
||||
exten => 8374,1,Playback(sip-silence)
|
||||
exten => 8374,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8374,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
|
||||
exten => 8374,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
|
||||
exten => 8374,n,Hangup()
|
||||
|
||||
; VICIDIAL SURVEY transfer script AMD with Cepstral variables:
|
||||
exten => 8375,1,Playback(sip-silence)
|
||||
exten => 8375,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8375,n,AMD(2000,2000,1000,5000,120,50,4,256)
|
||||
exten => 8375,n,AGI(VD_amd.agi,${EXTEN})
|
||||
exten => 8375,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
|
||||
exten => 8375,n,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
|
||||
exten => 8375,n,Hangup()
|
||||
|
||||
; BETA VICIDIAL_auto_dialer transfer script Load Balanced:
|
||||
exten => 8377,1,Playback(sip-silence)
|
||||
exten => 8377,n,AGI(agi://127.0.0.1:4577/call_log)
|
||||
exten => 8377,n,Set(LRct=1)
|
||||
exten => 8377,n,While($[${LRct} < 100])
|
||||
exten => 8377,n,AGI(agi-VDAD_ALL_outboundBETA.agi,NORMAL-----LB)
|
||||
exten => 8377,n,Set(LRct=$[${LRct} + 1])
|
||||
exten => 8377,n,EndWhile()
|
||||
exten => 8377,n,AGI(agi-VDAD_ALL_outboundBETA.agi,NORMAL-----LB)
|
||||
exten => 8377,n,Hangup()
|
||||
|
||||
|
||||
; PERFORMANCE TESTING
|
||||
exten => _999XXXXXX1,1,Answer()
|
||||
exten => _999XXXXXX1,n,Wait(2)
|
||||
exten => _999XXXXXX1,n,Playback(vicidial-welcome)
|
||||
exten => _999XXXXXX1,n,Hangup()
|
||||
|
||||
exten => _999XX11112,1,Wait(2)
|
||||
exten => _999XX11112,n,Answer()
|
||||
exten => _999XX11112,n,Playback(ss-noservice)
|
||||
exten => _999XX11112,n,Playback(vm-goodbye)
|
||||
exten => _999XX11112,n,Hangup()
|
||||
|
||||
exten => _999XX18112,1,Wait(2)
|
||||
exten => _999XX18112,n,Answer()
|
||||
exten => _999XX18112,n,Playback(vtiger-fax)
|
||||
exten => _999XX18112,n,Playback(vtiger-fax)
|
||||
exten => _999XX18112,n,Hangup()
|
||||
|
||||
exten => _999XX19112,1,Wait(2)
|
||||
exten => _999XX19112,n,Answer()
|
||||
exten => _999XX19112,n,Playback(vtiger-email)
|
||||
exten => _999XX19112,n,Playback(vtiger-email)
|
||||
exten => _999XX19112,n,Hangup()
|
||||
|
||||
exten => _999XXXX112,1,Wait(5)
|
||||
exten => _999XXXX112,n,Answer()
|
||||
exten => _999XXXX112,n,Playback(demo-instruct)
|
||||
exten => _999XXXX112,n,Playback(demo-instruct)
|
||||
exten => _999XXXX112,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX2,1,Wait(8)
|
||||
exten => _999XXXXXX2,n,Answer()
|
||||
exten => _999XXXXXX2,n,Playback(demo-instruct)
|
||||
exten => _999XXXXXX2,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX3,1,Set(PRI_CAUSE=1)
|
||||
exten => _999XXXXXX3,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX4,1,Set(PRI_CAUSE=27)
|
||||
exten => _999XXXXXX4,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX5,1,Ringing
|
||||
exten => _999XXXXXX5,n,Wait(120)
|
||||
exten => _999XXXXXX5,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX6,1,Wait(10)
|
||||
exten => _999XXXXXX6,n,Answer()
|
||||
exten => _999XXXXXX6,n,Playback(demo-instruct)
|
||||
exten => _999XXXXXX6,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX7,1,Wait(12)
|
||||
exten => _999XXXXXX7,n,Answer()
|
||||
exten => _999XXXXXX7,n,Playback(demo-enterkeywords)
|
||||
exten => _999XXXXXX7,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX8,1,Set(PRI_CAUSE=17)
|
||||
exten => _999XXXXXX8,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX9,1,Wait(6)
|
||||
exten => _999XXXXXX9,n,Answer()
|
||||
exten => _999XXXXXX9,n,Playback(demo-abouttotry)
|
||||
exten => _999XXXXXX9,n,Hangup()
|
||||
|
||||
exten => _999XXXXXX0,1,Wait(5)
|
||||
exten => _999XXXXXX0,n,Answer()
|
||||
exten => _999XXXXXX0,n,Playback(vm-goodbye)
|
||||
exten => _999XXXXXX0,n,Hangup()
|
||||
|
||||
;exten => 99999999999,1,Answer()
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Playback(conf)
|
||||
;exten => 99999999999,n,Hangup()
|
||||
|
||||
|
||||
[monitor]
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
exten => s,1,Set(TIMEOUT(digit)=10)
|
||||
exten => s,n,Set(TIMEOUT(response)=10)
|
||||
exten => s,n,Set(MEETME_EXIT_CONTEXT=monitor_exit)
|
||||
exten => s,n,Background(vm-extension) ; need audio prompt.
|
||||
exten => s,n,WaitExten(10)
|
||||
exten => s,n,Hangup()
|
||||
|
||||
exten => i,1,Goto(monitor_exit,s,1)
|
||||
exten => i,n,Hangup()
|
||||
exten => #,1,Goto(monitor_exit,s,1)
|
||||
exten => #,n,Hangup()
|
||||
exten => t,1,Goto(monitor_exit,s,1)
|
||||
exten => t,n,Hangup()
|
||||
|
||||
exten => _8[0-2]XX,1,Meetme(8600${EXTEN:1},mqX) ; Listen
|
||||
exten => _8[0-2]XX,n,Hangup()
|
||||
exten => _99[0-2]XX,1,Meetme(8600${EXTEN:2},X) ; Barge
|
||||
exten => _99[0-2]XX,n,Hangup()
|
||||
|
||||
[monitor_exit]
|
||||
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
|
||||
exten => _X,1,Goto(monitor,s,1)
|
||||
exten => _X,n,Hangup()
|
||||
|
||||
exten => i,1,Goto(monitor,s,1)
|
||||
exten => i,n,Hangup()
|
||||
exten => #,1,Goto(monitor,s,1)
|
||||
exten => #,n,Hangup()
|
||||
exten => t,1,Goto(monitor,s,1)
|
||||
exten => t,n,Hangup()
|
||||
@@ -0,0 +1,38 @@
|
||||
[general]
|
||||
enabled = yes
|
||||
port = 5038
|
||||
bindaddr = 0.0.0.0
|
||||
|
||||
[cron]
|
||||
secret = 1234
|
||||
read = system,call,log,verbose,command,agent,user,originate
|
||||
write = system,call,log,verbose,command,agent,user,originate
|
||||
|
||||
[updatecron]
|
||||
secret = 1234
|
||||
read = command,reporting
|
||||
write = command,reporting
|
||||
|
||||
eventfilter=Event: CoreShowChannel
|
||||
|
||||
|
||||
[listencron]
|
||||
secret = 1234
|
||||
read = system,call,log,verbose,command,agent,user,dtmf
|
||||
write = command
|
||||
|
||||
eventfilter=Event: Shutdown
|
||||
eventfilter=Event: DTMFBegin
|
||||
eventfilter=Event: DTMFEnd
|
||||
eventfilter=Event: CPD-Result
|
||||
eventfilter=Event: SIP-Hangup-Cause
|
||||
eventfilter=Event: NewCallerid
|
||||
eventfilter=Event: Newstate
|
||||
eventfilter=Event: Hangup
|
||||
eventfilter=!Event: HangupRequest
|
||||
|
||||
|
||||
[sendcron]
|
||||
secret = 1234
|
||||
read = command
|
||||
write = system,call,log,verbose,command,agent,user,originate
|
||||
@@ -1723,7 +1723,8 @@ system_ip_blacklist VARCHAR(30) default '',
|
||||
agent_push_events ENUM('0','1') default '0',
|
||||
agent_push_url TEXT,
|
||||
hide_inactive_lists ENUM('0','1') default '0',
|
||||
allow_manage_active_lists ENUM('0','1') default '0'
|
||||
allow_manage_active_lists ENUM('0','1') default '0',
|
||||
expired_lists_inactive ENUM('0','1') default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -4071,4 +4072,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1515',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1516',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -370,3 +370,7 @@ CREATE TABLE vicidial_xfer_log_archive LIKE vicidial_xfer_log;
|
||||
ALTER TABLE vicidial_xfer_log_archive MODIFY xfercallid INT(9) UNSIGNED NOT NULL;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1515',db_schema_update_date=NOW() where db_schema_version < 1515;
|
||||
|
||||
ALTER TABLE system_settings ADD expired_lists_inactive ENUM('0','1') default '0';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1516',db_schema_update_date=NOW() where db_schema_version < 1516;
|
||||
|
||||
+20
-7
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# install.pl version 2.12
|
||||
# install.pl version 2.14
|
||||
#
|
||||
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
# CHANGES
|
||||
@@ -42,6 +42,7 @@
|
||||
# 151029-0650 - Added Asterisk 11 as listed option, added new sample voicemail.conf for 1.8 and higher
|
||||
# 151212-0840 - Added chat_customer web directory, removed static language build actions
|
||||
# 160101-0907 - Changed ip_relay code to look for installed package
|
||||
# 170915-1458 - Added Asterisk 13 compability pieces
|
||||
#
|
||||
|
||||
############################################
|
||||
@@ -1845,6 +1846,7 @@ else
|
||||
print " 1.4\n";
|
||||
print " 1.8\n";
|
||||
print " 11.X\n";
|
||||
print " 13.X\n";
|
||||
print "Enter asterisk version or press enter for default: [$VARasterisk_version] ";
|
||||
$PROMPTasterisk_version = <STDIN>;
|
||||
chomp($PROMPTasterisk_version);
|
||||
@@ -2649,11 +2651,22 @@ if ( ($PROMPTcopy_conf_files =~ /y/i) || ($CLIcopy_conf_files =~ /y/i) )
|
||||
}
|
||||
else
|
||||
{
|
||||
`cp -f ./docs/conf_examples/extensions.conf.sample-1.4 /etc/asterisk/extensions.conf`;
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.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`;
|
||||
if ($VARasterisk_version =~ /^13/)
|
||||
{
|
||||
`cp -f ./docs/conf_examples/extensions.conf.sample-13 /etc/asterisk/extensions.conf`;
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.conf`;
|
||||
`cp -f ./docs/conf_examples/manager.conf.sample-13 /etc/asterisk/manager.conf`;
|
||||
`cp -f ./docs/conf_examples/voicemail.conf.sample-1.8 /etc/asterisk/voicemail.conf`;
|
||||
}
|
||||
else
|
||||
{
|
||||
`cp -f ./docs/conf_examples/extensions.conf.sample-1.4 /etc/asterisk/extensions.conf`;
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.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/meetme.conf.sample /etc/asterisk/meetme.conf`;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 144 B |
Binary file not shown.
|
After Width: | Height: | Size: 145 B |
Binary file not shown.
|
After Width: | Height: | Size: 123 B |
@@ -0,0 +1,133 @@
|
||||
var persisteduls=new Object()
|
||||
var ddtreemenu=new Object()
|
||||
|
||||
ddtreemenu.closefolder="images/folder_closed.png" //set image path to "closed" folder image
|
||||
ddtreemenu.openfolder="images/folder_open.png" //set image path to "open" folder image
|
||||
|
||||
//////////No need to edit beyond here///////////////////////////
|
||||
|
||||
ddtreemenu.createTree=function(treeid, enablepersist, persistdays){
|
||||
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
|
||||
if (typeof persisteduls[treeid]=="undefined")
|
||||
persisteduls[treeid]=(enablepersist==true && ddtreemenu.getCookie(treeid)!="")? ddtreemenu.getCookie(treeid).split(",") : ""
|
||||
for (var i=0; i<ultags.length; i++)
|
||||
ddtreemenu.buildSubTree(treeid, ultags[i], i)
|
||||
if (enablepersist==true){ //if enable persist feature
|
||||
var durationdays=(typeof persistdays=="undefined")? 1 : parseInt(persistdays)
|
||||
ddtreemenu.dotask(window, function(){ddtreemenu.rememberstate(treeid, durationdays)}, "unload") //save opened UL indexes on body unload
|
||||
}
|
||||
}
|
||||
|
||||
ddtreemenu.buildSubTree=function(treeid, ulelement, index){
|
||||
ulelement.parentNode.className="submenu"
|
||||
if (typeof persisteduls[treeid]=="object"){ //if cookie exists (persisteduls[treeid] is an array versus "" string)
|
||||
if (ddtreemenu.searcharray(persisteduls[treeid], index)){
|
||||
ulelement.setAttribute("rel", "open")
|
||||
ulelement.style.display="block"
|
||||
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
|
||||
}
|
||||
else
|
||||
ulelement.setAttribute("rel", "closed")
|
||||
} //end cookie persist code
|
||||
else if (ulelement.getAttribute("rel")==null || ulelement.getAttribute("rel")==false) //if no cookie and UL has NO rel attribute explicted added by user
|
||||
ulelement.setAttribute("rel", "closed")
|
||||
else if (ulelement.getAttribute("rel")=="open") //else if no cookie and this UL has an explicit rel value of "open"
|
||||
ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
|
||||
ulelement.parentNode.onclick=function(e){
|
||||
var submenu=this.getElementsByTagName("ul")[0]
|
||||
if (submenu.getAttribute("rel")=="closed"){
|
||||
submenu.style.display="block"
|
||||
submenu.setAttribute("rel", "open")
|
||||
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
|
||||
}
|
||||
else if (submenu.getAttribute("rel")=="open"){
|
||||
submenu.style.display="none"
|
||||
submenu.setAttribute("rel", "closed")
|
||||
ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.closefolder+")"
|
||||
}
|
||||
ddtreemenu.preventpropagate(e)
|
||||
}
|
||||
ulelement.onclick=function(e){
|
||||
ddtreemenu.preventpropagate(e)
|
||||
}
|
||||
}
|
||||
|
||||
ddtreemenu.expandSubTree=function(treeid, ulelement){ //expand a UL element and any of its parent ULs
|
||||
var rootnode=document.getElementById(treeid)
|
||||
var currentnode=ulelement
|
||||
currentnode.style.display="block"
|
||||
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
|
||||
while (currentnode!=rootnode){
|
||||
if (currentnode.tagName=="UL"){ //if parent node is a UL, expand it too
|
||||
currentnode.style.display="block"
|
||||
currentnode.setAttribute("rel", "open") //indicate it's open
|
||||
currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
|
||||
}
|
||||
currentnode=currentnode.parentNode
|
||||
}
|
||||
}
|
||||
|
||||
ddtreemenu.flatten=function(treeid, action){ //expand or contract all UL elements
|
||||
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
|
||||
for (var i=0; i<ultags.length; i++){
|
||||
ultags[i].style.display=(action=="expand")? "block" : "none"
|
||||
var relvalue=(action=="expand")? "open" : "closed"
|
||||
ultags[i].setAttribute("rel", relvalue)
|
||||
ultags[i].parentNode.style.backgroundImage=(action=="expand")? "url("+ddtreemenu.openfolder+")" : "url("+ddtreemenu.closefolder+")"
|
||||
}
|
||||
}
|
||||
|
||||
ddtreemenu.rememberstate=function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
|
||||
var ultags=document.getElementById(treeid).getElementsByTagName("ul")
|
||||
var openuls=new Array()
|
||||
for (var i=0; i<ultags.length; i++){
|
||||
if (ultags[i].getAttribute("rel")=="open")
|
||||
openuls[openuls.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
|
||||
}
|
||||
if (openuls.length==0) //if there are no opened ULs to save/persist
|
||||
openuls[0]="none open" //set array value to string to simply indicate all ULs should persist with state being closed
|
||||
ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
|
||||
}
|
||||
|
||||
////A few utility functions below//////////////////////
|
||||
|
||||
ddtreemenu.getCookie=function(Name){ //get cookie value
|
||||
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
|
||||
if (document.cookie.match(re)) //if cookie found
|
||||
return document.cookie.match(re)[0].split("=")[1] //return its value
|
||||
return ""
|
||||
}
|
||||
|
||||
ddtreemenu.setCookie=function(name, value, days){ //set cookei value
|
||||
var expireDate = new Date()
|
||||
//set "expstring" to either future or past date, to set or delete cookie, respectively
|
||||
var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
|
||||
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
|
||||
}
|
||||
|
||||
ddtreemenu.searcharray=function(thearray, value){ //searches an array for the entered value. If found, delete value from array
|
||||
var isfound=false
|
||||
for (var i=0; i<thearray.length; i++){
|
||||
if (thearray[i]==value){
|
||||
isfound=true
|
||||
thearray.shift() //delete this element from array for efficiency sake
|
||||
break
|
||||
}
|
||||
}
|
||||
return isfound
|
||||
}
|
||||
|
||||
ddtreemenu.preventpropagate=function(e){ //prevent action from bubbling upwards
|
||||
if (typeof e!="undefined")
|
||||
e.stopPropagation()
|
||||
else
|
||||
event.cancelBubble=true
|
||||
}
|
||||
|
||||
ddtreemenu.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
|
||||
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
|
||||
if (target.addEventListener)
|
||||
target.addEventListener(tasktype, functionref, false)
|
||||
else if (target.attachEvent)
|
||||
target.attachEvent(tasktype, functionref)
|
||||
}
|
||||
+44
-5
File diff suppressed because one or more lines are too long
@@ -133,6 +133,7 @@
|
||||
# 170816-1057 - Added inbound after call entries
|
||||
# 170819-0951 - Added allow_manage_active_lists entry
|
||||
# 170825-1129 - Added auto_reports-filename_override entry
|
||||
# 170920-2156 - Added expired_lists_inactive entry
|
||||
#
|
||||
|
||||
|
||||
@@ -5380,6 +5381,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Lead Manager Active Lists"); ?> -</B><?php echo _QXZ("This setting if enabled will allow a manager to select active lists for modification within the Lead Management admin utilities. We do not recommend enabling this option since it can cause issues with leads that could be part of active calling within the system. Default is 0 for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-expired_lists_inactive">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Expired Lists Auto Inactive"); ?> -</B><?php echo _QXZ("This setting if enabled will automatically change lists that have an expiration date set to a past date to Active equals N. This is performed through both a check every time the List Modify screen is loaded for a specific list as well as a once an hour check on all lists. Default is 0 for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-enable_drop_lists">
|
||||
<BR>
|
||||
|
||||
Reference in New Issue
Block a user