From dbfc261b0403192141154e41e55bd77ab3584696 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 26 May 2011 04:37:51 +0000 Subject: [PATCH] Added ability to have outbound auto-dial campaigns drop to an audio prompt or a call menu. Outbound IVR Report added. Added optional logging of call menu caller key presses. Lead ID can now be preserved on calls coming from auto-dial or in-groups that go through call menus and back into an in-group. git-svn-id: svn://192.168.202.10@1664 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 6 + agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 26 +- agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi | 147 ++++++--- .../agi/agi-VDAD_inbound_calltime_check.agi | 161 +++++++--- agc_2-X/trunk/agi/cm.agi | 289 ++++++++++++++++++ agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl | 52 ++++ agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl | 56 ++-- agc_2-X/trunk/bin/AST_VDauto_dial.pl | 3 +- agc_2-X/trunk/docs/VICIDIAL_statuses.txt | 1 + .../trunk/extras/MySQL_AST_CREATE_tables.sql | 26 +- agc_2-X/trunk/extras/upgrade_2.4.sql | 25 ++ .../TO_BE_TRANSLATED_2.4.txt | 8 + agc_2-X/trunk/www/vicidial/AST_IVRstats.php | 166 +++++++--- agc_2-X/trunk/www/vicidial/admin.php | 73 ++++- agc_2-X/trunk/www/vicidial/admin_header.php | 24 +- .../trunk/www/vicidial/admin_modify_lead.php | 33 +- 16 files changed, 919 insertions(+), 177 deletions(-) create mode 100644 agc_2-X/trunk/agi/cm.agi diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 42b96acf..6146175e 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -596,6 +596,12 @@ OTHER CHANGES: 131. Change Dial Level Difference Target to work properly with all RATIO and ADAPT dial method outbound campaigns. +132. Added ability to have outbound auto-dial campaigns drop to an audio prompt + or a call menu. Outbound IVR Report added. Added optional logging of + call menu caller key presses. Lead ID can now be preserved on calls + coming from auto-dial or in-groups that go through call menus and back + into an in-group. + diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 9554d9b6..55819a98 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -14,7 +14,7 @@ # ; - 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 +# ; - CLOSER - Closer calls from VICIDIAL fronters(and previous in-group calls) # ; - 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 @@ -149,6 +149,7 @@ # 110324-2330 - Added recording of remote agent calls, per in-group and campaign recording settings # 110325-1409 - Added user recording override settings checking for remote agent recording # 110505-1620 - Fixed minor voicemail issue +# 110525-1555 - Added CLOSER compatibility with outbound and in-group calls that went through Call Menu # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -328,6 +329,9 @@ while() } +if ($calleridname =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d|^Y\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + {$callerid = $calleridname;} + if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) { $calleridname = $callerid; @@ -335,10 +339,13 @@ if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown $calleridname =~ s/\"|\" //gi; } -$callerid =~ s/\D|\'//gi; -$calleridname =~ s/unknown|\'//gi; -if ( (!$callerid) or ($callerid =~ /unknown/) ) - {$callerid = $calleridname;} +if ($callerid !~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d|^Y\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + { + $callerid =~ s/\D|\'//gi; + $calleridname =~ s/unknown|\'//gi; + if ( (!$callerid) or ($callerid =~ /unknown/) ) + {$callerid = $calleridname;} + } ##### find out if this call is already in the vicidial_log_extended table $VLEcount=0; @@ -470,6 +477,15 @@ if ($call_handle_method =~ /^CLOSER/) $AGI->set_callerid($Jnewcallerid); if ($AGILOG) {$agi_string = "callerID changed: $Jnewcallerid"; &agi_output;} } + ### allow for outbound auto-dial calls or previous in-group calls passed through call menus + if ($callerid =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d|^Y\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + { + $CIDlead_id = substr($callerid, 10, 10); + $CIDlead_id = ($CIDlead_id + 0); + $VCcallerid = $callerid; + $insert_lead_id = $CIDlead_id; + if ($AGILOG) {$agi_string = "Lead ID found: $insert_lead_id"; &agi_output;} + } } if ( ($call_handle_method =~ /^CID/) || ($call_handle_method =~ /^VID/) ) diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index 93d6f54a..0862201f 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -84,6 +84,7 @@ # 110303-2316 - Added condition that would not allow calls to be sent to agent with ringing inbound call # 110324-2326 - Added recording of remote agent calls, per in-group and campaign recording settings # 110325-1410 - Added user recording override settings checking for remote agent recording +# 110525-1530 - Added AUDIO and CALLMENU drop options # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -476,7 +477,7 @@ if ($VDACaffected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename,safe_harbor_audio,safe_harbor_menu_id FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -511,6 +512,8 @@ if ($VDACaffected_rows > 0) $queuemetrics_phone_environment = $aryA[21]; $campaign_recording = $aryA[22]; $campaign_rec_filename = $aryA[23]; + $safe_harbor_audio = $aryA[24]; + $safe_harbor_menu_id = $aryA[25]; if (length($closer_campaigns) > 2) { $closer_campaigns =~ s/^ | -$//gi; @@ -2427,24 +2430,8 @@ if ($drop_timer > $DROP_TIME) $CIDdate = "$mon$mday$hour$min$sec"; $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; - - if ($enable_queuemetrics_logging > 0) - { - $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") - or die "Couldn't connect to database: " . DBI->errstr; - - if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; - $Baffected_rows = $dbhB->do($stmtB); - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01048'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; - - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='DROP',serverid='$queuemetrics_log_id';"; - $Baffected_rows = $dbhB->do($stmtB); - $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01049'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; - - $dbhB->disconnect(); - } + $Euniqueid=$uniqueid; + $Euniqueid =~ s/\.\d+//gi; if ($drop_seconds < 1) { @@ -2494,39 +2481,118 @@ if ($drop_timer > $DROP_TIME) $S='*'; $DROPexten = "90009*$drop_inbound_group$S$S$CIDlead_id$S$S$VDADphone$S$fronter$S"; } + if ($drop_action =~ /CALLMENU/) + { + $DROPexten = 's'; + $ext_context = $safe_harbor_menu_id; + if (length($ext_context)<1) + {$DROPexten = '';} + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; - $Euniqueid=$uniqueid; - $Euniqueid =~ s/\.\d+//gi; - $stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',term_reason='QUEUETIMEOUT' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";"; - if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} - $affected_rows = $dbhA->do($stmtA); - $dbhP=$dbhA; $mysql_count='01050'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; - if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$affected_rows|$uniqueid"; &agi_output;} + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtA = "UPDATE vicidial_list set status='DROP' where lead_id = '$CIDlead_id';"; - if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} - $affected_rows = $dbhA->do($stmtA); - $dbhP=$dbhA; $mysql_count='01051'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; - if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$CIDlead_id"; &agi_output;} + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; - $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;"; - $affected_rows = $dbhA->do($stmtA); - $dbhP=$dbhA; $mysql_count='01052'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; - if ($AGILOG) {$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|"; &agi_output;} + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='IVRXFR',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + $dbhB->disconnect(); + } + + $stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='IVRXFR',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',term_reason='CALLMENUXFER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$affected_rows|$uniqueid"; &agi_output;} + + $stmtA = "UPDATE vicidial_list set status='IVRXFR' where lead_id = '$CIDlead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$CIDlead_id"; &agi_output;} + } + else + { + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01048'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='CALLSTATUS',data1='DROP',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + $dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='01049'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging; + + $dbhB->disconnect(); + } + + $stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',term_reason='QUEUETIMEOUT' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='01050'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$affected_rows|$uniqueid"; &agi_output;} + + $stmtA = "UPDATE vicidial_list set status='DROP' where lead_id = '$CIDlead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='01051'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$CIDlead_id"; &agi_output;} + + $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;"; + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='01052'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|"; &agi_output;} + } + + if ($drop_action =~ /AUDIO/) + { + $DROPexten=''; + if ($AGILOG) {$agi_string = "playing drop message: $safe_harbor_audio"; &agi_output;} + + if (length($safe_harbor_audio) > 0) + { + $AGI->stream_file('sip-silence'); + $AGI->stream_file('sip-silence'); + if ($safe_harbor_audio =~ /\|/) + { + @safe_harbor_audio_array = split(/\|/,$safe_harbor_audio); + $w=0; + foreach(@safe_harbor_audio_array) + { + if (length($safe_harbor_audio_array[$w])>0) + { + $AGI->stream_file("$safe_harbor_audio_array[$w]"); + } + $w++; + } + } + else + {$AGI->stream_file("$safe_harbor_audio");} + } + } - ### use STDOUT to send call to proper DROP location - $VHqueryCID = "VH$CIDdate$VDADconf_exten"; if (length($DROPexten)>0) - { ### if DROP extension is defined then send the dropped call there instead of hangup + { + ### if DROP extension is defined then send the dropped call there instead of hangup $AGI->stream_file('ding'); # stop music-on-hold process sleep(1); - if ($AGILOG) {$agi_string = "exiting the VDAD app, transferring call to $DROPexten"; &agi_output;} + if ($AGILOG) {$agi_string = "exiting the VDAD app, transferring call to $DROPexten $ext_context"; &agi_output;} print "SET CONTEXT $ext_context\n"; checkresult($result); print "SET EXTENSION $DROPexten\n"; @@ -2536,6 +2602,9 @@ if ($drop_timer > $DROP_TIME) } else { + ### use STDOUT to send call to proper DROP location + $VHqueryCID = "VH$CIDdate$VDADconf_exten"; + ### insert a NEW record to the vicidial_manager table to be processed $stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$VARserver_ip','','Hangup','$VHqueryCID','Channel: $channel','','','','','','','','','')"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi b/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi index 6dcdbbf9..97b79e27 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi @@ -26,7 +26,7 @@ #exten => 1234,2,AGI(agi-VDAD_inbound_calltime_check.agi,INBOUND-----YES-----START-----24hours-----EXTENSION-----101-----default) #exten => 1234,3,Hangup # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # changes: # 80525-0144 - First Build @@ -37,6 +37,7 @@ # 90621-1130 - Fixed issue when no call time is specified # 91122-2353 - Added QueueMetrics logging as IVR INFO entries # 101219-2110 - Added call time overflow +# 110525-1347 - Added compatibility for outbound IVR logging # $script = 'agi-VDAD_inbound_calltime_check.agi'; @@ -210,24 +211,50 @@ while() if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;} } - -if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) +$outboundIVR=0; +$ingroupIVR=0; +if ($calleridname =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d|^Y\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) { - $calleridname = $callerid; - $calleridname =~ s/\<\d\d\d\d\d\d\d\d\d\d\>//gi; - $calleridname =~ s/\"|\" //gi; + $callerid = $calleridname; + + $stmtA = "SELECT campaign_id,lead_id FROM vicidial_auto_calls where callerid='$callerid';"; + $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; + $campaign_id = $aryA[0]; + $lead_id = $aryA[1]; + } + $sthA->finish(); + + if ($calleridname =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + {$outboundIVR=1;} + if ($calleridname =~ /^Y\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + {$ingroupIVR=1;} } +else + { + if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) + { + $calleridname = $callerid; + $calleridname =~ s/\<\d\d\d\d\d\d\d\d\d\d\>//gi; + $calleridname =~ s/\"|\" //gi; + } -$callerid =~ s/\D|\'//gi; -$calleridname =~ s/unknown|\'//gi; -if ( (!$callerid) or ($callerid =~ /unknown/) ) - {$callerid = $calleridname;} + $callerid =~ s/\D|\'//gi; + $calleridname =~ s/unknown|\'//gi; + if ( (!$callerid) or ($callerid =~ /unknown/) ) + {$callerid = $calleridname;} -if (length($callerid)>0) {$phone_number = $callerid;} - else {$phone_number = '';} -if (length($calleridname)>0) {$VLcomments = $calleridname;} - else {$VLcomments = '';} + if (length($callerid)>0) {$phone_number = $callerid;} + else {$phone_number = '';} + if (length($calleridname)>0) {$VLcomments = $calleridname;} + else {$VLcomments = '';} + } + if (length($callerid)<8) {$callerid = $parked_by;} if (length($pin)>0) {$callerid = $pin;} @@ -378,6 +405,43 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st { $VHqueryCID = "VA$CIDdate$hour$min$sec$sec"; + if ($outboundIVR > 0) + { + $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and campaign_id='$campaign_id' and server_ip='$VARserver_ip' order by call_time desc limit 1;"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- AH VDAC vac record deleted: |$affected_rows|$campaign_id|$callerid|"; &agi_output;} + + $stmtA = "INSERT INTO vicidial_outbound_ivr_log (uniqueid,caller_code,event_date,campaign_id,lead_id,menu_id,menu_action) values('$uniqueid','$callerid','$SQLdate','$campaign_id','$lead_id','$context','AFTERHOURSDROP')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VOIL insert: |$affected_rowsL|$uniqueid|$callerid|$campaign_id|$lead_id|$context|"; &agi_output;} + } + else + { + $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and uniqueid='$uniqueid' and server_ip='$VARserver_ip' order by call_time desc limit 1;"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- AH VDAC vac record deleted: |$affected_rows|$uniqueid|$callerid|"; &agi_output;} + + $stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,phone_ext,start_time,comment_a,comment_b,comment_c,comment_d,comment_e) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$phone_number','$SQLdate','$channel_group','$note','AFTERHOURSDROP','$context','$priority')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- AH LIL insert: |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;} + } + + ### QueueMetrics logging if enabled + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';"; + if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} + $Baffected_rows = $dbhB->do($stmtB); + $dbhB->disconnect(); + } + if ($after_hours_action =~ /EXTENSION|VOICEMAIL|IN_GROUP/) { if ($after_hours_action =~ /EXTENSION/) @@ -410,28 +474,6 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st checkresult($result); } } - $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and uniqueid='$uniqueid' and server_ip='$VARserver_ip' order by call_time desc limit 1;"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- AH VDCL vac record deleted: |$affected_rows| $uniqueid|$callerid|"; &agi_output;} - - $stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,phone_ext,start_time,comment_a,comment_b,comment_c,comment_d,comment_e) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$phone_number','$SQLdate','$channel_group','$note','AFTERHOURSDROP','$context','$priority')"; - if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} - $affected_rowsL = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- AH LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;} - - ### QueueMetrics logging if enabled - if ($enable_queuemetrics_logging > 0) - { - $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") - or die "Couldn't connect to database: " . DBI->errstr; - - if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';"; - if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} - $Baffected_rows = $dbhB->do($stmtB); - $dbhB->disconnect(); - } if ($after_hours_action =~ /MESSAGE|HANGUP/) { @@ -455,23 +497,47 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st ### insert an IVR record to the vicidial_auto_calls table -if ($log_to_vac =~ /YES/) +if ($outboundIVR > 0) { - $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and uniqueid='$uniqueid' and server_ip='$VARserver_ip';"; - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $uniqueid|$callerid|"; &agi_output;} + $stmtA = "INSERT INTO vicidial_outbound_ivr_log (uniqueid,caller_code,event_date,campaign_id,lead_id,menu_id,menu_action) values('$uniqueid','$callerid','$SQLdate','$campaign_id','$lead_id','$context','')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VOIL insert: |$affected_rowsL|$uniqueid|$callerid|$campaign_id|$lead_id|$context|"; &agi_output;} - $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,lead_id,status,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority,last_update_time) values('$VARserver_ip','$channel_group','0','IVR','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','IVR-0','$queue_priority','$last_update_time')"; + $stmtA = "UPDATE vicidial_auto_calls SET last_update_time='$last_update_time',status='IVR' where callerid='$callerid';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rowsV = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VAC : |$affected_rowsV|$uniqueid|$callerid|$extension|"; &agi_output;} + if ($AGILOG) {$agi_string = "-- VAC update: |$affected_rowsV|$uniqueid|$callerid|$last_update_time|"; &agi_output;} } +else + { + if ($log_to_vac =~ /YES/) + { + if ($ingroupIVR > 0) + { + $stmtA = "UPDATE vicidial_auto_calls SET last_update_time='$last_update_time',status='IVR' where callerid='$callerid';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsV = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VAC update: |$affected_rowsV|$uniqueid|$callerid|$last_update_time|"; &agi_output;} + } + else + { + $stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and uniqueid='$uniqueid' and server_ip='$VARserver_ip';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDAC vac record deleted: |$affected_rows| $uniqueid|$callerid|"; &agi_output;} -$stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,phone_ext,start_time,comment_a,comment_b,comment_d,comment_e) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$phone_number','$SQLdate','$channel_group','$note','$context','$priority')"; - if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} -$affected_rowsL = $dbhA->do($stmtA); -if ($AGILOG) {$agi_string = "-- LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;} + $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,lead_id,status,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority,last_update_time) values('$VARserver_ip','$channel_group','0','IVR','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','IVR-0','$queue_priority','$last_update_time')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsV = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VAC insert: |$affected_rowsV|$uniqueid|$callerid|$extension|"; &agi_output;} + } + } + $stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,phone_ext,start_time,comment_a,comment_b,comment_d,comment_e) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$phone_number','$SQLdate','$channel_group','$note','$context','$priority')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- LIL insert: |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;} + } ### QueueMetrics logging if enabled if ($enable_queuemetrics_logging > 0) @@ -481,6 +547,9 @@ if ($enable_queuemetrics_logging > 0) if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + if ($outboundIVR > 0) + {$uniqueid = $caller_id;} + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';"; if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} $Baffected_rows = $dbhB->do($stmtB); diff --git a/agc_2-X/trunk/agi/cm.agi b/agc_2-X/trunk/agi/cm.agi new file mode 100644 index 00000000..66035589 --- /dev/null +++ b/agc_2-X/trunk/agi/cm.agi @@ -0,0 +1,289 @@ +#!/usr/bin/perl +# +# cm.agi version 2.4 +# +# Used by Call Menus to log digit presses if enabled in the settings. You should +# not need to manually use this script, it is used by the dialplan builder. +# +# You need to put lines similar to those below in your extensions.conf file: +# ; Below are the parameters needed for the script to be run properly +# ; 1. the in-group to take settings from +# ; 2. digit pressed +# ; +# ;inbound calls check calltime: +#exten => 1,1,AGI(cm.agi,INBOUND-----1) +#exten => 1,2,... +# +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 +# +# changes: +# 110525-2100 - First Build +# + +$script = 'cm.agi'; + +($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";} + +$now_date_epoch = time(); +$now_date = "$year-$mon-$mday $hour:$min:$sec"; + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) + {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) + {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} + if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) + {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +if (!$VARDB_port) {$VARDB_port='3306';} +if (!$AGILOGfile) {$AGILOGfile = "$PATHlogs/agiout.$year-$mon-$mday";} + +use DBI; +use Time::HiRes ('gettimeofday','usleep','sleep'); # necessary to have perl sleep command of less than one second +use Asterisk::AGI; +$AGI = new Asterisk::AGI; + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + 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';"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +if ($sthArows > 0) + { + $AGILOG = '0'; + @aryA = $sthA->fetchrow_array; + $DBagi_output = "$aryA[0]"; + if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';} + if ($DBagi_output =~ /FILE/) {$AGILOG = '2';} + if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';} + } +$sthA->finish(); + +############################################# +##### START QUEUEMETRICS LOGGING LOOKUP ##### +#$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;"; +#$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; +# $enable_queuemetrics_logging = $aryA[0]; +# $queuemetrics_server_ip = $aryA[1]; +# $queuemetrics_dbname = $aryA[2]; +# $queuemetrics_login= $aryA[3]; +# $queuemetrics_pass = $aryA[4]; +# $queuemetrics_log_id = $aryA[5]; +# $queuemetrics_eq_prepend = $aryA[6]; +# } +#$sthA->finish(); +##### END QUEUEMETRICS LOGGING LOOKUP ##### +########################################### + + +### begin parsing run-time options ### +if (length($ARGV[0])>1) + { + if ($AGILOG) {$agi_string = "Perl Environment Dump:"; &agi_output;} + $i=0; + while ($#ARGV >= $i) + { + $args = "$args $ARGV[$i]"; + if ($AGILOG) {$agi_string = "$i|$ARGV[$i]"; &agi_output;} + $i++; + } + + ### list of command-line array arguments: + @ARGV_vars = split(/-----/, $ARGV[0]); + + $channel_group = $ARGV_vars[0]; + $dtmf = $ARGV_vars[1]; + } + +$|=1; +while() + { + chomp; + last unless length($_); + if ($AGILOG) + { + if (/^agi_(\w+)\:\s+(.*)$/) + { + $AGI{$1} = $2; + } + } + + if (/^agi_context\:\s+(.*)$/) {$context = $1;} + if (/^agi_priority\:\s+(.*)$/) {$priority = $1;} + if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1; $uniqueid = $unique_id;} + if (/^agi_channel\:\s+(.*)$/) {$channel = $1;} + if (/^agi_extension\:\s+(.*)$/) {$extension = $1;} + if (/^agi_type\:\s+(.*)$/) {$type = $1;} + if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;} + if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;} + } + +$outboundIVR=0; +if ($calleridname =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) + { + $callerid = $calleridname; + $outboundIVR=1; + + $stmtA = "SELECT campaign_id,lead_id FROM vicidial_auto_calls where callerid='$callerid';"; + $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; + $campaign_id = $aryA[0]; + $lead_id = $aryA[1]; + } + $sthA->finish(); + } +else + { + if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) + { + $calleridname = $callerid; + $calleridname =~ s/\<\d\d\d\d\d\d\d\d\d\d\>//gi; + $calleridname =~ s/\"|\" //gi; + } + + $callerid =~ s/\D|\'//gi; + $calleridname =~ s/unknown|\'//gi; + if ( (!$callerid) or ($callerid =~ /unknown/) ) + {$callerid = $calleridname;} + + + if (length($callerid)>0) {$phone_number = $callerid;} + else {$phone_number = '';} + if (length($calleridname)>0) {$VLcomments = $calleridname;} + else {$VLcomments = '';} + } + +if (length($callerid)<8) {$callerid = $parked_by;} +if (length($pin)>0) {$callerid = $pin;} + + +foreach $i (sort keys %AGI) + { + if ($AGILOG) {$agi_string = " -- $i = $AGI{$i}"; &agi_output;} + } + +if ($AGILOG) {$agi_string = "AGI Variables: |$unique_id|$channel|$extension|$type|$callerid|"; &agi_output;} + + +if (length($pin) < 1) {$pin=$inbound_number;} + +$fronter = $pin; + +if ($AGILOG) {$agi_string = "+++++ DTMF LOG STARTED : |$channel_group|$callerid-$pin|$now_date"; &agi_output;} + +$VDADphone=''; +$VDADphone_code=''; + +if ($channel =~ /Local/i) + { + if ($AGILOG) {$agi_string = "+++++ VDAD START LOCAL CHANNEL: EXITING- $priority"; &agi_output;} + exit; + } + +### insert an IVR record to the vicidial_auto_calls table +if ($outboundIVR > 0) + { + $stmtA = "INSERT INTO vicidial_outbound_ivr_log (uniqueid,caller_code,event_date,campaign_id,lead_id,menu_id,menu_action) values('$uniqueid','$callerid','$now_date','$campaign_id','$lead_id','$context>$dtmf','$dtmf')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VOIL insert: |$affected_rowsL|$uniqueid|$callerid|$campaign_id|$lead_id|$context|"; &agi_output;} + } +else + { + $stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,phone_ext,start_time,comment_a,comment_b,comment_d,comment_e) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$phone_number','$now_date','$channel_group','$dtmf','$context>$dtmf','$priority')"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rowsL = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- LIL insert: |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;} + } + +### QueueMetrics logging if enabled +#if ($enable_queuemetrics_logging > 0) +# { +# $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") +# or die "Couldn't connect to database: " . DBI->errstr; +# +# if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} +# +# if ($outboundIVR > 0) +# {$uniqueid = $caller_id;} +# +# $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';"; +# if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;} +# $Baffected_rows = $dbhB->do($stmtB); +# $dbhB->disconnect(); +# } + + +$sthA->finish(); +$dbhA->disconnect(); + +exit; + + + + + +sub agi_output + { + if ($AGILOG >=2) + { + ### open the log file for writing ### + open(Lout, ">>$AGILOGfile") + || die "Can't open $AGILOGfile: $!\n"; + print Lout "$now_date|$script|$agi_string\n"; + close(Lout); + } + ### send to STDERR writing ### + if ( ($AGILOG == '1') || ($AGILOG == '3') ) + {print STDERR "$now_date|$script|$agi_string\n";} + $agi_string=''; + } diff --git a/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl b/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl index d6098cd8..946cddc9 100644 --- a/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl +++ b/agc_2-X/trunk/bin/ADMIN_archive_log_tables.pl @@ -30,6 +30,7 @@ # 100328-1008 - Added --months CLI option # 110218-1200 - Added notes and search log archiving # 110430-1442 - Added queue-log and closer-log options, changed quiet to --quiet flag +# 110525-1040 - Added vicidial_outbound_ivr_log archiving # ### begin parsing run-time options ### @@ -630,6 +631,57 @@ if (!$T) } + + ##### vicidial_outbound_ivr_log + $stmtA = "SELECT count(*) from vicidial_outbound_ivr_log;"; + $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; + $vicidial_outbound_ivr_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_outbound_ivr_log_archive;"; + $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; + $vicidial_outbound_ivr_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_outbound_ivr_log table... ($vicidial_outbound_ivr_log_count|$vicidial_outbound_ivr_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_outbound_ivr_log_archive SELECT * from vicidial_outbound_ivr_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows inserted into vicidial_outbound_ivr_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_outbound_ivr_log WHERE event_date < '$del_time';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows deleted from vicidial_outbound_ivr_log table \n";} + + $stmtA = "optimize table vicidial_outbound_ivr_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table vicidial_outbound_ivr_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + #$dbhA->disconnect(); #print "$del_time\n\n"; diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index dd8d9f0d..dbb3460f 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -60,6 +60,7 @@ # 101107-2257 - Added cross-server phone dialplan extensions # 101214-1507 - Changed list auto-reset to work with inactive lists # 110512-2112 - Added vicidial_campaign_stats_debug to table cleaning +# 110525-2334 - Added cm.agi optional logging to call menus # $DB=0; # Debug flag @@ -1631,7 +1632,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r ##### BEGIN Generate the Call Menu entries ##### - $stmtA = "SELECT menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group FROM vicidial_call_menu order by menu_id;"; + $stmtA = "SELECT menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log FROM vicidial_call_menu order by menu_id;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1640,18 +1641,19 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArows > $i) { @aryA = $sthA->fetchrow_array; - $menu_id[$i] = "$aryA[0]"; - $menu_name[$i] = "$aryA[1]"; - $menu_prompt[$i] = "$aryA[2]"; - $menu_timeout[$i] = "$aryA[3]"; - $menu_timeout_prompt[$i] = "$aryA[4]"; - $menu_invalid_prompt[$i] = "$aryA[5]"; - $menu_repeat[$i] = "$aryA[6]"; - $menu_time_check[$i] = "$aryA[7]"; - $call_time_id[$i] = "$aryA[8]"; - $track_in_vdac[$i] = "$aryA[9]"; - $custom_dialplan_entry[$i]= "$aryA[10]"; - $tracking_group[$i] = "$aryA[11]"; + $menu_id[$i] = $aryA[0]; + $menu_name[$i] = $aryA[1]; + $menu_prompt[$i] = $aryA[2]; + $menu_timeout[$i] = $aryA[3]; + $menu_timeout_prompt[$i] = $aryA[4]; + $menu_invalid_prompt[$i] = $aryA[5]; + $menu_repeat[$i] = $aryA[6]; + $menu_time_check[$i] = $aryA[7]; + $call_time_id[$i] = $aryA[8]; + $track_in_vdac[$i] = $aryA[9]; + $custom_dialplan_entry[$i]= $aryA[10]; + $tracking_group[$i] = $aryA[11]; + $dtmf_log[$i] = $aryA[12]; if ($track_in_vdac[$i] > 0) {$track_in_vdac[$i] = 'YES'} @@ -1683,11 +1685,11 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r while ($sthArowsJ > $j) { @aryA = $sthA->fetchrow_array; - $option_value[$j] = "$aryA[0]"; - $option_description[$j] = "$aryA[1]"; - $option_route[$j] = "$aryA[2]"; - $option_route_value[$j] = "$aryA[3]"; - $option_route_value_context[$j] = "$aryA[4]"; + $option_value[$j] = $aryA[0]; + $option_description[$j] = $aryA[1]; + $option_route[$j] = $aryA[2]; + $option_route_value[$j] = $aryA[3]; + $option_route_value_context[$j] = $aryA[4]; if ($option_value[$j] =~ /STAR/) {$option_value[$j] = '*';} if ($option_value[$j] =~ /HASH/) {$option_value[$j] = '#';} $j++; @@ -1787,14 +1789,20 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r } if ($option_route[$j] =~ /AGI/) { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,AGI($option_route_value[$j])\n"; } if ($option_route[$j] =~ /CALLMENU/) { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,Goto($option_route_value[$j],s,1)\n"; } if ($option_route[$j] =~ /DID/) { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,Goto(trunkinbound,$option_route_value[$j],1)\n"; } if ($option_route[$j] =~ /INGROUP/) @@ -1810,15 +1818,21 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r $IGvid_confirm_filename = $IGoption_route_value_context[7]; $IGvid_validate_digits = $IGoption_route_value_context[8]; + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,AGI(agi-VDAD_ALL_inbound.agi,$IGhandle_method-----$IGsearch_method-----$option_route_value[$j]-----$menu_id[$i]--------------------$IGlist_id-----$IGphone_code-----$IGcampaign_id---------------$IGvid_enter_filename-----$IGvid_id_number_filename-----$IGvid_confirm_filename-----$IGvid_validate_digits)\n"; } if ($option_route[$j] =~ /EXTENSION/) { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} if (length($option_route_value_context[$j])>0) {$option_route_value_context[$j] = "$option_route_value_context[$j],";} $call_menu_line .= "exten => $option_value[$j],$PRI,Goto($option_route_value_context[$j]$option_route_value[$j],1)\n"; } if ($option_route[$j] =~ /VOICEMAIL/) { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,Goto(default,85026666666666$option_route_value[$j],1)\n"; } if ($option_route[$j] =~ /HANGUP/) @@ -1847,10 +1861,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r } $call_menu_line .= "$hangup_prompt_ext"; + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],n,Hangup\n"; } else { + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,Hangup\n"; } } @@ -1877,6 +1895,8 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r $d = leading_zero($4); $DIALstring = "$a$S$b$S$c$S$d$S"; } + if ($dtmf_log[$i] > 0) + {$call_menu_line .= "exten => $option_value[$j],$PRI,AGI(cm.agi,$tracking_group[$i]-----$option_value[$j])\n"; $PRI++;} $call_menu_line .= "exten => $option_value[$j],$PRI,Goto(default,$DIALstring$Pdialplan,1)\n"; } $sthA->finish(); diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index c45a6a65..fdad2895 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -100,6 +100,7 @@ # 110224-1859 - Added compatibility with QM phone environment logging # 110303-1710 - Added clearing of ring_callerid when vicidial_auto_calls deleted # 110513-1745 - Added double-check for dial level difference target, and dial level and avail-only-tally features +# 110525-1940 - Allow for auto-dial IVR transfers # @@ -1358,7 +1359,7 @@ while($one_day_interval > 0) if ( ( ($dialtime_log >= $call_timeout) || ($dialtime_catch >= $call_timeout) || ($CLstatus =~ /BUSY|DISCONNECT|XFER|CLOSER/) ) && ($PARKchannel < 1) ) { - if ($CLcall_type !~ /IN/) + if ( ($CLcall_type !~ /IN/) && ($CLstatus !~ /IVR/) ) { if ($CLstatus !~ /XFER|CLOSER/) { diff --git a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt index 8d01e8bc..078f7c8c 100644 --- a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt +++ b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt @@ -57,3 +57,4 @@ ALTNUM - Agent manual Dial Alternate number dialing, number dialed before final DISPO - Agent in disposition screen when they closed their web browser wiithout selecting dispisition WAITTO - Wait time option call termination on inbound call PDROP - Pre-routing dropped call, call hung up the instant the Answer signal is received +IVRXFR - Outbound drop to Call Menu diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index da2e8224..ca9bef7e 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -656,7 +656,7 @@ alt_number_dialing ENUM('Y','N') default 'N', scheduled_callbacks ENUM('Y','N') default 'N', lead_filter_id VARCHAR(10) default 'NONE', drop_call_seconds TINYINT(3) default '5', -drop_action ENUM('HANGUP','MESSAGE','VOICEMAIL','IN_GROUP') default 'MESSAGE', +drop_action ENUM('HANGUP','MESSAGE','VOICEMAIL','IN_GROUP','AUDIO','CALLMENU') default 'AUDIO', safe_harbor_exten VARCHAR(20) default '8307', display_dialable_count ENUM('Y','N') default 'Y', wrapup_seconds SMALLINT(3) UNSIGNED default '0', @@ -805,7 +805,9 @@ custom_3way_button_transfer VARCHAR(30) default 'DISABLED', available_only_tally_threshold ENUM('DISABLED','LOGGED-IN_AGENTS','NON-PAUSED_AGENTS','WAITING_AGENTS') default 'DISABLED', available_only_tally_threshold_agents SMALLINT(5) UNSIGNED default '0', dial_level_threshold ENUM('DISABLED','LOGGED-IN_AGENTS','NON-PAUSED_AGENTS','WAITING_AGENTS') default 'DISABLED', -dial_level_threshold_agents SMALLINT(5) UNSIGNED default '0' +dial_level_threshold_agents SMALLINT(5) UNSIGNED default '0', +safe_harbor_audio VARCHAR(100) default 'buzz', +safe_harbor_menu_id VARCHAR(50) default '' ); CREATE TABLE vicidial_lists ( @@ -1817,7 +1819,8 @@ menu_time_check ENUM('0','1') default '0', call_time_id VARCHAR(20) default '', track_in_vdac ENUM('0','1') default '1', custom_dialplan_entry TEXT, -tracking_group VARCHAR(20) default 'CALLMENU' +tracking_group VARCHAR(20) default 'CALLMENU', +dtmf_log ENUM('0','1') default '0' ); CREATE TABLE vicidial_call_menu_options ( @@ -2325,6 +2328,19 @@ index (campaign_id), unique index campserver (campaign_id, server_ip) ); +CREATE TABLE vicidial_outbound_ivr_log ( +uniqueid VARCHAR(50) NOT NULL, +caller_code VARCHAR(30) NOT NULL, +event_date DATETIME, +campaign_id VARCHAR(20) default '', +lead_id INT(9) UNSIGNED, +menu_id VARCHAR(50) default '', +menu_action VARCHAR(50) default '', +index (event_date), +index (lead_id), +index (campaign_id), +unique index campserver (event_date, lead_id, menu_id) +); ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2477,7 +2493,9 @@ ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNE CREATE TABLE vicidial_closer_log_archive LIKE vicidial_closer_log; ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT NULL; -UPDATE system_settings SET db_schema_version='1275',db_schema_update_date=NOW(); +CREATE TABLE vicidial_outbound_ivr_log_archive LIKE vicidial_outbound_ivr_log; + +UPDATE system_settings SET db_schema_version='1276',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 4c8dd017..61854aeb 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -776,3 +776,28 @@ unique index campserver (campaign_id, server_ip) ); UPDATE system_settings SET db_schema_version='1275',db_schema_update_date=NOW(); + +ALTER TABLE vicidial_campaigns MODIFY drop_action ENUM('HANGUP','MESSAGE','VOICEMAIL','IN_GROUP','AUDIO','CALLMENU') default 'AUDIO'; +ALTER TABLE vicidial_campaigns ADD safe_harbor_audio VARCHAR(100) default 'buzz'; +ALTER TABLE vicidial_campaigns ADD safe_harbor_menu_id VARCHAR(50) default ''; + +CREATE TABLE vicidial_outbound_ivr_log ( +uniqueid VARCHAR(50) NOT NULL, +caller_code VARCHAR(30) NOT NULL, +event_date DATETIME, +campaign_id VARCHAR(20) default '', +lead_id INT(9) UNSIGNED, +menu_id VARCHAR(50) default '', +menu_action VARCHAR(50) default '', +index (event_date), +index (lead_id), +index (campaign_id), +unique index campserver (event_date, lead_id, menu_id) +); + +CREATE TABLE vicidial_outbound_ivr_log_archive LIKE vicidial_outbound_ivr_log; + +ALTER TABLE vicidial_call_menu ADD dtmf_log ENUM('0','1') default '0'; + +UPDATE system_settings SET db_schema_version='1276',db_schema_update_date=NOW() where db_schema_version < 1276; + diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 8a6ef373..7d48d1dd 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -581,6 +581,14 @@ Campaign Debug Page|| Bulk Phone Insert Page|| Send a Call With Custom CID Page|| Speech Voice Lab Page|| +Safe Harbor Audio|| +This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz|| +Safe Harbor Call Menu|| +This is the call menu that a call is sent to if the Drop Action is set to CALLMENU|| +Log Key Press|| +This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled|| +No DTMF Logging|| +DTMF Logging Enabled|| admin_campaign_multi_alt.php diff --git a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php index d427e005..3c8ceeda 100644 --- a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -16,6 +16,7 @@ # 100712-1324 - Added system setting slave server option # 100802-2347 - Added User Group Allowed Reports option validation # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 110525-1907 - Added support for outbound log analysis # require("dbconnect.php"); @@ -31,6 +32,8 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} +if (isset($_GET["type"])) {$type=$_GET["type"];} + elseif (isset($_POST["type"])) {$type=$_POST["type"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -42,8 +45,12 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +if (strlen($type)<2) {$type='inbound';} -$report_name = 'Inbound IVR Report'; +if ($type == 'inbound') + {$report_name = 'Inbound IVR Report';} +else + {$report_name = 'Outbound IVR Report';} $db_source = 'M'; ############################################# @@ -106,6 +113,16 @@ $row=mysql_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; $LOGallowed_reports = $row[1]; +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -121,11 +138,16 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +if ($type == 'inbound') + {$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;";} +else + {$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id $whereLOGallowed_campaignsSQL;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; +if ($type == 'inbound') + { $LISTgroups[$i]='CALLMENU'; $LISTgroups_names[$i]='IVR'; $i++; @@ -134,6 +156,7 @@ $i=0; $LISTgroups_names[$i]='Dynamic Application'; $i++; $groups_to_print++; + } while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); @@ -262,6 +285,7 @@ if ($DB > 0) echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "
\n"; echo "\n"; +echo "\n"; echo "Date Range:
\n"; echo "\n"; @@ -302,25 +326,51 @@ echo "  
\n"; -echo "Inbound Groups: \n"; -echo "\n"; -echo "\n"; + echo "\n"; + echo "\n"; + echo "           "; + echo "MODIFY | "; + echo "REPORTS | "; + echo "CLOSER REPORT \n"; + echo "\n"; + } +else + { + echo "Campaigns: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "           "; + echo "MODIFY | "; + echo "REPORTS | "; + echo "OUTBOUND REPORT \n"; + echo "\n"; } -echo "\n"; -echo "\n"; -echo "           "; -echo "MODIFY | "; -echo "REPORTS | "; -echo "CLOSER REPORT \n"; -echo "\n"; echo "
\n"; @@ -383,7 +433,14 @@ else $totFLOWtotal_time=0; ##### Grab all records for the IVR for the specified time period - $stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;"; + if ($type == 'inbound') + { + $stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;"; + } + else + { + $stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;"; + } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $logs_to_print = mysql_num_rows($rslt); @@ -538,21 +595,24 @@ else $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - ##### Grab all records for the IVR for the specified time period - $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $vcl_statuses_to_print = mysql_num_rows($rslt); - $w=0; - while ($w < $vcl_statuses_to_print) + if ($type == 'inbound') { - $row=mysql_fetch_row($rslt); - $vcl_statuses[$w] = $row[0]; - if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) - {$FLOWdrop[$s]++;} - $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); - $FLOWtotal[$s]++; - $w++; + ##### Grab all records for the IVR for the specified time period + $stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) + {$FLOWdrop[$s]++;} + $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); + $FLOWtotal[$s]++; + $w++; + } } if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) { @@ -621,7 +681,14 @@ else $h=0; while ($i <= 96) { - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:00:00' and event_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -631,7 +698,14 @@ else $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:15:00' and event_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -640,7 +714,14 @@ else if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:30:00' and event_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -649,7 +730,14 @@ else if ($hour_count[$i] > 0) {$last_full_record = $i;} $i++; - $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + if ($type == 'inbound') + { + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';"; + } + else + { + $stmt="select count(*) from vicidial_outbound_ivr_log where event_date >= '$query_date $h:45:00' and event_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and menu_action='';"; + } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 24d37782..1b751b19 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -95,9 +95,9 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; $QUERY_STRING = getenv("QUERY_STRING"); -$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List'; +$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List'; -$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Custom Reports Links, CallCard Search'; +$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Custom Reports Links, CallCard Search'; ###################################################################################################### ###################################################################################################### @@ -1544,6 +1544,12 @@ if (isset($_GET["dial_level_threshold_agents"])) {$dial_level_threshold_agents elseif (isset($_POST["dial_level_threshold_agents"])) {$dial_level_threshold_agents=$_POST["dial_level_threshold_agents"];} if (isset($_GET["time_zone_setting"])) {$time_zone_setting=$_GET["time_zone_setting"];} elseif (isset($_POST["time_zone_setting"])) {$time_zone_setting=$_POST["time_zone_setting"];} +if (isset($_GET["safe_harbor_audio"])) {$safe_harbor_audio=$_GET["safe_harbor_audio"];} + elseif (isset($_POST["safe_harbor_audio"])) {$safe_harbor_audio=$_POST["safe_harbor_audio"];} +if (isset($_GET["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_GET["safe_harbor_menu_id"];} + elseif (isset($_POST["safe_harbor_menu_id"])) {$safe_harbor_menu_id=$_POST["safe_harbor_menu_id"];} +if (isset($_GET["dtmf_log"])) {$dtmf_log=$_GET["dtmf_log"];} + elseif (isset($_POST["dtmf_log"])) {$dtmf_log=$_POST["dtmf_log"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1783,6 +1789,7 @@ if ($non_latin < 1) $reload_dialplan_on_servers = ereg_replace("[^0-9]","",$reload_dialplan_on_servers); $available_only_tally_threshold_agents = ereg_replace("[^0-9]","",$available_only_tally_threshold_agents); $dial_level_threshold_agents = ereg_replace("[^0-9]","",$dial_level_threshold_agents); + $dtmf_log = ereg_replace("[^0-9]","",$dtmf_log); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -2144,6 +2151,7 @@ if ($non_latin < 1) $available_only_tally_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$available_only_tally_threshold_agents); $dial_level_threshold_agents = ereg_replace("[^-_0-9a-zA-Z]","",$dial_level_threshold_agents); $time_zone_setting = ereg_replace("[^-_0-9a-zA-Z]","",$time_zone_setting); + $safe_harbor_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$safe_harbor_menu_id); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -2175,6 +2183,7 @@ if ($non_latin < 1) $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); $queuemetrics_phone_environment = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$queuemetrics_phone_environment); $active_twin_server_ip = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$active_twin_server_ip); + $safe_harbor_audio = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -2710,12 +2719,13 @@ else # 110506-1537 - Added custom_3way_button_transfer campaign option # 110514-1351 - Added dial level and available only tally threshold campaign settings, and time zone list setting # 110524-1401 - Small help text fix, issue #486 +# 110525-2109 - Added safe_harbor_audio, safe_harbor_menu_id campaign options and dtmf_log call menu option # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-312a'; -$build = '110524-1401'; +$admin_version = '2.4-313a'; +$build = '110525-2109'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -4436,6 +4446,16 @@ if ($ADD==99999)
Safe Harbor Exten - This is the dial plan extension that the desired Safe Harbor audio file is located at on your server. +
+ +
+ Safe Harbor Audio - This is the audio prompt file that is played if the Drop Action is set to AUDIO. Default is buzz. + +
+
+
+ Safe Harbor Call Menu - This is the call menu that a call is sent to if the Drop Action is set to CALLMENU. +

@@ -5821,6 +5841,11 @@ if ($ADD==99999)
Tracking Group - This is the ID that you can use to track calls to this Call Menu when looking at the IVR Report. The list includes CALLMENU as the default as well as all of the In-Groups. +
+
+
+ Log Key Press - This option if enabled will log the DTMF key press by the caller in this Call Menu. Default is 0 for disabled. +

@@ -10459,7 +10484,7 @@ if ($ADD==20) { echo "
CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -11216,7 +11241,7 @@ if ($ADD==2611) } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log from vicidial_call_menu where menu_id=\"$source_menu\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; @@ -13225,6 +13250,8 @@ if ($ADD==41) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $survey_camp_record_dir = '/home/survey'; $survey_dtmf_digits = '1238'; $survey_first_audio_file = 'US_pol_survey_hello'; @@ -13325,7 +13352,7 @@ if ($ADD==41) if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) {$hopper_level='100';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -13510,6 +13537,8 @@ if ($ADD==44) $no_hopper_leads_logins = 'Y'; $queue_priority = '50'; $safe_harbor_exten = '8300'; + $safe_harbor_audio = 'buzz'; + $safe_harbor_menu_id = ''; $voicemail_ext = ''; } if (ereg('list_activation',$stage)) @@ -14337,7 +14366,7 @@ if ($ADD==4511) { echo "
CALL MENU MODIFIED: $menu_id\n"; - $stmt="UPDATE vicidial_call_menu set menu_name='$menu_name',menu_prompt='$menu_prompt',menu_timeout='$menu_timeout',menu_timeout_prompt='$menu_timeout_prompt',menu_invalid_prompt='$menu_invalid_prompt',menu_repeat='$menu_repeat',menu_time_check='$menu_time_check',call_time_id='$call_time_id',track_in_vdac='$track_in_vdac',custom_dialplan_entry='$custom_dialplan_entry',tracking_group='$tracking_group' where menu_id='$menu_id';"; + $stmt="UPDATE vicidial_call_menu set menu_name='$menu_name',menu_prompt='$menu_prompt',menu_timeout='$menu_timeout',menu_timeout_prompt='$menu_timeout_prompt',menu_invalid_prompt='$menu_invalid_prompt',menu_repeat='$menu_repeat',menu_time_check='$menu_time_check',call_time_id='$call_time_id',track_in_vdac='$track_in_vdac',custom_dialplan_entry='$custom_dialplan_entry',tracking_group='$tracking_group',dtmf_log='$dtmf_log' where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $h=0; @@ -18478,7 +18507,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; @@ -18663,6 +18692,8 @@ if ($ADD==31) $available_only_tally_threshold_agents = $row[183]; $dial_level_threshold = $row[184]; $dial_level_threshold_agents = $row[185]; + $safe_harbor_audio = $row[186]; + $safe_harbor_menu_id = $row[187]; if (ereg("DISABLED",$list_order_mix)) @@ -19437,11 +19468,15 @@ if ($ADD==31) { echo "
Drop Call Seconds: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Drop Action: $NWB#vicidial_campaigns-drop_action$NWE
Drop Action: $NWB#vicidial_campaigns-drop_action$NWE
Safe Harbor Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Voicemail: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
Safe Harbor Audio: audio chooser $NWB#vicidial_campaigns-safe_harbor_audio$NWE
Safe Harbor Call Menu: $NWB#vicidial_campaigns-safe_harbor_menu_id$NWE
Voicemail: voicemail chooser$NWB#vicidial_campaigns-voicemail_ext$NWE
Drop Transfer Group: \n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -28877,6 +28924,8 @@ if ($ADD==999999) {echo "
  • Outbound Calling Report\n";} if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Outbound Summary Interval Report\n";} + if ( (preg_match("/Outbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + {echo "
  • Outbound IVR Report\n";} if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) {echo "
  • Fronter - Closer Report\n";} if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 711612f2..0703a900 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -622,21 +622,21 @@ if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) ) } +$stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id limit 10000;"; +$rslt=mysql_query($stmt, $link); +$menus_to_print = mysql_num_rows($rslt); +$call_menu_list=''; +$i=0; +while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $call_menu_list .= ""; + $i++; + } + ### select list contents generation for dynamic route displays in call menu and in-group screens if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) ) { - $stmt="select menu_id,menu_name from vicidial_call_menu order by menu_id;"; - $rslt=mysql_query($stmt, $link); - $menus_to_print = mysql_num_rows($rslt); - $call_menu_list=''; - $i=0; - while ($i < $menus_to_print) - { - $row=mysql_fetch_row($rslt); - $call_menu_list .= ""; - $i++; - } - $stmt="select did_pattern,did_description,did_route from vicidial_inbound_dids where did_active='Y' order by did_pattern;"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php index 5b97561e..0ca5a916 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -43,6 +43,7 @@ # 110212-2041 - Added compatibility with definable scheduled callback statuses # 110215-1411 - Added display of call notes to log records # 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality +# 110525-1827 - Added ivr log records display # require("dbconnect.php"); @@ -1145,6 +1146,37 @@ else echo "

    \n"; + echo "IVR LOGS FOR THIS LEAD:\n"; + echo "
  • \n"; echo ""; - $stmt="SELECT menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id='$menu_id';"; + $stmt="SELECT menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group,dtmf_log from vicidial_call_menu where menu_id='$menu_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $menu_name = $row[0]; @@ -23697,6 +23732,7 @@ if ($ADD==3511) $track_in_vdac = $row[8]; $custom_dialplan_entry= $row[9]; $tracking_group = $row[10]; + $dtmf_log = $row[11]; echo "
    MODIFY A CALL MENU RECORD: $menu_id\n"; @@ -23741,6 +23777,17 @@ if ($ADD==3511) echo "\n"; echo "$NWB#vicidial_call_menu-tracking_group$NWE
    Log Key Press: $NWB#vicidial_call_menu-dtmf_log$NWE
    Call Menu Options:
    \n"; + echo "\n"; + + $stmt="select campaign_id,event_date,menu_id,menu_action from vicidial_outbound_ivr_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid,event_date,menu_action desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    # CAMPAIGNDATE/TIME CALL MENU   ACTION
    $u $row[0] $row[1] $row[2] $row[3]  


    \n"; + + echo "RECORDINGS FOR THIS LEAD:\n"; echo "\n"; echo "\n"; @@ -1214,7 +1246,6 @@ else } - echo "
    # LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR


    \n";