diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index fa64083e..d2f33285 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -103,6 +103,11 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 19. Several code changes for better UTF8 compatibility with the database as well as special character leads in the agent screen, lead loading +20. Added after hours redirect of calls to an in-group to another in-group + +21. Added collection of hangup reasons for inbound and outbound calls in the + vicidial_log and vicidial_closer_log tables + 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 5dc6ba1a..76302e2e 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -58,6 +58,8 @@ # 80227-0335 - added queue priority functionality # 80302-0232 - added drop_action and transfer to in-group # 80402-0142 - added code for manual dial transfer duplicate check +# 80430-1144 - added term_reason to vicidial_closer_log, QUEUETIMEOUT, AFTERHOURS +# 80501-0515 - added after hours transfer in-group # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -367,7 +369,7 @@ $sthA->finish(); ### Grab inbound groups values from the database $cbc=0; -$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group FROM vicidial_inbound_groups where group_id = '$channel_group';"; +$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group,afterhours_xfer_group FROM vicidial_inbound_groups where group_id = '$channel_group';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -395,6 +397,7 @@ while ($sthArows > $cbc) $VDADvoicemail_ext =~ s/\D//gi; $queue_priority = "$aryA[16]"; $drop_inbound_group = "$aryA[17]"; + $afterhours_xfer_group = "$aryA[18]"; $cbc++; } $sthA->finish(); @@ -553,7 +556,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) { $VHqueryCID = "VA$CIDdate$hour$min$sec$sec"; - if ($after_hours_action =~ /EXTENSION|VOICEMAIL/) + if ($after_hours_action =~ /EXTENSION|VOICEMAIL|IN_GROUP/) { if ($after_hours_action =~ /EXTENSION/) { @@ -563,6 +566,11 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) { $DROPexten = "$voicemail_dump_exten$after_hours_voicemail"; } + if ($after_hours_action =~ /IN_GROUP/) + { # 90009*CL_uk3survy_*8301*10000123*universal*7275551212*1234*" + $S='*'; + $DROPexten = "90009*$afterhours_xfer_group$S$S$insert_lead_id$S$S$phone_number$S$fronter$S"; + } if (length($DROPexten)>0) { ### if DROP extension is defined then send the dropped call there instead of hangup @@ -583,7 +591,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;} - $stmtA = "INSERT INTO vicidial_closer_log set status='DROP',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='AFTER HOURS DROP';"; + $stmtA = "INSERT INTO vicidial_closer_log set status='DROP',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='AFTER HOURS DROP',term_reason='AFTERHOURS';"; $affected_rows = $dbhA->do($stmtA); $stmtB = "select LAST_INSERT_ID() LIMIT 1;"; $sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr; @@ -1433,7 +1441,7 @@ if ($AGILOG) {$agi_string = "-- VDCL DROP: |$drop_action|$DROPexten|"; &agi $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;} - $stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds' where lead_id = '$insert_lead_id' order by start_epoch desc limit 1;"; + $stmtA = "UPDATE vicidial_closer_log set status='DROP',end_epoch='$now_date_epoch',length_in_sec='$drop_seconds',queue_seconds='$drop_seconds',term_reason='QUEUETIMEOUT' where lead_id = '$insert_lead_id' order by start_epoch desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL vcl update: |$affected_rows|$insert_lead_id|\n|$stmtA|"; &agi_output;} 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 84214e6a..12d5af94 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -33,6 +33,7 @@ # changes: # 80218-2027 - First Build # 80302-0232 - added drop_action and transfer to in-group +# 80430-1144 - added term_reason to vicidial_log, QUEUETIMEOUT # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -900,7 +901,7 @@ if ($drop_action =~ /IN_GROUP/) $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' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";"; + $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); if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$affected_rows|$uniqueid"; &agi_output;} diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index a82cd683..b3e2fd3f 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -34,6 +34,7 @@ # 70808-1425 - Moved VD_hangup section to the call_log end stage to improve efficiency # 71030-2039 - Added priority to hopper insertions # 80224-0040 - Fixed bugs in vicidial_log updates +# 80430-0907 - Added term_reason to vicidial_log and vicidial_closer_log # @@ -695,7 +696,7 @@ sub process_request { ########## FIND AND UPDATE vicidial_log ########## $Euniqueid=$uniqueid; $Euniqueid =~ s/\.\d+$//gi; - $stmtA = "SELECT start_epoch,status FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;"; + $stmtA = "SELECT start_epoch,status,user,term_reason FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -705,8 +706,10 @@ sub process_request { while ($sthArows > $epc_countCUSTDATA) { @aryA = $sthA->fetchrow_array; - $VD_start_epoch = "$aryA[0]"; - $VD_status = "$aryA[1]"; + $VD_start_epoch = "$aryA[0]"; + $VD_status = "$aryA[1]"; + $VD_user = "$aryA[2]"; + $VD_term_reason = "$aryA[3]"; $epc_countCUSTDATA++; } $sthA->finish(); @@ -727,7 +730,7 @@ sub process_request { if ($Rsec < 10) {$Rsec = "0$Rsec";} $RSQLdate = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec"; - $stmtA = "SELECT start_epoch,status,closecallid FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;"; + $stmtA = "SELECT start_epoch,status,closecallid,user,term_reason FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -737,9 +740,11 @@ sub process_request { while ($sthArows > $epc_countCUSTDATA) { @aryA = $sthA->fetchrow_array; - $VD_start_epoch = "$aryA[0]"; - $VD_status = "$aryA[1]"; - $VD_closecallid = "$aryA[2]"; + $VD_start_epoch = "$aryA[0]"; + $VD_status = "$aryA[1]"; + $VD_closecallid = "$aryA[2]"; + $VD_user = "$aryA[3]"; + $VD_term_reason = "$aryA[4]"; $epc_countCUSTDATA++; } $sthA->finish(); @@ -755,7 +760,11 @@ sub process_request { $SQL_status=''; if ($VD_status =~ /^NA$|^NEW$|^QUEUE$|^XFER$/) { - $SQL_status = "status='DROP',"; + if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) ) + {$term_reason = 'ABANDON';} + else + {$term_reason = 'CALLER';} + $SQL_status = "status='DROP',term_reason='$term_reason',"; ########## FIND AND UPDATE vicidial_list ########## $stmtA = "UPDATE vicidial_list set status='DROP' where lead_id = '$VD_lead_id';"; @@ -763,11 +772,15 @@ sub process_request { $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$VD_lead_id"; &agi_output;} } + else + { + $SQL_status = "term_reason='CALLER',"; + } $stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set $SQL_status end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\";"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} - $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$affected_rows|$uniqueid|$VD_status|"; &agi_output;} + $VLaffected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDAD vicidial_log update: |$VLaffected_rows|$uniqueid|$VD_status|"; &agi_output;} @@ -780,9 +793,16 @@ sub process_request { else { if ($VD_status =~ /^DONE$|^INCALL$|^XFER$/) - {$VDCLSQL_status = "";} + {$VDCLSQL_status = "term_reason='CALLER',";} else - {$VDCLSQL_status = "status='DROP',queue_seconds='$VD_seconds',";} + { + if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) ) + {$term_reason = 'ABANDON';} + else + {$term_reason = 'CALLER';} + + $VDCLSQL_status = "status='DROP',queue_seconds='$VD_seconds',term_reason='$term_reason',"; + } $VD_seconds = ($now_date_epoch - $VD_start_epoch); $stmtA = "UPDATE vicidial_closer_log set $VDCLSQL_status end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where closecallid = '$VD_closecallid';"; 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 168638b6..238990db 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -358,6 +358,7 @@ user VARCHAR(20), comments VARCHAR(255), processed ENUM('Y','N'), user_group VARCHAR(20), +term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE', index (lead_id), index (call_date) ); @@ -380,6 +381,7 @@ processed ENUM('Y','N'), queue_seconds DECIMAL(7,2) default '0', user_group VARCHAR(20), xfercallid INT(9) UNSIGNED, +term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE', index (lead_id), index (call_date) ); @@ -628,7 +630,7 @@ drop_call_seconds SMALLINT(4) unsigned default '360', drop_action ENUM('HANGUP','MESSAGE','VOICEMAIL','IN_GROUP') default 'MESSAGE', drop_exten VARCHAR(20) default '8307', call_time_id VARCHAR(20) default '24hours', -after_hours_action ENUM('HANGUP','MESSAGE','EXTENSION','VOICEMAIL') default 'MESSAGE', +after_hours_action ENUM('HANGUP','MESSAGE','EXTENSION','VOICEMAIL','IN_GROUP') default 'MESSAGE', after_hours_message_filename VARCHAR(50) default 'vm-goodbye', after_hours_exten VARCHAR(20) default '8300', after_hours_voicemail VARCHAR(20), @@ -642,7 +644,8 @@ default_xfer_group VARCHAR(20) default '---NONE---', queue_priority TINYINT(2) default '0', drop_inbound_group VARCHAR(20) default '---NONE---', ingroup_recording_override ENUM('DISABLED','NEVER','ONDEMAND','ALLCALLS','ALLFORCE') default 'DISABLED', -ingroup_rec_filename VARCHAR(50) default 'NONE' +ingroup_rec_filename VARCHAR(50) default 'NONE', +afterhours_xfer_group VARCHAR(20) default '---NONE---' ); CREATE TABLE vicidial_stations ( @@ -1045,6 +1048,20 @@ code VARCHAR(8) PRIMARY KEY NOT NULL, code_name VARCHAR(30) ); + CREATE TABLE vicidial_agent_sph ( +campaign_group_id VARCHAR(20) NOT NULL, +stat_date DATE NOT NULL, +shift VARCHAR(20) NOT NULL, +role ENUM('FRONTER','CLOSER') default 'FRONTER', +user VARCHAR(20) NOT NULL, +calls MEDIUMINT(8) UNSIGNED default '0', +sales MEDIUMINT(8) UNSIGNED default '0', +login_sec MEDIUMINT(8) UNSIGNED default '0', +login_hours DECIMAL(5,2) DEFAULT '0.00', +sph DECIMAL(6,2) DEFAULT '0.00', +index (campaign_group_id), +index (stat_date) +); ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP; @@ -1092,4 +1109,4 @@ INSERT INTO vicidial_state_call_times SET state_call_time_id='utah',state_call_t INSERT INTO vicidial_state_call_times SET state_call_time_id='washington',state_call_time_state='WA',state_call_time_name='Washington 8am',sct_default_start='800',sct_default_stop='2100'; INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_call_time_state='WY',state_call_time_name='Wyoming 8am-8pm',sct_default_start='800',sct_default_stop='2000'; -UPDATE system_settings SET db_schema_version='1081'; +UPDATE system_settings SET db_schema_version='1082'; diff --git a/agc_2-X/trunk/extras/upgrade_2.0.5.sql b/agc_2-X/trunk/extras/upgrade_2.0.5.sql index 1e550aa7..358b28a9 100644 --- a/agc_2-X/trunk/extras/upgrade_2.0.5.sql +++ b/agc_2-X/trunk/extras/upgrade_2.0.5.sql @@ -103,3 +103,26 @@ code_name VARCHAR(30) ); UPDATE system_settings SET db_schema_version='1081'; + + CREATE TABLE vicidial_agent_sph ( +campaign_group_id VARCHAR(20) NOT NULL, +stat_date DATE NOT NULL, +shift VARCHAR(20) NOT NULL, +role ENUM('FRONTER','CLOSER') default 'FRONTER', +user VARCHAR(20) NOT NULL, +calls MEDIUMINT(8) UNSIGNED default '0', +sales MEDIUMINT(8) UNSIGNED default '0', +login_sec MEDIUMINT(8) UNSIGNED default '0', +login_hours DECIMAL(5,2) DEFAULT '0.00', +sph DECIMAL(6,2) DEFAULT '0.00', +index (campaign_group_id), +index (stat_date) +); + +ALTER TABLE vicidial_log ADD term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE'; +ALTER TABLE vicidial_closer_log ADD term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE'; + +ALTER TABLE vicidial_inbound_groups MODIFY after_hours_action ENUM('HANGUP','MESSAGE','EXTENSION','VOICEMAIL','IN_GROUP') default 'MESSAGE'; +ALTER TABLE vicidial_inbound_groups ADD afterhours_xfer_group VARCHAR(20) default '---NONE---'; + +UPDATE system_settings SET db_schema_version='1082'; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index 7c863e30..d3ce66e0 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -74,6 +74,10 @@ there is already a qc status code in the system with this name:|| QC STATUS CODE ADDED: || code must be between 1 and 8 characters in length code name must be between 2 and 30 characters in length|| +CALL HANGUP REASON STATS|| +After Hours Action -<\/B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE|| +After Hours Transfer Group -<\/B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group|| +After Hours Transfer Group: || ############################################################ CLIENT diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index a51ed7ac..c66ae0cd 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -147,10 +147,12 @@ # 80317-2051 - Added in-group recording settings # 80402-0121 - Fixes for manual dial transfers on some systems, removed /n persist flag # 80424-0442 - Added non_latin lookup from system_settings +# 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log +# 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo # -$version = '2.0.5-71'; -$build = '80424-0442'; +$version = '2.0.5-73'; +$build = '80430-1957'; require("dbconnect.php"); @@ -1092,6 +1094,7 @@ if ($stage == "end") } else { + $term_reason='NONE'; if ($start_epoch < 1000) { $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; @@ -1102,12 +1105,12 @@ if ($stage == "end") if ($check_inbound > 0) { ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -1115,7 +1118,8 @@ if ($stage == "end") if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1126,14 +1130,15 @@ if ($stage == "end") if ( ($length_in_sec < 1) and ($check_inbound > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="SELECT start_epoch,term_reason FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysql_num_rows($rslt); if ($VM_mancall_ct > 0) { $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; + $start_epoch = $row[0]; + $VDterm_reason = $row[1]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -1144,12 +1149,12 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $closer_logged=0; if ($check_inbound > 0) { - $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); - - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by start_epoch desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1258,7 +1263,7 @@ if ($stage == "end") if ($enable_queuemetrics_logging > 0) { - ### check to see if lead should be alt_dialed + ### grab call lead information needed for QM logging $stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -1300,10 +1305,17 @@ if ($stage == "end") if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); $affected_rows = mysql_affected_rows($linkB); + + $term_reason='AGENT'; + } + else + { + $term_reason='CALLER'; } mysql_close($linkB); } + ### delete call record from vicidial_auto_calls $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} @@ -1311,7 +1323,7 @@ if ($stage == "end") - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1373,7 +1385,7 @@ if ($stage == "end") if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1396,8 +1408,31 @@ if ($stage == "end") if ($closer_logged < 1) { + $SQLterm = "term_reason='$term_reason',"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT',"; + } + } + ##### update the duration and end time in the vicidial_log table - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1411,6 +1446,37 @@ if ($stage == "end") echo "LOG NOT ENTERED\n\n"; } } + else + { + $SQLterm = "term_reason='$term_reason'"; + + if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) + { + ### check to see if lead should be alt_dialed + $stmt="SELECT term_reason from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + $VAC_qm_ct = mysql_num_rows($rslt); + if ($VAC_qm_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDterm_reason = $row[0]; + } + if (ereg("CALLER",$VDterm_reason)) + { + $SQLterm = ""; + } + else + { + $SQLterm = "term_reason='AGENT'"; + } + } + + ##### update the duration and end time in the vicidial_log table + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + } } echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; @@ -2113,6 +2179,11 @@ if ($ACTION == 'updateDISPO') } else { + ### update the comments in vicidial_live_agents record + $stmt = "UPDATE vicidial_live_agents set lead_id='' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -2335,7 +2406,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; + $stmt="UPDATE vicidial_live_agents set uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 62b7df6c..3a4358a5 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -6981,7 +6981,7 @@ RECORD ID:
Customer Information: Title: -  First:   MI:   Last: +  First:   MI:   Last: Address1: diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php index 2bb623e9..dbc510bc 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php @@ -10,7 +10,8 @@ # 60905-1326 - Added queue time stats # 71008-1436 - Added shift to be defined in dbconnect.php # 71025-0021 - Added status breakdown -# 71218-1155 - added end_date for multi-day reports +# 71218-1155 - Added end_date for multi-day reports +# 80430-1920 - Added Customer hangup cause stats # require("dbconnect.php"); @@ -197,6 +198,47 @@ echo "Average hold time for DROP Calls: $average_hold_seconds second +############################## +######### CALL HANGUP REASON STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL HANGUP REASON STATS\n"; +echo "+----------------------+------------+\n"; +echo "| HANGUP REASON | CALLS |\n"; +echo "+----------------------+------------+\n"; + +$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$reasons_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $reasons_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} +# if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} + + echo "| $reason | $REASONcount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+----------------------+------------+\n"; + + + + ############################## ######### CALL STATUS STATS diff --git a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php index 2e5a9e7f..34ba976b 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php @@ -4,12 +4,12 @@ # Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # CHANGES -# # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal # 71008-1436 - Added shift to be defined in dbconnect.php -# 71218-1155 - added end_date for multi-day reports +# 71218-1155 - Added end_date for multi-day reports +# 80430-1920 - Added Customer hangup cause stats # header ("Content-type: text/html; charset=utf-8"); @@ -242,6 +242,49 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls $NApercent%\n"; echo "Average Call Length for NA Calls in seconds: $average_na_seconds\n"; +############################## +######### CALL HANGUP REASON STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL HANGUP REASON STATS\n"; +echo "+----------------------+------------+\n"; +echo "| HANGUP REASON | CALLS |\n"; +echo "+----------------------+------------+\n"; + +$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$reasons_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $reasons_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} + $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} + if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} + if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER ';} + + echo "| $reason | $REASONcount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+----------------------+------------+\n"; + + + + + ############################## ######### CALL STATUS STATS diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 9a9c537c..224ebe0a 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -707,6 +707,8 @@ if (isset($_GET["code"])) {$code=$_GET["code"];} elseif (isset($_POST["code"])) {$code=$_POST["code"];} if (isset($_GET["code_name"])) {$code_name=$_GET["code_name"];} elseif (isset($_POST["code_name"])) {$code_name=$_POST["code_name"];} +if (isset($_GET["afterhours_xfer_group"])) {$afterhours_xfer_group=$_GET["afterhours_xfer_group"];} + elseif (isset($_POST["afterhours_xfer_group"])) {$afterhours_xfer_group=$_POST["afterhours_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -914,7 +916,6 @@ $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $ingroup_recording_override = ereg_replace("[^0-9a-zA-Z]","",$ingroup_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); -$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); $after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); $after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); $qc_script = ereg_replace("[^0-9a-zA-Z]","",$qc_script); @@ -1006,6 +1007,8 @@ $drop_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$drop_exten); $safe_harbor_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$safe_harbor_exten); $drop_action = ereg_replace("[^-\_0-9a-zA-Z]","",$drop_action); $drop_inbound_group = ereg_replace("[^-\_0-9a-zA-Z]","",$drop_inbound_group); +$afterhours_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$afterhours_xfer_group); +$after_hours_action = ereg_replace("[^-\_0-9a-zA-Z]","",$after_hours_action); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -2803,7 +2806,7 @@ echo "

-After Hours Action - The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field. Default is MESSAGE. +After Hours Action - The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field, IN_GROUP will send the call to the inbound group selected in the After Hours Transfer Group select list. Default is MESSAGE.
@@ -2820,6 +2823,11 @@ echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; @@ -11652,13 +11675,17 @@ if ($ADD==3111) echo "\n"; echo "$NWB#vicidial_inbound_groups-call_time_id$NWE\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; 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 e498d9f0..bf9d8885 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -23,6 +23,7 @@ # 70702-1259 - Added recording location link and truncation # 70906-2132 - Added closer_log records display # 80428-0144 - UTF8 cleanup +# 80501-0454 - Added Hangup Reason to logs display # require("dbconnect.php"); @@ -318,7 +319,8 @@ else $call_log .= "\n"; $call_log .= "\n"; $call_log .= "\n"; - $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; } @@ -348,7 +350,8 @@ else $closer_log .= "\n"; $closer_log .= "\n"; $closer_log .= "\n"; - $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; } @@ -525,8 +528,8 @@ echo "

\n"; echo "
\n"; echo "CALLS TO THIS LEAD:\n"; -echo "
After Hours Voicemail - The voicemail box to send the call to if the Action is set to VOICEMAIL. +
+ +
+After Hours Transfer Group - If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group. +

@@ -5627,7 +5635,7 @@ if ($ADD==2011) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
GROUP ADDED: $group_id\n"; @@ -7081,7 +7089,7 @@ if ($ADD==4111) { echo "
GROUP MODIFIED: $group_id\n"; - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename' where group_id='$group_id';"; + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); ### LOG CHANGES TO LOG FILE ### @@ -11554,6 +11562,7 @@ if ($ADD==3111) $drop_inbound_group = $row[30]; $ingroup_recording_override = $row[31]; $ingroup_rec_filename = $row[32]; + $afterhours_xfer_group = $row[33]; ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; @@ -11563,12 +11572,15 @@ if ($ADD==3111) $Xgroups_selected=0; $Dgroups_menu=''; $Dgroups_selected=0; + $Agroups_menu=''; + $Agroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\n"; $Dgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; + if ($group_id!=$rowx[0]) + {$Agroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n";} $o++; } if ($Xgroups_selected < 1) @@ -11591,6 +11610,10 @@ if ($ADD==3111) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} + if ($Agroups_selected < 1) + {$Agroups_menu .= "\n";} + else + {$Agroups_menu .= "\n";} echo "
MODIFY A GROUPS RECORD: $row[0]
\n"; @@ -11635,15 +11658,15 @@ if ($ADD==3111) echo "
Transfer-Conf Number 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Drop Action: $NWB#vicidial_inbound_groups-drop_action$NWE
Drop Action: $NWB#vicidial_inbound_groups-drop_action$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Drop Transfer Group:
Drop Transfer Group: $NWB#vicidial_inbound_groups-drop_inbound_group$NWE
After Hours Action: $NWB#vicidial_inbound_groups-after_hours_action$NWE
After Hours Action: $NWB#vicidial_inbound_groups-after_hours_action$NWE
After Hours Message Filename: $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
After Hours Message Filename: $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
After Hours Extension: $NWB#vicidial_inbound_groups-after_hours_exten$NWE
After Hours Extension: $NWB#vicidial_inbound_groups-after_hours_exten$NWE
After Hours Voicemail: $NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
After Hours Voicemail: $NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
After Hours Transfer Group: $NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE
Welcome Message Filename: $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
$row[11] $row[3] $row[2] $row[1]
$row[1] $row[15]
$row[3] $row[2] $row[1]   $row[14]
  $row[14]   $row[17]
\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
\n"; +echo "\n"; echo "$call_log\n"; @@ -534,8 +537,8 @@ echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD HANGUP REASON
\n"; echo "

\n"; echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT
\n"; +echo "\n"; echo "$closer_log\n"; diff --git a/agc_2-X/trunk/www/vicidial/user_stats.php b/agc_2-X/trunk/www/vicidial/user_stats.php index a33784bb..06423a1e 100644 --- a/agc_2-X/trunk/www/vicidial/user_stats.php +++ b/agc_2-X/trunk/www/vicidial/user_stats.php @@ -10,6 +10,7 @@ # 70118-1605 - Added user group column to login/out and calls lists # 70702-1231 - Added recording location link and truncation # 80117-0316 - Added vicidial_user_closer_log entries to display +# 80501-0506 - Added Hangup Reason to logs display # header ("Content-type: text/html; charset=utf-8"); @@ -96,7 +97,7 @@ echo "\n"
-
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT HANGUP REASON
+
" ?>   VICIDIAL ADMIN: User Stats for  
@@ -266,7 +267,7 @@ echo "

\n"; echo "
\n"; echo "CLOSER IN-GROUP SELECTION LOGS:\n"; -echo "
" ?>   VICIDIAL ADMIN: User Stats for  
\n"; +echo "
\n"; echo "\n"; $stmt="select * from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; @@ -293,14 +294,14 @@ echo "
# DATE/TIME CAMPAIGNBLEND GROUPS
# DATE/TIME

\n"; +echo "


\n"; echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD
\n"; +echo "\n"; $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -324,18 +325,19 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; } -echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD HANGUP REASON
# DATE/TIME $row[3] $row[14] $row[2] $row[1]
$row[1] $row[15]


\n"; +echo "


\n"; echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN WAIT (S) LIST LEAD
\n"; +echo "\n"; $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -359,7 +361,8 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; }
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN WAIT (S) LIST LEAD HANGUP REASON
# DATE/TIME $row[3] $row[14] $row[2] $row[1]
$row[1] $row[17]