Added No Agent Call URL override option for lists

Added CPD Unknown Action option for campaigns
Added date field for www_phrases and wipe option on perl script
Fixed issue where vicidial_closer_log was not populating list_id

git-svn-id: svn://192.168.202.10@2218 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2014-12-12 02:40:45 +00:00
parent 3e16bb553b
commit fb59dbcb93
14 changed files with 289 additions and 38 deletions
+4
View File
@@ -103,6 +103,10 @@ OTHER CHANGES:
17. Added administrative web interface for managing Languages. The language
features are not active in the agent interface yet.
18. Added No Agent URL option override for Lists
19. Added CPD Unknown Action option to Campaigns
+53 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# VD_amd.agi version 2.8
# VD_amd.agi version 2.10
#
# runs after a call goes through AMD in extensions.conf to send the call on to
# it's proper destination, or when agent sends to VM message
@@ -46,6 +46,7 @@
# 130108-1808 - Changes for Asterisk 1.8 compatibility
# 130210-1113 - Added options for CALLMENU|INGROUP cpd_amd_actions
# 140312-2110 - Added CALLID as recording filename variable
# 141211-1634 - Added cpd_unknown_action campaign option
#
$script = 'VD_amd.agi';
@@ -380,7 +381,7 @@ else
}
### Grab vmail forward message values from the database
$stmtA = "SELECT am_message_exten,amd_send_to_vmx,waitforsilence_options,survey_recording,campaign_rec_filename,cpd_amd_action,amd_inbound_group,amd_callmenu FROM vicidial_campaigns where campaign_id = '$VD_campaign_id' limit 1;";
$stmtA = "SELECT am_message_exten,amd_send_to_vmx,waitforsilence_options,survey_recording,campaign_rec_filename,cpd_amd_action,amd_inbound_group,amd_callmenu,cpd_unknown_action FROM vicidial_campaigns where campaign_id = '$VD_campaign_id' 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;
@@ -396,13 +397,14 @@ else
$cpd_amd_action = $aryA[5];
$amd_inbound_group = $aryA[6];
$amd_callmenu = $aryA[7];
$cpd_unknown_action = $aryA[8];
$sthA->finish();
}
else
{
$sthA->finish();
### Grab vmail forward message values from the database
$stmtA = "SELECT am_message_exten,amd_send_to_vmx,waitforsilence_options,survey_recording,campaign_rec_filename,cpd_amd_action,amd_inbound_group,amd_callmenu FROM vicidial_campaigns where closer_campaigns LIKE \"% $VD_campaign_id %\" order by campaign_id limit 1;";
$stmtA = "SELECT am_message_exten,amd_send_to_vmx,waitforsilence_options,survey_recording,campaign_rec_filename,cpd_amd_action,amd_inbound_group,amd_callmenu,cpd_unknown_action FROM vicidial_campaigns where closer_campaigns LIKE \"% $VD_campaign_id %\" order by campaign_id 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;
@@ -418,6 +420,7 @@ else
$cpd_amd_action = $aryA[5];
$amd_inbound_group = $aryA[6];
$amd_callmenu = $aryA[7];
$cpd_unknown_action = $aryA[8];
$sthA->finish();
}
else
@@ -530,7 +533,7 @@ else
}
### check for list_id override
if ( ($DB_amd_send_to_vmx =~ /Y/) || ($AMDSTATUS =~ /CPD/) )
if ( ( ($DB_amd_send_to_vmx =~ /Y/) || ($AMDSTATUS =~ /CPD/) ) && ($AMDCAUSE !~ /^Unknown|\?\?\?/i) )
{
$am_message_exten_override='';
### gather list_id overrides
@@ -759,6 +762,52 @@ else
### if call menu or in-group method
if ( ($AMDCAUSE =~ /^Unknown|\?\?\?/i) && ($cpd_unknown_action =~ /CALLMENU|INGROUP/) )
{
$DROPexten='';
if ($cpd_unknown_action =~ /CALLMENU/)
{
$DROPexten = 's';
$ext_context = $amd_callmenu;
}
if ($cpd_unknown_action =~ /INGROUP/)
{ # 90009*CL_uk3survy_*8301*10000123*universal*7275551212*1234*"
$S='*';
$fronter='VDAMD';
$DROPexten = "90009*$amd_inbound_group$S$S$VD_lead_id$S$S$VD_phone_number$S$fronter$S";
}
if (length($DROPexten)>0)
{
$stmtA = "UPDATE vicidial_log set status='AMDXFR' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDAD vicidial_log AMDXFR update: |$affected_rows|$uniqueid|"; &agi_output;}
$stmtA = "UPDATE vicidial_list set status='AMDXFR' where lead_id='$VD_lead_id';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list AMDXFR update: |$affected_rows|$uniqueid|"; &agi_output;}
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($AGILOG) {$agi_string = "exiting the VD_AMD app CPD Unknown, transferring call to $DROPexten:$ext_context"; &agi_output;}
print "SET CONTEXT $ext_context\n";
$result = <STDIN>;
checkresult($result);
print "SET EXTENSION $DROPexten\n";
$result = <STDIN>;
checkresult($result);
print "SET PRIORITY 1\n";
$result = <STDIN>;
checkresult($result);
exit;
}
}
if ($cpd_amd_action =~ /CALLMENU|INGROUP/)
{
$DROPexten='';
+9 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_ALL_inbound.agi version 2.8
# agi-VDAD_ALL_inbound.agi version 2.10
#
# runs when a call comes in from an inbound call. This script will
# send the calls out to the closers that are logged in.
@@ -191,6 +191,7 @@
# 140215-2133 - Added several variable options for QM socket URL
# 140312-2111 - Added CALLID as recording filename variable
# 140417-0932 - Added max inbound calls feature
# 141211-2028 - Added list_id to call url functions
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -1010,6 +1011,7 @@ if ($call_handle_method =~ /LOOKUP/)
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=MAIN";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --list_id=" . $list_id;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -1152,6 +1154,7 @@ if ($call_handle_method =~ /LOOKUP/)
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=MAIN";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --list_id=" . $list_id;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -1228,6 +1231,7 @@ else
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=MAIN";
$launch .= " --call_id=" . $XXqueryCID;
$launch .= " --list_id=" . $list_id;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
@@ -2032,7 +2036,7 @@ $Uaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02121'; $MEL_aff_rows=$Uaffected_rows; &mysql_error_logging;
### INSERT vicidial_closer_log record, call is entering the queue
$stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaign_id='$channel_group', call_date='$SQLdate', start_epoch='$now_date_epoch', status='QUEUE', phone_code='$phone_code', phone_number='$phone_number', user='VDCL', processed='N', xfercallid='$insert_xfer_id', uniqueid='$uniqueid', queue_position='$queue_position',called_count='$called_count' $adSQL;";
$stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaign_id='$channel_group', call_date='$SQLdate', start_epoch='$now_date_epoch', status='QUEUE', phone_code='$phone_code', phone_number='$phone_number', user='VDCL', processed='N', xfercallid='$insert_xfer_id', uniqueid='$uniqueid', queue_position='$queue_position',called_count='$called_count',list_id='$list_id' $adSQL;";
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;
@@ -2980,6 +2984,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
@@ -4219,6 +4224,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$launch .= " --campaign=" . $channel_group;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $wait_time_option_callback_list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=INGROUP_ADD_LEAD_URL";
@@ -4650,6 +4656,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --alt_dial=MAIN";
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $hold_time_option_callback_list_id;
$launch .= " --function=INGROUP_ADD_LEAD_URL";
system($launch . ' &');
+94 -7
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_ALL_outbound.agi version 2.8
# agi-VDAD_ALL_outbound.agi version 2.10
#
# runs when an outbound call is answered. This script will
# send the calls out to the agents that are logged in.
@@ -110,6 +110,7 @@
# 140215-2121 - Added several variable options for QM socket URL
# 140312-2112 - Added CALLID as recording filename variable
# 140617-1946 - Added single-digit change to text for TTS
# 141211-1635 - Added cpd_unknown_action campaign option and list_id added to AST_send_URL calls
#
$script = 'agi-VDAD_ALL_outbound.agi';
@@ -627,7 +628,7 @@ if ($VDACaffected_rows > 0)
##### END - Max call stats
### Grab campaign values from the database
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename,safe_harbor_audio,safe_harbor_menu_id,survey_recording,safe_harbor_audio_field,use_other_campaign_dnc FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid,survey_first_audio_file,survey_opt_in_audio_file,survey_ni_audio_file,survey_third_audio_file,survey_fourth_audio_file,extension_appended_cidname,queue_priority,closer_campaigns,queuemetrics_phone_environment,campaign_recording,campaign_rec_filename,safe_harbor_audio,safe_harbor_menu_id,survey_recording,safe_harbor_audio_field,use_other_campaign_dnc,cpd_unknown_action FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -667,6 +668,7 @@ if ($VDACaffected_rows > 0)
$survey_recording = $aryA[26];
$safe_harbor_audio_field = $aryA[27];
$use_other_campaign_dnc = $aryA[28];
$cpd_unknown_action = $aryA[29];
if (length($closer_campaigns) > 2)
{
$closer_campaigns =~ s/^ | -$//gi;
@@ -1120,6 +1122,29 @@ if ($call_handle_method =~ /REMIND/)
}
############# END CPD AMD SECTION ############################
############# BEGIN CPD Unknown SECTION ############################
if ($cpd_unknown_action =~ /DISPO|MESSAGE|CALLMENU|INGROUP/)
{
$stmtA = "SELECT count(*) FROM vicidial_cpd_log where callerid='$callerid' and result IN('Unknown','???') and status='NEW';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$cpd_unknown = $aryA[0];
}
$sthA->finish();
if ($cpd_unknown > 0)
{
&cpd_end_call;
}
}
############# END CPD Unknown SECTION ############################
$stmtA = "UPDATE vicidial_auto_calls set last_update_time='$FDtsSQLdate',stage='REMIND-0' where callerid='$callerid' order by call_time desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01013'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
@@ -1163,7 +1188,7 @@ if ($call_handle_method =~ /SURVEY/)
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01054'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -1178,6 +1203,29 @@ if ($call_handle_method =~ /SURVEY/)
}
############# END CPD AMD SECTION ############################
############# BEGIN CPD Unknown SECTION ############################
if ($cpd_unknown_action =~ /DISPO|MESSAGE|CALLMENU|INGROUP/)
{
$stmtA = "SELECT count(*) FROM vicidial_cpd_log where callerid='$callerid' and result IN('Unknown','???') and status='NEW';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$cpd_unknown = $aryA[0];
}
$sthA->finish();
if ($cpd_unknown > 0)
{
&cpd_end_call;
}
}
############# END CPD Unknown SECTION ############################
$stmtA = "UPDATE vicidial_auto_calls set last_update_time='$FDtsSQLdate',stage='SURVEY-0' where callerid='$callerid' order by call_time desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01014'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
@@ -1779,6 +1827,7 @@ if ($call_handle_method =~ /SURVEY/)
$launch .= " --campaign=" . $VDADcampaign;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
@@ -1806,6 +1855,7 @@ if ($call_handle_method =~ /SURVEY/)
$launch .= " --campaign=" . $VDADcampaign;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
@@ -2008,7 +2058,7 @@ while ($drop_timer <= $DROP_TIME)
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01054'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -2023,6 +2073,28 @@ while ($drop_timer <= $DROP_TIME)
}
############# END CPD AMD SECTION ############################
############# BEGIN CPD Unknown SECTION ############################
if ($cpd_unknown_action =~ /DISPO|MESSAGE|CALLMENU|INGROUP/)
{
$stmtA = "SELECT count(*) FROM vicidial_cpd_log where callerid='$callerid' and result IN('Unknown','???') and status='NEW';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$cpd_unknown = $aryA[0];
}
$sthA->finish();
if ($cpd_unknown > 0)
{
&cpd_end_call;
}
}
############# END CPD Unknown SECTION ############################
@@ -2589,6 +2661,7 @@ while ($drop_timer <= $DROP_TIME)
$launch .= " --campaign=" . $VDADcampaign;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
@@ -3195,6 +3268,7 @@ while ($drop_timer <= $DROP_TIME)
$launch .= " --campaign=" . $VDADcampaign;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=MAIN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
@@ -3682,6 +3756,7 @@ sub cpd_end_call
}
$sthA->finish();
$CPDfound=0;
$CPDunknown=0;
if ($cpd_result =~ /Busy/i) {$vdad_result='CPDB'; $CPDfound++;}
if ($cpd_result =~ /All-Trunks-Busy/i) {$vdad_result='CPDATB'; $CPDfound++;}
if ($cpd_result =~ /No-Answer/i) {$vdad_result='CPDNA'; $CPDfound++;}
@@ -3694,9 +3769,13 @@ sub cpd_end_call
if ($cpd_result =~ /Sit-Unknown/i) {$vdad_result='CPDSUK'; $CPDfound++;}
if ($cpd_result =~ /Sit-Vacant/i) {$vdad_result='CPDSV'; $CPDfound++;}
if ($cpd_result =~ /Fax|Modem/i) {$vdad_result='AFAX'; $CPDfound++;}
if ($cpd_result =~ /^Unknown|\?\?\?/i) {$vdad_result='CPDUK'; $CPDfound++; $CPDunknown++;}
if ($CPDfound < 1) {$vdad_result='AA';}
if ($AGILOG) {$agi_string = "CALL CPD AMD Detected $channel $callerid|$drop_timer|$cpd_result"; &agi_output;}
if ($CPDunknown < 1)
{if ($AGILOG) {$agi_string = "CALL CPD AMD Detected $channel $callerid|$drop_timer|$cpd_result"; &agi_output;}}
else
{if ($AGILOG) {$agi_string = "CALL CPD UNKNOWN Detected $channel $callerid|$drop_timer|$cpd_result"; &agi_output;}}
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
@@ -3741,7 +3820,14 @@ sub cpd_end_call
$DROPexten = "8320";
$AMDSTATUS_set = $AGI->set_variable('AMDSTATUS', "CPDMACHINE");
$AMDCAUSE_set = $AGI->set_variable('AMDCAUSE', $cpd_result);
}
else
{
if ( ($cpd_unknown_action =~ /MESSAGE|CALLMENU|INGROUP/) && ($cpd_result !~ /Fax/i) )
{
$DROPexten = "8320";
$AMDSTATUS_set = $AGI->set_variable('AMDSTATUS', "CPDMACHINE");
$AMDCAUSE_set = $AGI->set_variable('AMDCAUSE', $cpd_result);
}
else
{
@@ -3750,6 +3836,7 @@ sub cpd_end_call
$dbhP=$dbhA; $mysql_count='01052'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAD CPD vac record deleted: |$affected_rows|$VDADcampaign|"; &agi_output;}
}
}
$Euniqueid=$uniqueid;
$Euniqueid =~ s/\.\d+//gi;
@@ -3765,7 +3852,7 @@ sub cpd_end_call
$dbhP=$dbhA; $mysql_count='01051'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAD CPD vicidial_list update: |$affected_rows|$CIDlead_id"; &agi_output;}
$stmtA = "UPDATE vicidial_cpd_log SET status='PROCESSED',cpd_seconds='$drop_timer' where callerid='$callerid' and result IN('Answering-Machine','Fax') and status='NEW';";
$stmtA = "UPDATE vicidial_cpd_log SET status='PROCESSED',cpd_seconds='$drop_timer' where callerid='$callerid' and result IN('Answering-Machine','Fax','Unknown','???') and status='NEW';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01055'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
+7 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-set_variables.agi version 2.4
# agi-set_variables.agi version 2.10
#
# runs after a call_log before call is placed out the trunk and sets all
# vicidial_list fields as variables for the call
@@ -13,12 +13,13 @@
# exten => _91NXXNXXXXXX,n,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor)
# exten => _91NXXNXXXXXX,n,Hangup
#
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 101118-1409 - First build
# 101125-2115 - Added parsing for 3-way calls
# 110404-1604 - Added dial_timeout and cpd_amd_action variables
# 141211-1643 - Added cpd_unknown_action
#
$script = 'agi-set_variables.agi';
@@ -178,6 +179,7 @@ $VDADphone='';
$VDADphone_code='';
$auto_dial_timeout='60';
$cpd_amd_action='DISABLED';
$cpd_unknown_action='DISABLED';
$callerid =~ s/\"//gi;
$callerid =~ s/ .*//gi;
@@ -212,7 +214,7 @@ if ($sthArows > 0)
$sthA->finish();
}
$stmtA = "SELECT dial_timeout,cpd_amd_action FROM vicidial_campaigns where campaign_id='$campaign_id' limit 1;";
$stmtA = "SELECT dial_timeout,cpd_amd_action,cpd_unknown_action FROM vicidial_campaigns where campaign_id='$campaign_id' limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -225,6 +227,7 @@ if ($sthArows > 0)
if ($callerid =~ /^V/)
{
$cpd_amd_action = $aryA[1];
$cpd_unknown_action = $aryA[2];
}
$sthA->finish();
}
@@ -339,6 +342,7 @@ $AGI->exec("EXEC Set(_campaign_id=$campaign_id)");
$AGI->exec("EXEC Set(_dialed_number=$dialed_number)");
$AGI->exec("EXEC Set(_auto_dial_timeout=$auto_dial_timeout)");
$AGI->exec("EXEC Set(_cpd_amd_action=$cpd_amd_action)");
$AGI->exec("EXEC Set(_cpd_unknown_action=$cpd_unknown_action)");
$dbhA->disconnect();
+13 -1
View File
@@ -17,6 +17,7 @@
#
# CHANGES
# 141128-0024 - First build
# 141211-2123 - Added --wipe-www-phrases-table CLI option and insert_date field
#
$secX = time();
@@ -75,6 +76,7 @@ if (length($ARGV[0])>1)
print " [--QXZlengthonly] = print only QXZ function values that include a length spec\n";
print " [--QXZplaceonly] = print only QXZ function values with placeholder variables in them\n";
print " [--conffile=/path/from/root] = define astguiclient.conf config file to use\n";
print " [--wipe-www-phrases-table] = deletes all records in www_phrases database table\n";
print "\n";
exit;
@@ -99,6 +101,8 @@ if (length($ARGV[0])>1)
{$QXZlengthonly=1;}
if ($args =~ /--QXZplaceonly/i) # QXZplaceonly flag
{$QXZplaceonly=1;}
if ($args =~ /--wipe-www-phrases-table/i) # wipewwwphrasestable flag
{$wipewwwphrasestable=1;}
if ($args =~ /--conffile=/i) # CLI defined file path
{
@CLIconffileARY = split(/--conffile=/,$args);
@@ -180,6 +184,14 @@ $event_string = "Existing phrases: $phrase_count";
if ($DB > 0) {print "$event_string\n";}
&event_logger;
if ($wipewwwphrasestable > 0)
{
$stmtA="DELETE FROM www_phrases;";
$affected_rows = $dbhA->do($stmtA);
$event_string = " $affected_rows|$stmtA|";
if ($DBX > 0) {print "$event_string\n";}
&event_logger;
}
$i=0;
$f=0;
@@ -353,7 +365,7 @@ foreach(@FILEparse)
if ($phrase_match < 1)
{
$stmtA="INSERT INTO www_phrases SET phrase_text='$temp_QXZval_strSQL',php_filename='$FILEparseNAME[$f]',php_directory='$FILEparseDIR[$f]',source='www_languages_script';";
$stmtA="INSERT INTO www_phrases SET phrase_text='$temp_QXZval_strSQL',php_filename='$FILEparseNAME[$f]',php_directory='$FILEparseDIR[$f]',source='www_languages_script',insert_date=NOW();";
$affected_rows = $dbhA->do($stmtA);
$QXZinserts++;
+35 -3
View File
@@ -118,6 +118,7 @@
# 131209-1557 - Added called_count logging
# 140426-1941 - Added pause_type to vicidial_agent_log
# 141113-1556 - Added concurrency check
# 141211-2134 - Added na_call_url list_id override option
#
@@ -2766,7 +2767,18 @@ while($one_day_interval > 0)
}
$sthA->finish();
if ( ($ncu_count > 0) || ($ncu_in_count > 0) )
$stmtA = "SELECT count(*) FROM vicidial_lists where na_call_url IS NOT NULL and na_call_url!='' and list_lastcalldate > \"$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_list_count = $aryA[0];
}
$sthA->finish();
if ( ($ncu_count > 0) || ($ncu_in_count > 0) || ($ncu_list_count > 0) )
{
@NCUcamp_id = @MT;
@NCUncurl = @MT;
@@ -2809,6 +2821,24 @@ while($one_day_interval > 0)
}
$sthA->finish();
}
if ($ncu_list_count > 0)
{
$stmtA = "SELECT list_id,na_call_url FROM vicidial_lists where na_call_url IS NOT NULL and na_call_url!='' and list_lastcalldate > \"$RMSQLdate\";";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$NCUlist_count=0;
while ($sthArows > $NCUlist_count)
{
@aryA = $sthA->fetchrow_array;
$NCUlists .= "$aryA[0]|";
$NCUlist_id[$ncu_total_count] = $aryA[0];
$NCUncurl[$ncu_total_count] = $aryA[1];
$NCUlist_count++;
$ncu_total_count++;
}
$sthA->finish();
}
$event_string = " NA-CALL-URL check: $ncu_total_count active, checking unprocessed calls...";
&event_logger;
@@ -2866,12 +2896,12 @@ while($one_day_interval > 0)
{
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]';";
$stmtA = "SELECT campaign_id,status,user,phone_number,'MAIN',list_id 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\";";
$stmtA = "SELECT campaign_id,status,user,phone_number,alt_dial,list_id 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;
@@ -2885,6 +2915,7 @@ while($one_day_interval > 0)
$NCUuser[$vle_count] = $aryA[2];
$NCUphone[$vle_count] = $aryA[3];
$NCUaltdial[$vle_count] = $aryA[4];
$NCUlist[$vle_count] = $aryA[5];
$sthA->finish();
if ($NCUcampaigns =~ /\|$NCUcampaign[$vle_count]\|/i)
@@ -2924,6 +2955,7 @@ while($one_day_interval > 0)
$launch .= " --uniqueid=" . $NCUuniqueid[$vle_count];
$launch .= " --alt_dial=" . $NCUaltdial[$vle_count];
$launch .= " --call_id=" . $NCUcallerid[$vle_count];
$launch .= " --list_id=" . $NCUlist[$vle_count];
$launch .= " --function=NA_CALL_URL";
system($launch . ' &');
+1
View File
@@ -506,6 +506,7 @@ while($one_day_interval > 0)
$launch .= " --uniqueid=" . $QHuniqueid[$w];
$launch .= " --alt_dial=" . $QHalt_dial[$w];
$launch .= " --call_id=" . $QHcall_id[$w];
$launch .= " --list_id=0";
$launch .= " --function=REMOTE_AGENT_START_CALL_URL";
system($launch . ' &');
+24 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# AST_send_URL.pl version 2.6
# AST_send_URL.pl version 2.10
#
# DESCRIPTION:
# This script is spawned for remote agents when the Start Call URL is set in the
@@ -8,7 +8,7 @@
# This script is also used for the Add-Lead-URL feature in In-groups and for
# QM socket-send.
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 100622-0929 - First Build
@@ -16,6 +16,7 @@
# 110731-0127 - Added call_id variable and logging
# 121120-0925 - Added QM socket-send functionality
# 130402-2307 - Added user_group variable
# 141211-1742 - Added list override for no-agent url
#
$|++;
@@ -53,6 +54,7 @@ if (scalar @ARGV) {
'uniqueid=s' => \$uniqueid,
'alt_dial=s' => \$alt_dial,
'call_id=s' => \$call_id,
'list_id:s' => \$list_id,
'function=s' => \$function,
'debug!' => \$DB,
'debugX!' => \$DBX,
@@ -73,6 +75,7 @@ if (scalar @ARGV) {
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 " list_id: $list_id\n" if ($list_id);
print " function: $function\n" if ($function);
print " compat_url: $compat_url\n" if ($compat_url);
print "\n";
@@ -91,6 +94,7 @@ if (scalar @ARGV) {
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 " [--list_id] = list_id of the lead on the call\n";
print " [--compat_url] = full compatible URL to send\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";
@@ -193,6 +197,23 @@ if (length($lead_id) > 0)
}
$sthA->finish();
if ( ($function =~ /NA_CALL_URL/) && (length($list_id) > 1) )
{
$stmtH = "SELECT na_call_url FROM vicidial_lists where list_id='$list_id';";
$sthA = $dbhA->prepare($stmtH) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtH ", $dbhA->errstr;
$list_nacu_url_ct=$sthA->rows;
if ($list_nacu_url_ct > 0)
{
@aryA = $sthA->fetchrow_array;
if (length($aryA[0])>3)
{
$na_call_url = $aryA[0];
}
}
$sthA->finish();
}
$VAR_lead_id = $lead_id;
$VAR_user = $user;
$VAR_phone_number = $phone_number;
@@ -203,7 +224,7 @@ if (length($lead_id) > 0)
$VAR_group = $campaign;
$VAR_alt_dial = $alt_dial;
$VAR_call_id = $call_id;
$VAR_list_id = '';
$VAR_list_id = $list_id;
$VAR_phone_code = '';
$VAR_vendor_lead_code = '';
$VAR_did_id = '';
+1
View File
@@ -1237,6 +1237,7 @@ sub process_request
$launch .= " --campaign=" . $VD_campaign_id;
$launch .= " --uniqueid=" . $uniqueid;
$launch .= " --call_id=" . $VD_callerid;
$launch .= " --list_id=" . $list_id;
$launch .= " --alt_dial=UNKNOWN";
$launch .= " --function=QM_SOCKET_SEND";
$launch .= " --compat_url=" . $compat_url;
+6 -3
View File
@@ -916,7 +916,8 @@ comments_dispo_screen ENUM('DISABLED','ENABLED','REPLACE_CALL_NOTES') default 'D
comments_callback_screen ENUM('DISABLED','ENABLED','REPLACE_CB_NOTES') default 'DISABLED',
qc_comment_history ENUM('CLICK','AUTO_OPEN','CLICK_ALLOW_MINIMIZE','AUTO_OPEN_ALLOW_MINIMIZE') default 'CLICK',
show_previous_callback ENUM('DISABLED','ENABLED') default 'ENABLED',
clear_script ENUM('DISABLED','ENABLED') default 'DISABLED'
clear_script ENUM('DISABLED','ENABLED') default 'DISABLED',
cpd_unknown_action ENUM('DISABLED','DISPO','MESSAGE','CALLMENU','INGROUP') default 'DISABLED'
) ENGINE=MyISAM;
CREATE TABLE vicidial_lists (
@@ -941,7 +942,8 @@ web_form_address TEXT,
web_form_address_two TEXT,
time_zone_setting ENUM('COUNTRY_AND_AREA_CODE','POSTAL_CODE','NANPA_PREFIX','OWNER_TIME_ZONE_CODE') default 'COUNTRY_AND_AREA_CODE',
inventory_report ENUM('Y','N') default 'Y',
expiration_date DATE default '2099-12-31'
expiration_date DATE default '2099-12-31',
na_call_url TEXT
) ENGINE=MyISAM;
CREATE TABLE vicidial_statuses (
@@ -3086,6 +3088,7 @@ phrase_text VARCHAR(10000) default '',
php_filename VARCHAR(255) NOT NULL,
php_directory VARCHAR(255) default '',
source VARCHAR(20) default '',
insert_date DATETIME,
index (phrase_text)
) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
@@ -3352,4 +3355,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1394',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1395',db_schema_update_date=NOW(),reload_timestamp=NOW();
+8
View File
@@ -134,3 +134,11 @@ index (english_text)
) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
UPDATE system_settings SET db_schema_version='1394',db_schema_update_date=NOW() where db_schema_version < 1394;
ALTER TABLE vicidial_campaigns ADD cpd_unknown_action ENUM('DISABLED','DISPO','MESSAGE','CALLMENU','INGROUP') default 'DISABLED';
ALTER TABLE vicidial_lists ADD na_call_url TEXT;
ALTER TABLE www_phrases ADD insert_date DATETIME;
UPDATE system_settings SET db_schema_version='1395',db_schema_update_date=NOW() where db_schema_version < 1395;
+18 -7
View File
File diff suppressed because one or more lines are too long
+11
View File
@@ -29,6 +29,7 @@
# 141124-2231 - Added clear_script
# 141204-0605 - Added enable_languages
# 141204-2209 - Added QXZ function output
# 141211-1647 - Added cpd_unknown_action and lists-na_call_url
#
require("dbconnect_mysqli.php");
@@ -921,6 +922,11 @@ if ($SSoutbound_autodial_active > 0)
<BR>
<B><?php echo _QXZ("CPD AMD Action"); ?> -</B><?php echo _QXZ("If you are using the Sangoma ParaXip Call Progress Detection software then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED. Setting this to INGROUP will send an answering machine to an inbound group. Setting this to CALLMENU will send an answering machine to a Call Menu in the system."); ?>
<BR>
<A NAME="campaigns-cpd_unknown_action">
<BR>
<B><?php echo _QXZ("CPD Unknown Action"); ?> -</B><?php echo _QXZ("If you are using the Sangoma ParaXip Call Progress Detection software and you want to send calls that have an Unknown result to a destination other than an agent, then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED. Setting this to INGROUP will send an answering machine to an inbound group. Setting this to CALLMENU will send an answering machine to a Call Menu in the system."); ?>
<BR>
<A NAME="campaigns-amd_inbound_group">
<BR>
@@ -1853,6 +1859,11 @@ if ($SSqc_features_active > 0)
<BR>
<B><?php echo _QXZ("Web Form Override"); ?> -</B><?php echo _QXZ("This is the custom address that clicking on the WEB FORM button in the agent screen will take you to for calls that come in on this list. If you want to use custom fields in a web form address, you need to add &CF_uses_custom_fields=Y as part of your URL."); ?>
<BR>
<A NAME="lists-na_call_url">
<BR>
<B><?php echo _QXZ("No Agent Call URL"); ?> -</B><?php echo _QXZ("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."); ?>
<BR>
<A NAME="lists-xferconf_a_dtmf">
<BR>