Added ability to chose the type of callerid sent for inbound ring-agent calls in the in-group: GENERIC, INGROUP, CUSTOMER PHONE and combos.

Added NA Call URL feature to campaigns and in-groups, works like dispo call url but only for non-agent handled calls like DROP, NA, etc...
Changed MULTI_LEAD Auto-Alt-Dial to use Auto-Alt-Dial Statuses set in the campaign automatically, you may need to add auto-alt-statuses
Added a check to admin.php to prevent submission of campaign and in-group changes before the entire form loads
Added call_id as a script and url variable
Added debug logging of dispo/start/add-lead/no-agent URL submissions to a database table

git-svn-id: svn://192.168.202.10@1706 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-08-02 05:49:37 +00:00
parent d00840eecd
commit e93a0495ff
17 changed files with 1362 additions and 255 deletions
+14
View File
@@ -656,6 +656,20 @@ OTHER CHANGES:
You must delete the BUILD voicemail file for this feature to work:
rm -f /etc/asterisk/BUILDvoicemail-vicidial.conf
149. Added ability to chose the type of callerid sent for inbound ring-agent
calls in the in-group: GENERIC, INGROUP, CUSTOMER PHONE and a couple
of combinations of those.
150. Added NA Call URL feature to campaigns and in-groups. This works like
dispo call url, but it works only for non-agent handled calls, like
dropped calls, No Answers, Busy, etc...
151. Changed MULTI_LEAD Auto-Alt-Dial to use the Auto-Alt-Dial Statuses as set
in the campaign automatically. If you are using MULTI_LEAD you may need
to add statuses like DROP, PDROP and others to your campaign's auto-alt
dial statuses so that the other leads tied by vendor_lead_code in the
campaign's lists are not deactivated.
+62 -30
View File
@@ -153,6 +153,8 @@
# 110626-2343 - Added queuemetrics_pe_phone_append
# 110707-0646 - Added AGENTEXT option in drop message to send to extension(user_custom_five) field
# 110707-1302 - Added last_inbound_call_time and finish to next agent call options
# 110731-0141 - Added call_id variable to add_lead_url function calls
# 110801-0841 - Added on_hook_cid option and group_calldate field
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -164,7 +166,7 @@ $wait_prompt_runs=0;
$at='@';
$S='*';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=178;
$mysql_log_count=179;
$one_mysql_log=0;
@@ -351,18 +353,18 @@ 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\
}
##### find out if this call is already in the vicidial_log_extended table
$VLEcount=0;
$stmtA = "SELECT count(*) FROM vicidial_log_extended where uniqueid='$uniqueid';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02144'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VLEcount = $aryA[0];
}
$sthA->finish();
#$VLEcount=0;
#$stmtA = "SELECT count(*) FROM vicidial_log_extended where uniqueid='$uniqueid';";
#$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
#$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
#$sthArows=$sthA->rows;
# $dbhP=$dbhA; $mysql_count='02144'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
#if ($sthArows > 0)
# {
# @aryA = $sthA->fetchrow_array;
# $VLEcount = $aryA[0];
# }
#$sthA->finish();
$user_unavailable_action='';
##### special processing for DID forwarded calls "99909*1***DID"
@@ -606,10 +608,14 @@ while ($sthArows > $cbc)
$sthA->finish();
### Update calldate on the in-group record
$stmtA = "UPDATE vicidial_inbound_groups SET group_calldate='$SQLdate' where group_id='$channel_group';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02179'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
### 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,afterhours_xfer_group,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,no_agent_no_queue,no_agent_action,no_agent_action_value,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,active,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds,on_hook_ring_time,ingroup_recording_override,ingroup_rec_filename 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,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,no_agent_no_queue,no_agent_action,no_agent_action_value,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,active,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds,on_hook_ring_time,ingroup_recording_override,ingroup_rec_filename,on_hook_cid 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;
@@ -693,6 +699,7 @@ if ($sthArows > 0)
$on_hook_ring_time = $aryA[66];
$ingroup_recording_override = $aryA[67];
$campaign_rec_filename = $aryA[68];
$on_hook_cid = $aryA[69];
$custom_call_id='';
if ($uniqueid_status_display =~ /ENABLED/)
{$custom_call_id = "$uniqueid";}
@@ -777,12 +784,12 @@ if ($call_handle_method =~ /LOOKUP/)
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02007'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$cbc=0;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02008'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
while ($sthArows > $cbc)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$insert_lead_id = $aryA[0];
@@ -793,6 +800,9 @@ if ($call_handle_method =~ /LOOKUP/)
### Start the Add-Lead-URL get proccess
if (length($add_lead_url) > 5)
{
$PADlead_id = sprintf("%010s", $insert_lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);}
$XXqueryCID = "Y$CIDdate$PADlead_id";
$launch = $PATHhome . "/AST_send_URL.pl";
$launch .= " --SYSLOG" if ($SYSLOG);
$launch .= " --lead_id=" . $insert_lead_id;
@@ -802,6 +812,7 @@ if ($call_handle_method =~ /LOOKUP/)
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -875,12 +886,12 @@ if ($call_handle_method =~ /LOOKUP/)
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02011'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$cbc=0;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02012'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
while ($sthArows > $cbc)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$insert_lead_id = $aryA[0];
@@ -891,6 +902,9 @@ if ($call_handle_method =~ /LOOKUP/)
### Start the Add-Lead-URL get proccess
if (length($add_lead_url) > 5)
{
$PADlead_id = sprintf("%010s", $insert_lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);}
$XXqueryCID = "Y$CIDdate$PADlead_id";
$launch = $PATHhome . "/AST_send_URL.pl";
$launch .= " --SYSLOG" if ($SYSLOG);
$launch .= " --lead_id=" . $insert_lead_id;
@@ -900,6 +914,7 @@ if ($call_handle_method =~ /LOOKUP/)
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -945,12 +960,12 @@ else
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02014'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$cbc=0;
$stmtA = "select LAST_INSERT_ID() LIMIT 1;";
$stmtA = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02015'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
while ($sthArows > $cbc)
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$insert_lead_id = $aryA[0];
@@ -961,6 +976,9 @@ else
### Start the Add-Lead-URL get proccess
if (length($add_lead_url) > 5)
{
$PADlead_id = sprintf("%010s", $insert_lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);}
$XXqueryCID = "Y$CIDdate$PADlead_id";
$launch = $PATHhome . "/AST_send_URL.pl";
$launch .= " --SYSLOG" if ($SYSLOG);
$launch .= " --lead_id=" . $insert_lead_id;
@@ -970,6 +988,7 @@ else
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -992,7 +1011,7 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st
$stmtA = "INSERT INTO vicidial_closer_log set status='AFTHRS',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',uniqueid='$uniqueid';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02016'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -1199,7 +1218,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/)
$stmtA = "INSERT INTO vicidial_closer_log set status='NANQUE',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='NO AGENT DROP',term_reason='NOAGENT',uniqueid='$uniqueid';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02105'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -1473,7 +1492,7 @@ if ($call_handle_method =~ /CLOSER|DIGITID$/)
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02024'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -1552,7 +1571,7 @@ if ($channel_group =~ /AGENTDIRECT/)
### check for an IVR status record in vicidial_auto_calls
$Uaffected_rows=0;
$stmtA = "select auto_call_id from vicidial_auto_calls where uniqueid='$uniqueid' and server_ip='$VARserver_ip';";
$stmtA = "SELECT auto_call_id from vicidial_auto_calls where uniqueid='$uniqueid' and server_ip='$VARserver_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -1578,7 +1597,7 @@ if ($Uaffected_rows < 1)
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02030'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -1626,7 +1645,7 @@ $stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaig
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02031'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -2252,6 +2271,17 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$PADauto_call_id = sprintf("%011s", $auto_call_id); while (length($PADauto_call_id) > 11) {chop($PADauto_call_id);}
$RINGALLqueryCID = "RINGAGENT$PADauto_call_id";
if ($on_hook_cid =~ /INGROUP/)
{$RINGALLqueryCID = "$channel_group";}
if ($on_hook_cid =~ /CUSTOMER_PHONE/)
{$RINGALLqueryCID = "$phone_number";}
if ($on_hook_cid =~ /CUSTOMER_PHONE_RINGAGENT/)
{$RINGALLqueryCID = "RINGAGENT_$phone_number";}
if ($on_hook_cid =~ /CUSTOMER_PHONE_INGROUP/)
{
$RA_channel_group = $channel_group; while (length($RA_channel_group) > 10) {chop($RA_channel_group);}
$RINGALLqueryCID = "$RA_channel_group$phone_number";
}
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$VARserver_ip','','Originate','$RINGALLqueryCID','Exten: $RINGALLexten','Context: default','Channel: $ring_all_DIALstr[$ragp]','Priority: 1','Callerid: $RINGALLqueryCID','Timeout: $commandTEMPon_hook_ring_time','','','','')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02168'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
@@ -2297,7 +2327,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$stmtA = "INSERT INTO vicidial_auto_calls SET server_ip='$VARserver_ip',campaign_id='$channel_group',status='CLOSER',lead_id='$insert_lead_id',uniqueid='$uniqueid',callerid='$callerid',channel='$channel',phone_code='$phone_code',phone_number='$phone_number',call_time='$SQLdate',call_type='IN',stage='CLOSER-$drop_timer',queue_priority='$queue_priority' $adSQL;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02064'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -3412,7 +3442,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$wait_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02089'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -3435,6 +3465,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$launch .= " --call_type=IN";
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --alt_dial=";
$launch .= " --function=INGROUP_ADD_LEAD_URL";
@@ -3834,7 +3865,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$hold_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02089'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -3858,6 +3889,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=";
$launch .= " --call_id=" . $callerid;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -4044,7 +4076,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$stmtA = "INSERT INTO vicidial_auto_calls SET server_ip='$VARserver_ip',campaign_id='$channel_group',status='LIVE',lead_id='$insert_lead_id',uniqueid='$uniqueid',callerid='$callerid',channel='$channel',phone_code='$phone_code',phone_number='$phone_number',call_time='$SQLdate',call_type='IN',stage='LIVE-$drop_timer',queue_priority='$queue_priority' $adSQL;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02096'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
+75
View File
@@ -31,6 +31,7 @@
# 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
# 110801-2140 - Added vicidial_url_log table purging and vicidial_log_extended to rolling processes
#
### begin parsing run-time options ###
@@ -403,6 +404,56 @@ if (!$T)
}
##### vicidial_log_extended
$stmtA = "SELECT count(*) from vicidial_log_extended;";
$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_log_extended_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from vicidial_log_extended_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_log_extended_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_log_extended table... ($vicidial_log_extended_count|$vicidial_log_extended_archive_count)\n";}
$stmtA = "INSERT IGNORE INTO vicidial_log_extended_archive SELECT * from vicidial_log_extended;";
$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_log_extended_archive table \n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "DELETE FROM vicidial_log_extended WHERE call_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_log_extended table \n";}
$stmtA = "optimize table vicidial_log_extended;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$stmtA = "optimize table vicidial_log_extended_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
##### server_performance
$stmtA = "SELECT count(*) from server_performance;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -427,6 +478,30 @@ if (!$T)
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
##### vicidial_url_log
$stmtA = "SELECT count(*) from vicidial_url_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_url_log_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_url_log table... ($vicidial_url_log_count)\n";}
$stmtA = "DELETE FROM vicidial_url_log WHERE url_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_url_log table \n";}
$stmtA = "optimize table vicidial_url_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
##### vicidial_agent_log
$stmtA = "SELECT count(*) from vicidial_agent_log;";
+524 -2
View File
@@ -103,6 +103,7 @@
# 110525-1940 - Allow for auto-dial IVR transfers
# 110602-0953 - Added dl_diff_target_method option
# 110723-1256 - Added extra debug for vac deletes and fix for long ring/drop time
# 110731-2127 - Added sections for handling MULTI_LEAD auto-alt-dial and na-call-url functions
#
@@ -1479,7 +1480,10 @@ while($one_day_interval > 0)
if($M){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
$event_string = "| dead NA call added to log $CLuniqueid|$CLlead_id|$CLphone_number|$CLstatus|$CLnew_status|$affected_rows|$insertVLcount";
$stmtB = "INSERT INTO vicidial_log_extended set uniqueid='$CLuniqueid',server_ip='$server_ip',call_date='$SQLdate',lead_id = '$CLlead_id',caller_code='$KLcallerid[$kill_vac]',custom_call_id='';";
$affected_rowsB = $dbhA->do($stmtB);
$event_string = "| dead NA call added to log $CLuniqueid|$CLlead_id|$CLphone_number|$CLstatus|$CLnew_status|$affected_rows|$affected_rowsB|$insertVLcount";
&event_logger;
}
else
@@ -2267,7 +2271,10 @@ while($one_day_interval > 0)
if($M){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
$event_string = "| dead NA call added to log $CLuniqueid|$CLlead_id|$CLphone_number|$CLstatus|DROP|$affected_rows|";
$stmtB = "INSERT INTO vicidial_log_extended set uniqueid='$CLuniqueid',server_ip='$server_ip',call_date='$SQLdate',lead_id = '$CLlead_id',caller_code='$CLcallerid',custom_call_id='';";
$affected_rowsB = $dbhA->do($stmtB);
$event_string = "| dead NA call added to logs $CLuniqueid|$CLlead_id|$CLphone_number|$CLstatus|DROP|$affected_rows|$affected_rowsB|";
&event_logger;
if ($enable_queuemetrics_logging > 0)
@@ -2348,6 +2355,510 @@ while($one_day_interval > 0)
}
&get_time_now;
###############################################################################
###### fourth we will check to see if any campaign is running MULTI_LEAD
###### auto-alt-dial. if yes, then go through the unprocessed extended
###### log entries for this server_ip and process them.
###############################################################################
$MLincall='|INCALL|QUEUE|DISPO|';
$multi_alt_count=0;
$stmtA = "SELECT count(*) FROM vicidial_campaigns where auto_alt_dial='MULTI_LEAD' and dial_method NOT IN('MANUAL','INBOUND_MAN') and campaign_calldate > \"$RMSQLdate\";";
$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;
$multi_alt_count = $aryA[0];
}
if ($multi_alt_count > 0)
{
@MLcamp_id = @MT;
@MLaad_statuses = @MT;
@MLlists = @MT;
$MLcampaigns='|';
$stmtA = "SELECT campaign_id,auto_alt_dial_statuses FROM vicidial_campaigns where auto_alt_dial='MULTI_LEAD' and dial_method NOT IN('MANUAL','INBOUND_MAN') and campaign_calldate > \"$RMSQLdate\";";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$MLcamp_count=0;
while ($sthArows > $MLcamp_count)
{
@aryA = $sthA->fetchrow_array;
$MLcampaigns .= "$aryA[0]|";
$MLcamp_id[$MLcamp_count] = $aryA[0];
$MLaad_statuses[$MLcamp_count] = $aryA[1];
$MLcamp_count++;
}
$MLcamp_count=0;
foreach(@MLcamp_id)
{
$MLlists[$MLcamp_count]='';
$stmtA = "SELECT list_id FROM vicidial_lists where campaign_id='$MLcamp_id[$MLcamp_count]';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$MLlist_count=0;
while ($sthArows > $MLlist_count)
{
@aryA = $sthA->fetchrow_array;
$MLlists[$MLcamp_count] .= "'$aryA[0]',";
$MLlist_count++;
}
$MLlists[$MLcamp_count] =~ s/,$//gi;
if (length($MLlists[$MLcamp_count]) < 2)
{$MLlists[$MLcamp_count]="''";}
$MLcamp_count++;
}
$event_string = " MULTI_LEAD auto-alt-dial check: $multi_alt_count active, checking unprocessed calls...";
&event_logger;
@MLuniqueid = @MT;
@MLleadid = @MT;
@MLcalldate = @MT;
@MLcallerid = @MT;
@MLflag = @MT;
@MLcampaign = @MT;
@MLstatus = @MT;
$stmtA = "SELECT uniqueid,lead_id,call_date,caller_code FROM vicidial_log_extended where server_ip='$server_ip' and call_date > \"$RMSQLdate\" and multi_alt_processed='N' order by call_date,lead_id limit 100000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$vle_count=0;
$vle_auto_count=0;
while ($sthArows > $vle_count)
{
$MLflag[$vle_count] = 0;
@aryA = $sthA->fetchrow_array;
if ($aryA[3] =~ /^V/)
{
$vle_auto_count++;
$MLflag[$vle_count] = 1;
}
$MLuniqueid[$vle_count] = $aryA[0];
$MLleadid[$vle_count] = $aryA[1];
$MLcalldate[$vle_count] = $aryA[2];
$MLcallerid[$vle_count] = $aryA[3];
$vle_count++;
}
$sthA->finish();
$event_string = " MULTI_LEAD auto-alt-dial vle records count: $vle_count|$vle_auto_count";
&event_logger;
$vle_count=0;
foreach(@MLuniqueid)
{
if ($MLflag[$vle_count] > 0)
{
$vac_count=0;
$stmtA = "SELECT count(*) FROM vicidial_auto_calls where callerid='$MLcallerid[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$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;
$vac_count = $aryA[0];
}
if ($vac_count < 1)
{
$stmtA = "SELECT campaign_id,status FROM vicidial_log where uniqueid='$MLuniqueid[$vle_count]' and lead_id='$MLleadid[$vle_count]' and call_date > \"$RMSQLdate\";";
$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;
$MLcampaign[$vle_count] = $aryA[0];
$MLstatus[$vle_count] = $aryA[1];
if ($MLcampaigns =~ /\|$MLcampaign[$vle_count]\|/i)
{
if ($MLincall !~ /\|$MLstatus[$vle_count]\|/i)
{
$MLaads_value='';
$MLlists_value="''";
$MLcamp_match=0;
$MLcamp_loop=0;
while ( ($MLcamp_match < 1) && ($MLcamp_loop <= $MLcamp_count) )
{
if ( ($MLcampaign[$vle_count] =~ /$MLcamp_id[$MLcamp_loop]/i) && (length($MLcampaign[$vle_count]) == length($MLcamp_id[$MLcamp_loop])) )
{
$MLcamp_match++;
$MLaads_value = $MLaad_statuses[$MLcamp_loop];
$MLlists_value = $MLlists[$MLcamp_loop];
}
$MLcamp_loop++;
}
if ($MLaads_value !~ / $MLstatus[$vle_count] /i)
{
$event_string = " ML status non-match, looking for matching accounts: $MLcallerid[$vle_count]|$MLstatus[$vle_count]";
&event_logger;
$MLnonmatch_output='';
$MLnonmatch_leadids='';
$MLvendor_lead_code='';
$stmtA = "SELECT vendor_lead_code FROM vicidial_list where lead_id='$MLleadid[$vle_count]';";
$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;
$MLvlc[$vle_count] = $aryA[0];
}
if (length($MLvlc[$vle_count]) > 1)
{
$stmtA = "SELECT lead_id,status FROM vicidial_list where vendor_lead_code='$MLvlc[$vle_count]' and list_id IN($MLlists_value) and lead_id!='$MLleadid[$vle_count]';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$MLnm_count=0;
while ($sthArows > $MLnm_count)
{
@aryA = $sthA->fetchrow_array;
$MLnonmatch_output .= "$aryA[0]-$aryA[1]|";
$MLnonmatch_leadids .= "'$aryA[0]',";
$MLnm_count++;
}
if ($MLnm_count > 0)
{
chop($MLnonmatch_leadids);
if (length($MLnonmatch_leadids)<2)
{$MLnonmatch_leadids="''";}
$event_string = " ML status non-match, $MLnm_count matching accounts found: $MLcallerid[$vle_count]|$MLvlc[$vle_count]\n $MLnonmatch_output";
&event_logger;
$stmtA = "UPDATE vicidial_list SET status='MLINAT' where lead_id IN($MLnonmatch_leadids);";
$affected_rows = $dbhA->do($stmtA);
$event_string = " ML status non-match accounts inactivated: $MLnonmatch_leadids|$affected_rows|MLINAT";
&event_logger;
}
### set multi-lead status non-match record to Y for processed
$stmtA = "UPDATE vicidial_log_extended SET multi_alt_processed='Y' where uniqueid='$MLuniqueid[$vle_count]' and call_date='$MLcalldate[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " ML status non-match, log processed: $MLcallerid[$vle_count]|$affected_rows";
&event_logger;
}
else
{
### set multi-lead status non-match, no vendor_lead_code record to Y for processed
$stmtA = "UPDATE vicidial_log_extended SET multi_alt_processed='Y' where uniqueid='$MLuniqueid[$vle_count]' and call_date='$MLcalldate[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " ML status non-match, no vlc, log processed: $MLcallerid[$vle_count]|$MLvlc[$vle_count]|$affected_rows";
&event_logger;
}
}
else
{
### set multi-lead status match record to Y for processed
$stmtA = "UPDATE vicidial_log_extended SET multi_alt_processed='Y' where uniqueid='$MLuniqueid[$vle_count]' and call_date='$MLcalldate[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " ML match, log processed: $MLcallerid[$vle_count]|$affected_rows";
&event_logger;
}
}
else
{
$event_string = " ML status in-call, do nothing: $MLcallerid[$vle_count]|$MLuniqueid[$vle_count]|$MLstatus[$vle_count]";
&event_logger;
}
}
else
{
### set non-multi-lead campaign record to U for unqualified for MULTI_LEAD processing
$stmtA = "UPDATE vicidial_log_extended SET multi_alt_processed='U' where uniqueid='$MLuniqueid[$vle_count]' and call_date='$MLcalldate[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{
$event_string = " ML no log entry, do nothing: $MLcallerid[$vle_count]|$MLuniqueid[$vle_count]";
&event_logger;
}
}
else
{
$event_string = " ML active call, do nothing: $MLcallerid[$vle_count]";
&event_logger;
}
}
else
{
### set non-auto-dial record to U for unqualified for MULTI_LEAD processing
$stmtA = "UPDATE vicidial_log_extended SET multi_alt_processed='U' where uniqueid='$MLuniqueid[$vle_count]' and call_date='$MLcalldate[$vle_count]' and lead_id='$MLleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
}
$vle_count++;
}
}
###############################################################################
###### fifth we will check to see if any campaign or in-group has na_call_url
###### populated. if yes, then go through the unprocessed extended log
###### entries for this server_ip and process them.
###############################################################################
$NCUincall='|INCALL|QUEUE|DISPO|';
$ncu_count=0;
$ncu_in_count=0;
$stmtA = "SELECT count(*) FROM vicidial_campaigns where na_call_url IS NOT NULL and na_call_url!='' and campaign_calldate > \"$RMSQLdate\";";
$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;
$ncu_count = $aryA[0];
}
$stmtA = "SELECT count(*) FROM vicidial_inbound_groups where na_call_url IS NOT NULL and na_call_url!='' and group_calldate > \"$RMSQLdate\";";
$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;
$ncu_in_count = $aryA[0];
}
if ( ($ncu_count > 0) || ($ncu_in_count > 0) )
{
@NCUcamp_id = @MT;
@NCUncurl = @MT;
$ncu_total_count=0;
$NCUcampaigns='|';
if ($ncu_count > 0)
{
$stmtA = "SELECT campaign_id,na_call_url FROM vicidial_campaigns where na_call_url IS NOT NULL and na_call_url!='' and campaign_calldate > \"$RMSQLdate\";";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$NCUcamp_count=0;
while ($sthArows > $NCUcamp_count)
{
@aryA = $sthA->fetchrow_array;
$NCUcampaigns .= "$aryA[0]|";
$NCUcamp_id[$ncu_total_count] = $aryA[0];
$NCUncurl[$ncu_total_count] = $aryA[1];
$NCUcamp_count++;
$ncu_total_count++;
}
}
if ($ncu_in_count > 0)
{
$stmtA = "SELECT group_id,na_call_url FROM vicidial_inbound_groups where na_call_url IS NOT NULL and na_call_url!='' and group_calldate > \"$RMSQLdate\";";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$NCUig_count=0;
while ($sthArows > $NCUig_count)
{
@aryA = $sthA->fetchrow_array;
$NCUcampaigns .= "$aryA[0]|";
$NCUcamp_id[$ncu_total_count] = $aryA[0];
$NCUncurl[$ncu_total_count] = $aryA[1];
$NCUig_count++;
$ncu_total_count++;
}
}
$event_string = " NA-CALL-URL check: $ncu_total_count active, checking unprocessed calls...";
&event_logger;
@NCUuniqueid = @MT;
@NCUleadid = @MT;
@NCUcalldate = @MT;
@NCUcallerid = @MT;
@NCUcampaign = @MT;
@NCUstatus = @MT;
@NCUuser = @MT;
@NCUphone = @MT;
@NCUaltdial = @MT;
@NCUcalltype = @MT;
$stmtA = "SELECT uniqueid,lead_id,call_date,caller_code FROM vicidial_log_extended where server_ip='$server_ip' and call_date > \"$RMSQLdate\" and dispo_url_processed='N' order by call_date,lead_id limit 100000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$vle_count=0;
$vle_auto_count=0;
while ($sthArows > $vle_count)
{
@aryA = $sthA->fetchrow_array;
$NCUuniqueid[$vle_count] = $aryA[0];
$NCUleadid[$vle_count] = $aryA[1];
$NCUcalldate[$vle_count] = $aryA[2];
$NCUcallerid[$vle_count] = $aryA[3];
$vle_count++;
}
$sthA->finish();
$event_string = " NA-CALL-URL vle records count: $vle_count|$vle_auto_count";
&event_logger;
$vle_count=0;
if (length($NCUuniqueid[0]) > 5)
{
foreach(@NCUuniqueid)
{
if ( (length($NCUcallerid[$vle_count]) > 10) && ($NCUcallerid[$vle_count] !~ /^M/) && ($NCUcallerid[$vle_count] =~ /^V|^Y/) )
{
$vac_count=0;
$stmtA = "SELECT count(*) FROM vicidial_auto_calls where callerid='$NCUcallerid[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$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;
$vac_count = $aryA[0];
}
if ($vac_count < 1)
{
if ($NCUcallerid[$vle_count] =~ /^Y/)
{
$stmtA = "SELECT campaign_id,status,user,phone_number,'MAIN' FROM vicidial_closer_log where uniqueid='$NCUuniqueid[$vle_count]' and lead_id='$NCUleadid[$vle_count]' and call_date='$NCUcalldate[$vle_count]';";
$NCUcalltype[$vle_count] = 'IN';
}
else
{
$stmtA = "SELECT campaign_id,status,user,phone_number,alt_dial FROM vicidial_log where uniqueid='$NCUuniqueid[$vle_count]' and lead_id='$NCUleadid[$vle_count]' and call_date > \"$RMSQLdate\";";
$NCUcalltype[$vle_count] = 'OUT';
}
$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;
$NCUcampaign[$vle_count] = $aryA[0];
$NCUstatus[$vle_count] = $aryA[1];
$NCUuser[$vle_count] = $aryA[2];
$NCUphone[$vle_count] = $aryA[3];
$NCUaltdial[$vle_count] = $aryA[4];
if ($NCUcampaigns =~ /\|$NCUcampaign[$vle_count]\|/i)
{
if ($NCUincall !~ /\|$NCUstatus[$vle_count]\|/i)
{
if ($NCUuser[$vle_count] =~ /VDAD|VDCL/i)
{
$NCUncurl_value='';
$NCUcamp_match=0;
$NCUcamp_loop=0;
while ( ($NCUcamp_match < 1) && ($NCUcamp_loop <= $NCUcamp_count) )
{
if ( ($NCUcampaign[$vle_count] =~ /$NCUcamp_id[$NCUcamp_loop]/i) && (length($NCUcampaign[$vle_count]) == length($NCUcamp_id[$NCUcamp_loop])) )
{
$NCUcamp_match++;
$NCUncurl_value = $NCUncurl[$NCUcamp_loop];
}
$NCUcamp_loop++;
}
if (length($NCUncurl_value) > 10)
{
$event_string = " NCU url defined, launching web GET: $NCUcallerid[$vle_count]|$NCUstatus[$vle_count]";
&event_logger;
### set dispo_url_processed match record to Y for processed and sent
$stmtA = "UPDATE vicidial_log_extended SET dispo_url_processed='XY' where uniqueid='$NCUuniqueid[$vle_count]' and call_date='$NCUcalldate[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$launch = $PATHhome . "/AST_send_URL.pl";
$launch .= " --SYSLOG" if ($SYSLOG);
$launch .= " --lead_id=" . $NCUleadid[$vle_count];
$launch .= " --phone_number=" . $NCUphone[$vle_count];
$launch .= " --user=" . $NCUuser[$vle_count];
$launch .= " --call_type=" . $NCUcalltype[$vle_count];
$launch .= " --campaign=" . $NCUcampaign[$vle_count];
$launch .= " --uniqueid=" . $NCUuniqueid[$vle_count];
$launch .= " --alt_dial=" . $NCUaltdial[$vle_count];
$launch .= " --call_id=" . $NCUcallerid[$vle_count];
$launch .= " --function=NA_CALL_URL";
system($launch . ' &');
$event_string = " NCU url sent processed: $NCUcallerid[$vle_count]|$NCUcampaign[$vle_count]|$NCUuser[$vle_count]";
&event_logger;
}
else
{
### set dispo_url_processed match record to Y for processed but not sent, invalid url
$stmtA = "UPDATE vicidial_log_extended SET dispo_url_processed='XY' where uniqueid='$NCUuniqueid[$vle_count]' and call_date='$NCUcalldate[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " NCU invalid url defined, log processed: $NCUcallerid[$vle_count]|$affected_rows|$NCUcampaign[$vle_count]";
&event_logger;
}
}
else
{
### set dispo_url_processed record to U for unqualified processing because call sent to agent
$stmtA = "UPDATE vicidial_log_extended SET dispo_url_processed='XY' where uniqueid='$NCUuniqueid[$vle_count]' and call_date='$NCUcalldate[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " NCU call sent to agent, log processed: $NCUcallerid[$vle_count]|$affected_rows|$NCUuser[$vle_count]";
&event_logger;
}
}
else
{
$event_string = " NCU status in-call, do nothing: $NCUcallerid[$vle_count]|$NCUuniqueid[$vle_count]|$NCUstatus[$vle_count]";
&event_logger;
}
}
else
{
### set dispo_url_processed record to XU for unqualified processing because no url defined
$stmtA = "UPDATE vicidial_log_extended SET dispo_url_processed='XU' where uniqueid='$NCUuniqueid[$vle_count]' and call_date='$NCUcalldate[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
}
}
else
{
$event_string = " NCU no log entry, do nothing: $NCUcallerid[$vle_count]|$NCUuniqueid[$vle_count]";
&event_logger;
}
}
else
{
$event_string = " NCU active call, do nothing: $NCUcallerid[$vle_count]";
&event_logger;
}
}
else
{
### set log extended record to XU for invalid callid or manual dial call
$stmtA = "UPDATE vicidial_log_extended SET dispo_url_processed='XU' where uniqueid='$NCUuniqueid[$vle_count]' and call_date='$NCUcalldate[$vle_count]' and lead_id='$NCUleadid[$vle_count]';";
$affected_rows = $dbhA->do($stmtA);
$event_string = " NCU invalid call, mark as XU: $NCUcallerid[$vle_count]|$NCUuniqueid[$vle_count]";
&event_logger;
}
$vle_count++;
}
}
}
###############################################################################
###### last, wait for a little bit and repeat the loop
###############################################################################
@@ -2598,6 +3109,17 @@ sub get_time_now #get the current date and time and epoch for logging call lengt
if ($Tsec < 10) {$Tsec = "0$Tsec";}
$TDtsSQLdate = "$Tyear$Tmon$Tmday$Thour$Tmin$Tsec";
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
$RMtarget = ($secX - 21600); # 6 hours ago
($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($RMtarget);
$RMyear = ($RMyear + 1900);
$RMmon++;
if ($RMmon < 10) {$RMmon = "0$RMmon";}
if ($RMmday < 10) {$RMmday = "0$RMmday";}
if ($RMhour < 10) {$RMhour = "0$RMhour";}
if ($RMmin < 10) {$RMmin = "0$RMmin";}
if ($RMsec < 10) {$RMsec = "0$RMsec";}
$RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec";
}
+3 -1
View File
@@ -284,7 +284,7 @@ while($one_day_interval > 0)
@QHphone_number=@MT;
@QHalt_dial=@MT;
##### grab number of QUEUE calls right now and update
$stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type,vac.campaign_id,vac.phone_number,vac.alt_dial FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;";
$stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type,vac.campaign_id,vac.phone_number,vac.alt_dial,vac.callerid FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$vla_qh_ct=$sthA->rows;
@@ -300,6 +300,7 @@ while($one_day_interval > 0)
$QHcampaign_id[$w] = $aryA[5];
$QHphone_number[$w] = $aryA[6];
$QHalt_dial[$w] = $aryA[7];
$QHcall_id[$w] = $aryA[8];
if (length($QHalt_dial[$w]) < 1) {$QHalt_dial[$w] = 'MAIN';}
$w++;
}
@@ -366,6 +367,7 @@ while($one_day_interval > 0)
$launch .= " --campaign=" . $QHcampaign_id[$w];
$launch .= " --uniqueid=" . $QHuniqueid[$w];
$launch .= " --alt_dial=" . $QHalt_dial[$w];
$launch .= " --call_id=" . $QHcall_id[$w];
$launch .= " --function=REMOTE_AGENT_START_CALL_URL";
system($launch . ' &');
+284 -30
View File
@@ -7,11 +7,12 @@
# campaign or in-group that the call came from when sent to the remote agent.
# This script is also used for the Add-Lead-URL feature in In-groups.
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 100622-0929 - First Build
# 100929-0918 - Added function variable and new Add Lead URL function
# 110731-0127 - Added call_id variable and logging
#
$|++;
@@ -20,10 +21,22 @@ use Getopt::Long;
### Initialize date/time vars ###
my $secX = time(); #Start time
($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 = "$year-$mon-$mday $hour:$min:$sec";
### Initialize run-time variables ###
my ($CLOhelp, $SYSLOG,$DB, $DBX);
my ($campaign, $lead_id, $phone_number, $call_type, $user, $uniqueid, $alt_dial, $function);
my ($campaign, $lead_id, $phone_number, $call_type, $user, $uniqueid, $alt_dial, $call_id, $function);
my $FULL_LOG = 1;
$url_function = 'other';
$US='_';
### begin parsing run-time options ###
if (scalar @ARGV) {
@@ -36,6 +49,7 @@ if (scalar @ARGV) {
'user=s' => \$user,
'uniqueid=s' => \$uniqueid,
'alt_dial=s' => \$alt_dial,
'call_id=s' => \$call_id,
'function=s' => \$function,
'debug!' => \$DB,
'debugX!' => \$DBX,
@@ -54,6 +68,7 @@ if (scalar @ARGV) {
print " user: $user\n" if ($user);
print " uniqueid: $uniqueid\n" if ($uniqueid);
print " alt_dial: $alt_dial\n" if ($alt_dial);
print " call_id: $call_id\n" if ($call_id);
print " function: $function\n" if ($function);
print "\n";
}
@@ -70,6 +85,7 @@ if (scalar @ARGV) {
print " [--user] = remote user that received the call\n";
print " [--uniqueid] = uniqueid of the call\n";
print " [--alt_dial] = label of the phone number dialed\n";
print " [--call_id] = call_id or caller_code of the call\n";
print " [--function] = which function is to be run, default is REMOTE_AGENT_START_CALL_URL\n";
print " *REMOTE_AGENT_START_CALL_URL - performs a Start Call URL get for Remote Agent Calls\n";
print " *INGROUP_ADD_LEAD_URL - performs an Add Lead URL get for In-Groups when a lead is added\n";
@@ -109,7 +125,8 @@ foreach(@conf)
$i++;
}
if (!$VARDB_port) {$VARDB_port='3306';}
if (!$VARDB_port) {$VARDB_port='3306';}
if (length($lead_id) > 0)
{
@@ -117,18 +134,18 @@ if (length($lead_id) > 0)
$wgetbin = '';
if ( -e ('/bin/wget')) {$wgetbin = '/bin/wget';}
else
{
if ( -e ('/usr/bin/wget')) {$wgetbin = '/usr/bin/wget';}
else
{
if ( -e ('/usr/bin/wget')) {$wgetbin = '/usr/bin/wget';}
if ( -e ('/usr/local/bin/wget')) {$wgetbin = '/usr/local/bin/wget';}
else
{
if ( -e ('/usr/local/bin/wget')) {$wgetbin = '/usr/local/bin/wget';}
else
{
print "Can't find wget binary! Exiting...\n";
exit;
}
}
{
print "Can't find wget binary! Exiting...\n";
exit;
}
}
}
use Time::HiRes ('gettimeofday','usleep','sleep'); # necessary to have perl sleep command of less than one second
use DBI;
@@ -154,9 +171,9 @@ if (length($lead_id) > 0)
$sthA->finish();
if ($call_type =~ /IN/)
{$stmtG = "SELECT start_call_url,add_lead_url FROM vicidial_inbound_groups where group_id='$campaign';";}
{$stmtG = "SELECT start_call_url,add_lead_url,na_call_url FROM vicidial_inbound_groups where group_id='$campaign';";}
else
{$stmtG = "SELECT start_call_url,8 FROM vicidial_campaigns where campaign_id='$campaign';";}
{$stmtG = "SELECT start_call_url,'NONE',na_call_url FROM vicidial_campaigns where campaign_id='$campaign';";}
$sthA = $dbhA->prepare($stmtG) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtG ", $dbhA->errstr;
$start_url_ct=$sthA->rows;
@@ -165,6 +182,7 @@ if (length($lead_id) > 0)
@aryA = $sthA->fetchrow_array;
$start_call_url = $aryA[0];
$add_lead_url = $aryA[1];
$na_call_url = $aryA[2];
}
$sthA->finish();
@@ -177,6 +195,7 @@ if (length($lead_id) > 0)
$VAR_campaign_id = $campaign;
$VAR_group = $campaign;
$VAR_alt_dial = $alt_dial;
$VAR_call_id = $call_id;
$VAR_list_id = '';
$VAR_phone_code = '';
$VAR_vendor_lead_code = '';
@@ -186,7 +205,7 @@ if (length($lead_id) > 0)
$VAR_did_description = '';
$VAR_closecallid = '';
if ($function=='INGROUP_ADD_LEAD_URL')
if ($function =~ /INGROUP_ADD_LEAD_URL/)
{
##### BEGIN Add Lead URL function #####
$stmtA = "SELECT list_id,phone_code,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';";
@@ -250,19 +269,17 @@ if (length($lead_id) > 0)
$add_lead_url =~ s/--A--did_description--B--/$VAR_did_description/gi;
$add_lead_url =~ s/--A--closecallid--B--/$VAR_closecallid/gi;
$add_lead_url =~ s/--A--uniqueid--B--/$VAR_uniqueid/gi;
$add_lead_url =~ s/--A--call_id--B--/$VAR_call_id/gi;
$add_lead_url =~ s/ /+/gi;
$add_lead_url =~ s/&/\\&/gi;
`$wgetbin -q --output-document=/tmp/ASUtmp $add_lead_url `;
$event_string="$function|$wgetbin -q --output-document=/tmp/ASUtmp $add_lead_url|";
&event_logger;
$parse_url = $add_lead_url;
$url_function = 'add_lead';
##### END Add Lead URL function #####
}
else
elsif ($function =~ /NA_CALL_URL/)
{
##### BEGIN Start Call URL function #####
$stmtA = "SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id';";
##### BEGIN Call URL function #####
$stmtA = "SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,phone_code FROM vicidial_list where lead_id='$lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -297,12 +314,13 @@ if (length($lead_id) > 0)
$VAR_last_local_call_time = $aryA[28];
$VAR_rank = $aryA[29];
$VAR_owner = $aryA[30];
$VAR_phone_code = $aryA[31];
}
$sthA->finish();
if ($start_call_url =~ /--A--user_custom_/)
if ($na_call_url =~ /--A--user_custom_/)
{
$stmtA = "select custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';;";
$stmtA = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -317,6 +335,202 @@ if (length($lead_id) > 0)
}
}
if ($na_call_url =~ /--A--did_/)
{
$stmtA = "SELECT did_id,extension FROM vicidial_did_log where uniqueid='$uniqueid';";
$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;
$VAR_did_id = $aryA[0];
$VAR_did_extension = $aryA[1];
}
$sthA->finish();
$stmtA = "SELECT did_pattern,did_description FROM vicidial_inbound_dids where did_id='$VAR_did_id';";
$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;
$VAR_did_pattern = $aryA[0];
$VAR_did_description = $aryA[1];
}
$sthA->finish();
}
if ($na_call_url =~ /--A--closecallid--B--/)
{
$stmtA = "SELECT closecallid FROM vicidial_closer_log where uniqueid='$uniqueid' order by closecallid limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VAR_closecallid = $aryA[0];
}
$sthA->finish();
}
$na_call_url =~ s/^VAR//gi;
$na_call_url =~ s/--A--lead_id--B--/$VAR_lead_id/gi;
$na_call_url =~ s/--A--entry_date--B--/$VAR_entry_date/gi;
$na_call_url =~ s/--A--modify_date--B--/$VAR_modify_date/gi;
$na_call_url =~ s/--A--status--B--/$VAR_status/gi;
$na_call_url =~ s/--A--dispo--B--/$VAR_status/gi;
$na_call_url =~ s/--A--user--B--/$VAR_user/gi;
$na_call_url =~ s/--A--vendor_id--B--/$VAR_vendor_lead_code/gi;
$na_call_url =~ s/--A--vendor_lead_code--B--/$VAR_vendor_lead_code/gi;
$na_call_url =~ s/--A--source_id--B--/$VAR_source_id/gi;
$na_call_url =~ s/--A--list_id--B--/$VAR_list_id/gi;
$na_call_url =~ s/--A--phone_code--B--/$VAR_phone_code/gi;
$na_call_url =~ s/--A--phone_number--B--/$VAR_phone_number/gi;
$na_call_url =~ s/--A--title--B--/$VAR_title/gi;
$na_call_url =~ s/--A--first_name--B--/$VAR_first_name/gi;
$na_call_url =~ s/--A--middle_initial--B--/$VAR_middle_initial/gi;
$na_call_url =~ s/--A--last_name--B--/$VAR_last_name/gi;
$na_call_url =~ s/--A--address1--B--/$VAR_address1/gi;
$na_call_url =~ s/--A--address2--B--/$VAR_address2/gi;
$na_call_url =~ s/--A--address3--B--/$VAR_address3/gi;
$na_call_url =~ s/--A--city--B--/$VAR_city/gi;
$na_call_url =~ s/--A--state--B--/$VAR_state/gi;
$na_call_url =~ s/--A--province--B--/$VAR_province/gi;
$na_call_url =~ s/--A--postal_code--B--/$VAR_postal_code/gi;
$na_call_url =~ s/--A--country_code--B--/$VAR_country_code/gi;
$na_call_url =~ s/--A--gender--B--/$VAR_gender/gi;
$na_call_url =~ s/--A--date_of_birth--B--/$VAR_date_of_birth/gi;
$na_call_url =~ s/--A--alt_phone--B--/$VAR_alt_phone/gi;
$na_call_url =~ s/--A--email--B--/$VAR_email/gi;
$na_call_url =~ s/--A--security_phrase--B--/$VAR_security_phrase/gi;
$na_call_url =~ s/--A--comments--B--/$VAR_comments/gi;
$na_call_url =~ s/--A--called_count--B--/$VAR_called_count/gi;
$na_call_url =~ s/--A--last_local_call_time--B--/$VAR_last_local_call_time/gi;
$na_call_url =~ s/--A--rank--B--/$VAR_rank/gi;
$na_call_url =~ s/--A--owner--B--/$VAR_owner/gi;
$na_call_url =~ s/--A--dialed_number--B--/$VAR_phone_number/gi;
$na_call_url =~ s/--A--dialed_label--B--/$VAR_alt_dial/gi;
$na_call_url =~ s/--A--user_custom_one--B--/$VAR_user_custom_one/gi;
$na_call_url =~ s/--A--user_custom_two--B--/$VAR_user_custom_two/gi;
$na_call_url =~ s/--A--user_custom_three--B--/$VAR_user_custom_three/gi;
$na_call_url =~ s/--A--user_custom_four--B--/$VAR_user_custom_four/gi;
$na_call_url =~ s/--A--user_custom_five--B--/$VAR_user_custom_five/gi;
$na_call_url =~ s/--A--did_id--B--/$VAR_did_id/gi;
$na_call_url =~ s/--A--did_extension--B--/$VAR_did_extension/gi;
$na_call_url =~ s/--A--did_pattern--B--/$VAR_did_pattern/gi;
$na_call_url =~ s/--A--did_description--B--/$VAR_did_description/gi;
$na_call_url =~ s/--A--closecallid--B--/$VAR_closecallid/gi;
$na_call_url =~ s/--A--uniqueid--B--/$VAR_uniqueid/gi;
$na_call_url =~ s/--A--call_id--B--/$VAR_call_id/gi;
$na_call_url =~ s/ /+/gi;
$na_call_url =~ s/&/\\&/gi;
$parse_url = $na_call_url;
$url_function = 'na_callurl';
}
else
{
##### BEGIN Call URL function #####
$stmtA = "SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,phone_code FROM vicidial_list where lead_id='$lead_id';";
$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;
$VAR_entry_date = $aryA[1];
$VAR_modify_date = $aryA[2];
$VAR_status = $aryA[3];
$VAR_vendor_lead_code = $aryA[5];
$VAR_source_id = $aryA[6];
$VAR_list_id = $aryA[7];
$VAR_title = $aryA[9];
$VAR_first_name = $aryA[10];
$VAR_middle_initial = $aryA[11];
$VAR_last_name = $aryA[12];
$VAR_address1 = $aryA[13];
$VAR_address2 = $aryA[14];
$VAR_address3 = $aryA[15];
$VAR_city = $aryA[16];
$VAR_state = $aryA[17];
$VAR_province = $aryA[18];
$VAR_postal_code = $aryA[19];
$VAR_country_code = $aryA[20];
$VAR_gender = $aryA[21];
$VAR_date_of_birth = $aryA[22];
$VAR_alt_phone = $aryA[23];
$VAR_email = $aryA[24];
$VAR_security_phrase = $aryA[25];
$VAR_comments = $aryA[26];
$VAR_called_count = $aryA[27];
$VAR_last_local_call_time = $aryA[28];
$VAR_rank = $aryA[29];
$VAR_owner = $aryA[30];
$VAR_phone_code = $aryA[31];
}
$sthA->finish();
if ($start_call_url =~ /--A--user_custom_/)
{
$stmtA = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
$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;
$VAR_user_custom_one = $aryA[0];
$VAR_user_custom_two = $aryA[1];
$VAR_user_custom_three = $aryA[2];
$VAR_user_custom_four = $aryA[3];
$VAR_user_custom_five = $aryA[4];
}
}
if ($start_call_url =~ /--A--did_/)
{
$stmtA = "SELECT did_id,extension FROM vicidial_did_log where uniqueid='$uniqueid';";
$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;
$VAR_did_id = $aryA[0];
$VAR_did_extension = $aryA[1];
}
$sthA->finish();
$stmtA = "SELECT did_pattern,did_description FROM vicidial_inbound_dids where did_id='$VAR_did_id';";
$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;
$VAR_did_pattern = $aryA[0];
$VAR_did_description = $aryA[1];
}
$sthA->finish();
}
if ($start_call_url =~ /--A--closecallid--B--/)
{
$stmtA = "SELECT closecallid FROM vicidial_closer_log where uniqueid='$uniqueid' order by closecallid limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VAR_closecallid = $aryA[0];
}
$sthA->finish();
}
$start_call_url =~ s/^VAR//gi;
$start_call_url =~ s/--A--lead_id--B--/$VAR_lead_id/gi;
$start_call_url =~ s/--A--entry_date--B--/$VAR_entry_date/gi;
@@ -327,6 +541,7 @@ if (length($lead_id) > 0)
$start_call_url =~ s/--A--vendor_lead_code--B--/$VAR_vendor_lead_code/gi;
$start_call_url =~ s/--A--source_id--B--/$VAR_source_id/gi;
$start_call_url =~ s/--A--list_id--B--/$VAR_list_id/gi;
$start_call_url =~ s/--A--phone_code--B--/$VAR_phone_code/gi;
$start_call_url =~ s/--A--phone_number--B--/$VAR_phone_number/gi;
$start_call_url =~ s/--A--title--B--/$VAR_title/gi;
$start_call_url =~ s/--A--first_name--B--/$VAR_first_name/gi;
@@ -357,17 +572,56 @@ if (length($lead_id) > 0)
$start_call_url =~ s/--A--user_custom_three--B--/$VAR_user_custom_three/gi;
$start_call_url =~ s/--A--user_custom_four--B--/$VAR_user_custom_four/gi;
$start_call_url =~ s/--A--user_custom_five--B--/$VAR_user_custom_five/gi;
$start_call_url =~ s/--A--did_id--B--/$VAR_did_id/gi;
$start_call_url =~ s/--A--did_extension--B--/$VAR_did_extension/gi;
$start_call_url =~ s/--A--did_pattern--B--/$VAR_did_pattern/gi;
$start_call_url =~ s/--A--did_description--B--/$VAR_did_description/gi;
$start_call_url =~ s/--A--closecallid--B--/$VAR_closecallid/gi;
$start_call_url =~ s/--A--uniqueid--B--/$VAR_uniqueid/gi;
$start_call_url =~ s/--A--call_id--B--/$VAR_call_id/gi;
$start_call_url =~ s/ /+/gi;
$start_call_url =~ s/&/\\&/gi;
$parse_url = $start_call_url;
`$wgetbin -q --output-document=/tmp/ASUtmp $start_call_url `;
if ($function =~ /REMOTE_AGENT_START_CALL_URL/)
{
$url_function = 'start_ra';
$stmtA="UPDATE vicidial_log_extended set start_url_processed='Y' where uniqueid='$uniqueid';";
$affected_rows = $dbhA->do($stmtA);
}
$event_string="$function|$wgetbin -q --output-document=/tmp/ASUtmp $start_call_url|";
&event_logger;
##### END Start Call URL function #####
##### END Call URL function #####
}
### insert a new url log entry
$SQL_log = "$parse_url";
$SQL_log =~ s/;|\|//gi;
$stmtA = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$now_date',url_type='$url_function',url='$SQL_log',url_response='';";
$affected_rows = $dbhA->do($stmtA);
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$url_id = $aryA[0];
}
$sthA->finish();
`$wgetbin -q --output-document=/tmp/ASUtmp$US$uniqueid$US$secX $parse_url `;
$event_string="$function|$wgetbin -q --output-document=/tmp/ASUtmp$US$uniqueid$US$secX $parse_url|";
&event_logger;
### update url log entry
$stmtA = "UPDATE vicidial_url_log SET url_response='/tmp/ASUtmp$US$uniqueid$US$secX' where url_log_id='$url_id';";
$affected_rows = $dbhA->do($stmtA);
}
my $secZ = time();
my $script_time = ($secZ - $secX);
print "DONE execute time: $script_time seconds\n";
@@ -376,8 +630,8 @@ exit 0;
# Program ends.
### Start of subs.
### Start of subroutines
sub event_logger
{
+7 -3
View File
@@ -40,8 +40,12 @@ is blank. You must begin this URL with VAR if you want to use variables, and of
course --A-- and --B-- around the actual variable in the URL where you want to
use it. Here is the list of variables that are available for this function:
lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id,
did_extension, did_pattern, did_description, uniqueid. This feature is only
available for In-Groups.
did_extension, did_pattern, did_description, uniqueid, call_id. This feature is
only available for In-Groups.
No Agent Call URL - This is similar to Dispo Call URL, but it is for calls
that are not sent to agents such as DROPs, No Answers, Busys and timeouts. This
option is available for Campaigns and In-Groups
@@ -64,7 +68,7 @@ user_custom_three, user_custom_four, user_custom_five,
preset_number_a, preset_number_b, preset_number_c, preset_number_d,
preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b,
did_id, did_extension, did_pattern, did_description, closecallid,
xfercallid, agent_log_id, entry_list_id.
xfercallid, agent_log_id, entry_list_id, call_id.
For examples(and sample result URL):
+1
View File
@@ -59,3 +59,4 @@ 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
SVYCLM - Survey sent to Call Menu - Survey outbound campaign status only
MLINAT - Multi-Lead auto-alt-dial lead set to inactive
+28 -4
View File
@@ -819,7 +819,8 @@ dl_diff_target_method ENUM('ADAPT_CALC_ONLY','CALLS_PLACED') default 'ADAPT_CALC
disable_dispo_screen ENUM('DISPO_ENABLED','DISPO_DISABLED','DISPO_SELECT_DISABLED') default 'DISPO_ENABLED',
disable_dispo_status VARCHAR(6) default '',
screen_labels VARCHAR(20) default '--SYSTEM-SETTINGS--',
status_display_fields VARCHAR(30) default 'CALLID'
status_display_fields VARCHAR(30) default 'CALLID',
na_call_url TEXT
);
CREATE TABLE vicidial_lists (
@@ -1008,7 +1009,10 @@ add_lead_url TEXT,
eht_minimum_prompt_filename VARCHAR(255) default '',
eht_minimum_prompt_no_block ENUM('N','Y') default 'N',
eht_minimum_prompt_seconds SMALLINT(5) default '10',
on_hook_ring_time SMALLINT(5) default '15'
on_hook_ring_time SMALLINT(5) default '15',
na_call_url TEXT,
on_hook_cid VARCHAR(30) default 'GENERIC',
group_calldate DATETIME
);
CREATE TABLE vicidial_stations (
@@ -2261,9 +2265,14 @@ server_ip VARCHAR(15),
call_date DATETIME,
lead_id INT(9) UNSIGNED,
caller_code VARCHAR(30) NOT NULL,
custom_call_id VARCHAR(100)
custom_call_id VARCHAR(100),
start_url_processed ENUM('N','Y','U') default 'N',
dispo_url_processed ENUM('N','Y','U','XY','XU') default 'N',
multi_alt_processed ENUM('N','Y','U') default 'N'
);
CREATE INDEX call_date on vicidial_log_extended (call_date);
CREATE TABLE vicidial_lists_fields (
field_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
list_id BIGINT(14) UNSIGNED NOT NULL DEFAULT '0',
@@ -2402,6 +2411,17 @@ index (event_date),
index (campaign_id)
);
CREATE TABLE vicidial_url_log (
url_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
uniqueid VARCHAR(50) NOT NULL,
url_date DATETIME,
url_type VARCHAR(10) default '',
response_sec SMALLINT(5) UNSIGNED default '0',
url TEXT,
url_response TEXT,
index (uniqueid)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY;
@@ -2558,7 +2578,10 @@ ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT N
CREATE TABLE vicidial_outbound_ivr_log_archive LIKE vicidial_outbound_ivr_log;
UPDATE system_settings SET db_schema_version='1290',db_schema_update_date=NOW();
CREATE TABLE vicidial_log_extended_archive LIKE vicidial_log_extended;
CREATE UNIQUE INDEX vlea on vicidial_log_extended_archive (uniqueid,call_date,lead_id);
UPDATE system_settings SET db_schema_version='1291',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
@@ -2567,3 +2590,4 @@ GRANT ALTER,CREATE on asterisk.* TO custom@'%' IDENTIFIED BY 'custom1234';
GRANT ALTER,CREATE on asterisk.* TO custom@localhost IDENTIFIED BY 'custom1234';
flush privileges;
+27
View File
@@ -910,3 +910,30 @@ UPDATE system_settings SET db_schema_version='1289',db_schema_update_date=NOW()
ALTER TABLE vicidial_campaigns MODIFY disable_dispo_screen ENUM('DISPO_ENABLED','DISPO_DISABLED','DISPO_SELECT_DISABLED') default 'DISPO_ENABLED';
UPDATE system_settings SET db_schema_version='1290',db_schema_update_date=NOW() where db_schema_version < 1290;
ALTER TABLE vicidial_log_extended ADD start_url_processed ENUM('N','Y','U') default 'N';
ALTER TABLE vicidial_log_extended ADD dispo_url_processed ENUM('N','Y','U','XY','XU') default 'N';
ALTER TABLE vicidial_log_extended ADD multi_alt_processed ENUM('N','Y','U') default 'N';
CREATE INDEX call_date on vicidial_log_extended (call_date);
ALTER TABLE vicidial_campaigns ADD na_call_url TEXT;
ALTER TABLE vicidial_inbound_groups ADD na_call_url TEXT;
ALTER TABLE vicidial_inbound_groups ADD on_hook_cid VARCHAR(30) default 'GENERIC';
ALTER TABLE vicidial_inbound_groups ADD group_calldate DATETIME;
CREATE TABLE vicidial_url_log (
url_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
uniqueid VARCHAR(50) NOT NULL,
url_date DATETIME,
url_type VARCHAR(10) default '',
response_sec SMALLINT(5) UNSIGNED default '0',
url TEXT,
url_response TEXT,
index (uniqueid)
);
CREATE TABLE vicidial_log_extended_archive LIKE vicidial_log_extended;
CREATE UNIQUE INDEX vlea on vicidial_log_extended_archive (uniqueid,call_date,lead_id);
UPDATE system_settings SET db_schema_version='1291',db_schema_update_date=NOW() where db_schema_version < 1291;
@@ -680,6 +680,13 @@ This optional setting allows you to define additional voicemail settings. It is
The next two settings are also defined in the System Settings section, and you can change them after you define them here. You should set the Default Local GMT to the timezone that your agents want to be in. The Voicemail zone is the listing of voicemail timezones that voicemail messages will be time logged with when new messages are left||
ERROR: You cannot use reserved words for field labels||
The DISPO_SELECT_DISABLED option will not disable the dispo screen completely, but will display the dispo screen without any dispositions, this option should only be used if you want to force your agents to use your CRM software which will send the status to the system through the API||
No Agent Call URL||
This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. dispo can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank||
On-Hook CID||
This option is only used for agents that are logged in with phones that have the agent-on-hook feature enabled. This is the caller ID that will show up on their agent phones when the calls are ringing. GENERIC is a generic RINGAGENT00000000001 type of notification. INGROUP will show only the in-group the call came from. CUSTOMER_PHONE will show only the customer phone number. CUSTOMER_PHONE_RINGAGENT will show RINGAGENT_3125551212 with the RINGAGENT as part of the CID with the customer phone number. CUSTOMER_PHONE_INGROUP will show the first 10 characters of the in-group followed by the customer phone number||
Please wait for the whole page to load before submitting the form||
In-Group Calldate||
This is the last date and time that a call was directed to this inbound group||
lead_report_export.php
+2 -1
View File
@@ -12,10 +12,10 @@
# 101124-0625 - Added lookup_gmt and dialable_gmt functions
# 110630-0026 - Added HIDDEN and READONLY field types
# 110719-0858 - Added HIDEBLOB field type
# 110730-2336 - Added call_id variable
#
##### BEGIN gather values for display of custom list fields for a lead #####
function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
{
@@ -490,6 +490,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
$CFoutput = eregi_replace('--A--closecallid--B--',"$closecallid",$CFoutput);
$CFoutput = eregi_replace('--A--xfercallid--B--',"$xfercallid",$CFoutput);
$CFoutput = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$CFoutput);
$CFoutput = eregi_replace('--A--call_id--B--',"$call_id",$CFoutput);
# custom fields replacement
$o=0;
+71 -3
View File
@@ -288,12 +288,13 @@
# 110626-0127 - Added queuemetrics_pe_phone_append
# 110718-1158 - Added logging of skipped leads
# 110723-2256 - Added disable_alter_custphone HIDE option for call logs display
# 110731-2318 - Added dispo/start call url logging to DB table
#
$version = '2.4-191';
$build = '110718-1158';
$version = '2.4-192';
$build = '110731-2318';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=419;
$mysql_log_count=425;
$one_mysql_log=0;
require("dbconnect.php");
@@ -5503,6 +5504,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_start_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$VDCL_start_call_url);
$VDCL_start_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$VDCL_start_call_url);
$VDCL_start_call_url = eregi_replace('--A--agent_log_id--B--',urlencode(trim($agent_log_id)),$VDCL_start_call_url);
$VDCL_start_call_url = eregi_replace('--A--call_id--B--',urlencode(trim($callerid)),$VDCL_start_call_url);
if (strlen($custom_field_names)>2)
{
@@ -5533,10 +5535,42 @@ if ($ACTION == 'VDADcheckINCOMING')
}
}
$stmt="UPDATE vicidial_log_extended set start_url_processed='Y' where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00420',$user,$server_ip,$session_name,$one_mysql_log);}
$vle_update = mysql_affected_rows($link);
### insert a new url log entry
$SQL_log = "$VDCL_start_call_url";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$NOW_TIME',url_type='start',url='$SQL_log',url_response='';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00421',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
$url_id = mysql_insert_id($link);
$URLstart_sec = date("U");
### grab the call_start_url ###
if ($DB > 0) {echo "$VDCL_start_call_url<BR>\n";}
$SCUfile = file("$VDCL_start_call_url");
if ($DB > 0) {echo "$SCUfile[0]<BR>\n";}
### update url log entry
$URLend_sec = date("U");
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
$SCUfile_contents = implode("", $SCUfile);
$SCUfile_contents = ereg_replace(';','',$SCUfile_contents);
$SCUfile_contents = addslashes($SCUfile_contents);
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00422',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
##### BEGIN special filtering and response for Vtiger account balance function #####
# http://vtiger/vicidial/api.php?mode=callxfer&contactwsid=--A--vendor_lead_code--B--&minuteswarning=3
$stmt = "SELECT enable_vtiger_integration FROM system_settings;";
@@ -7196,6 +7230,7 @@ if ($ACTION == 'updateDISPO')
$dispo_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$dispo_call_url);
$dispo_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$dispo_call_url);
$dispo_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$dispo_call_url);
$dispo_call_url = eregi_replace('--A--call_id--B--',urlencode(trim($MDnextCID)),$dispo_call_url);
if (strlen($FORMcustom_field_names)>2)
{
@@ -7226,10 +7261,43 @@ if ($ACTION == 'updateDISPO')
}
}
$stmt="UPDATE vicidial_log_extended set dispo_url_processed='Y' where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00423',$user,$server_ip,$session_name,$one_mysql_log);}
$vle_update = mysql_affected_rows($link);
### insert a new url log entry
$SQL_log = "$dispo_call_url";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$NOW_TIME',url_type='dispo',url='$SQL_log',url_response='';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00424',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
$url_id = mysql_insert_id($link);
$URLstart_sec = date("U");
### send dispo_call_url ###
if ($DB > 0) {echo "$dispo_call_url<BR>\n";}
$SCUfile = file("$dispo_call_url");
if ($DB > 0) {echo "$SCUfile[0]<BR>\n";}
### update url log entry
$URLend_sec = date("U");
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
$SCUfile_contents = implode("", $SCUfile);
$SCUfile_contents = ereg_replace(';','',$SCUfile_contents);
$SCUfile_contents = addslashes($SCUfile_contents);
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00425',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
$stmt = "SELECT enable_vtiger_integration FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00296',$user,$server_ip,$session_name,$one_mysql_log);}
+5 -2
View File
@@ -13,10 +13,11 @@
# 100712-2322 - Added code to log vicidial_list.entry_list_id field if data altered
# 100916-1749 - Added non-lead variable parsing
# 110719-0856 - Added HIDEBLOB type
# 110730-2335 - Added call_id variable
#
$version = '2.4-5';
$build = '110719-0856';
$version = '2.4-6';
$build = '110730-2335';
require("dbconnect.php");
require_once("functions.php");
@@ -139,6 +140,8 @@ if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];}
elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];}
if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];}
elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];}
if (isset($_GET["call_id"])) {$call_id=$_GET["call_id"];}
elseif (isset($_POST["call_id"])) {$call_id=$_POST["call_id"];}
if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];}
elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];}
+6 -2
View File
@@ -15,10 +15,11 @@
# 100823-1644 - Added DID variables
# 100902-1344 - Added closecallid, xfercallid, agent_log_id variables
# 110420-1201 - Added web_vars variable
# 110730-2339 - Added call_id variable
#
$version = '2.4-9';
$build = '110420-1201';
$version = '2.4-10';
$build = '110730-2339';
require("dbconnect.php");
@@ -186,6 +187,8 @@ if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_u
elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];}
if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];}
elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];}
if (isset($_GET["call_id"])) {$call_id=$_GET["call_id"];}
elseif (isset($_POST["call_id"])) {$call_id=$_POST["call_id"];}
if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];}
elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];}
@@ -475,6 +478,7 @@ $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text
$script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text);
$script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text);
$script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text);
$script_text = eregi_replace('--A--call_id--B--',"$call_id",$script_text);
$script_text = eregi_replace('--A--web_vars--B--',"$web_vars",$script_text);
if ($CF_uses_custom_fields=='Y')
+9 -3
View File
@@ -362,10 +362,11 @@
# 110719-0854 - Removed debug output and small display alignment changes
# 110723-2308 - Complete hiding of phone numbers in logs when alter phone is set to HIDE
# 110730-2240 - Added option to hide dispo statuses, only to be used with API
# 110802-0122 - Added call_id variable
#
$version = '2.4-339c';
$build = '110730-2240';
$version = '2.4-330c';
$build = '110802-0122';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=73;
$one_mysql_log=0;
@@ -9907,6 +9908,7 @@ else
"&xfercallid=" + xfercallid + '' +
"&agent_log_id=" + agent_log_id + '' +
"&entry_list_id=" + document.vicidial_form.entry_list_id.value + '' +
"&call_id=" + LasTCID + '' +
"&web_vars=" + LIVE_web_vars + '' +
webform_session;
@@ -10120,6 +10122,7 @@ else
var SCdid_description = did_description;
var SCclosecallid = closecallid;
var SCxfercallid = xfercallid;
var SCcall_id = LasTCID;
var SCagent_log_id = agent_log_id;
var SCweb_vars = LIVE_web_vars;
@@ -10192,6 +10195,7 @@ else
SCdid_extension = SCdid_extension.replace(RGplus,'+');
SCdid_pattern = SCdid_pattern.replace(RGplus,'+');
SCdid_description = SCdid_description.replace(RGplus,'+');
SCcall_id = SCcall_id.replace(RGplus,'+');
SCweb_vars = SCweb_vars.replace(RGplus,'+');
}
@@ -10267,6 +10271,7 @@ else
var RGclosecallid = new RegExp("--A--closecallid--B--","g");
var RGxfercallid = new RegExp("--A--xfercallid--B--","g");
var RGagent_log_id = new RegExp("--A--agent_log_id--B--","g");
var RGcall_id = new RegExp("--A--call_id--B--","g");
var RGweb_vars = new RegExp("--A--web_vars--B--","g");
encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
@@ -10341,6 +10346,7 @@ else
encoded = encoded.replace(RGclosecallid, SCclosecallid);
encoded = encoded.replace(RGxfercallid, SCxfercallid);
encoded = encoded.replace(RGagent_log_id, SCagent_log_id);
encoded = encoded.replace(RGcall_id, SCcall_id);
encoded = encoded.replace(RGweb_vars, SCweb_vars);
}
decoded=encoded; // simple no ?
@@ -11070,7 +11076,7 @@ function phone_number_format(formatphone) {
var form_entry_list_id = document.vicidial_form.entry_list_id.value;
if (form_entry_list_id.length > 2)
{form_list_id = form_entry_list_id}
document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' +"&agent_log_id=" + agent_log_id + '' +"&web_vars=" + LIVE_web_vars + '';
document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + '' +"&web_vars=" + LIVE_web_vars + '';
form_list_id = '';
form_entry_list_id = '';
}
+237 -174
View File
File diff suppressed because one or more lines are too long