added new method for monitoring in realtime screen
added 4-call-path option for outbound surveys added text-to-speech ability in outbound survey campaigns git-svn-id: svn://192.168.202.10@1099 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -20,6 +20,11 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
\. /path/from/root/extras/upgrade_2.2.0.sql
|
||||
quit
|
||||
|
||||
3. Added new method for monitoring from the Real-time screen using a phone entry
|
||||
|
||||
4. Outbound Survey option for using Cepstral Text-to-speech. Requires some
|
||||
manual configuration and tweaking of TTS scripts.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -348,30 +348,6 @@ if ($dialplan_duplicate_count > 0)
|
||||
exit;
|
||||
}
|
||||
|
||||
### pre-generate Cepstral first and last name as an audio file
|
||||
if ($call_handle_method =~ /SURVEYCAMPCEP/)
|
||||
{
|
||||
$stmtA = "SELECT first_name,last_name FROM vicidial_list where lead_id='$CIDlead_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01057'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
# $survey_customer_nameRAW = "Hello, If this is $aryA[0] $aryA[1] Please press one now ";
|
||||
$survey_customer_nameRAW = "hello, this is a call for $aryA[0] $aryA[1],, if you are $aryA[0] $aryA[1] then press 1 to speak with an agent,, if we have not reached the correct number, please press 2 to have your telephone number removed from our database";
|
||||
$survey_customer_name = $survey_customer_nameRAW;
|
||||
$survey_customer_name =~ s/[^, 0-9a-zA-Z]//gi;
|
||||
$survey_customer_name =~ s/ /\\ /gi;
|
||||
$voice = 'Allison-8kHz';
|
||||
print STDERR "\nGenerating: $survey_customer_name - $voice\n";
|
||||
`$PATHagi/cepstral_generate.pl --debug --voice=$voice --dialog=$survey_customer_name >> $CEPLOGfile`;
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
|
||||
|
||||
### Grab call parameters from vicidial_auto_calls table
|
||||
$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
@@ -406,13 +382,12 @@ if ($affected_rows > 0)
|
||||
$sthA->finish();
|
||||
|
||||
### Grab campaign values from the database
|
||||
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid 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 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;
|
||||
$dbhP=$dbhA; $mysql_count='01007'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBdrop_call_seconds = "$aryA[0]";
|
||||
@@ -431,10 +406,131 @@ if ($affected_rows > 0)
|
||||
$am_message_exten = "$aryA[10]";
|
||||
$three_way_call_cid = "$aryA[11]";
|
||||
$campaign_cid = "$aryA[12]";
|
||||
$rec_count++;
|
||||
$survey_first_audio_file = "$aryA[13]";
|
||||
$survey_opt_in_audio_file = "$aryA[14]";
|
||||
$survey_ni_audio_file = "$aryA[15]";
|
||||
$survey_third_audio_file = "$aryA[16]";
|
||||
$survey_fourth_audio_file = "$aryA[17]";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
### pre-generate Cepstral first and last name as an audio file
|
||||
if ($call_handle_method =~ /SURVEYCAMPCEP/)
|
||||
{
|
||||
$t=0;
|
||||
if ($survey_first_audio_file =~ /^TTS/)
|
||||
{
|
||||
$TTS_prompt[$t] = 'survey_first_audio_file';
|
||||
$TTS_filename[$t] = $survey_first_audio_file;
|
||||
$TTS_filename[$t]=~s/^TTS//gi;
|
||||
$t++;
|
||||
}
|
||||
if ($survey_opt_in_audio_file =~ /^TTS/)
|
||||
{
|
||||
$TTS_prompt[$t] = 'survey_opt_in_audio_file';
|
||||
$TTS_filename[$t] = $survey_opt_in_audio_file;
|
||||
$TTS_filename[$t]=~s/^TTS//gi;
|
||||
$t++;
|
||||
}
|
||||
if ($survey_ni_audio_file =~ /^TTS/)
|
||||
{
|
||||
$TTS_prompt[$t] = 'survey_ni_audio_file';
|
||||
$TTS_filename[$t] = $survey_ni_audio_file;
|
||||
$TTS_filename[$t]=~s/^TTS//gi;
|
||||
$t++;
|
||||
}
|
||||
if ($survey_third_audio_file =~ /^TTS/)
|
||||
{
|
||||
$TTS_prompt[$t] = 'survey_third_audio_file';
|
||||
$TTS_filename[$t] = $survey_third_audio_file;
|
||||
$TTS_filename[$t]=~s/^TTS//gi;
|
||||
$t++;
|
||||
}
|
||||
if ($survey_fourth_audio_file =~ /^TTS/)
|
||||
{
|
||||
$TTS_prompt[$t] = 'survey_fourth_audio_file';
|
||||
$TTS_filename[$t] = $survey_fourth_audio_file;
|
||||
$TTS_filename[$t]=~s/^TTS//gi;
|
||||
$t++;
|
||||
}
|
||||
|
||||
### if there are TTS audio files run this
|
||||
if ($t > 0)
|
||||
{
|
||||
$stmtA = "SELECT first_name,last_name,title FROM vicidial_list where lead_id='$CIDlead_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01057'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$TTS_first_name = $aryA[0];
|
||||
$TTS_last_name = $aryA[1];
|
||||
$TTS_title = $aryA[2];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$s=0;
|
||||
while ($s < $t)
|
||||
{
|
||||
$stmtA = "SELECT tts_text FROM vicidial_tts_prompts where tts_id='$TTS_filename[$s]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01057'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($s < 1) {$hideCLI = '';}
|
||||
else {$hideCLI = '&';}
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$TTS_text[$s] = $aryA[0];
|
||||
$TTS_text[$s] =~ s/--A--first_name--B--/$TTS_first_name/gi;
|
||||
$TTS_text[$s] =~ s/--A--last_name--B--/$TTS_last_name/gi;
|
||||
$TTS_text[$s] =~ s/--A--title--B--/$TTS_title/gi;
|
||||
$TTS_text[$s] =~ s/[^,\.\<\>\'\/\= 0-9a-zA-Z]//gi;
|
||||
$TTS_textRAW[$s] = $TTS_text[$s];
|
||||
$TTS_text[$s] =~ s/ /\\ /gi;
|
||||
$TTS_text[$s] =~ s/\./\\./gi;
|
||||
$TTS_text[$s] =~ s/\=/\\=/gi;
|
||||
$TTS_text[$s] =~ s/\</\\</gi;
|
||||
$TTS_text[$s] =~ s/\>/\\>/gi;
|
||||
$TTS_text[$s] =~ s/\//\\\//gi;
|
||||
$TTS_text[$s] =~ s/\'/\\'/gi;
|
||||
$voice = 'Allison-8kHz';
|
||||
print STDERR "\nGenerating: $TTS_text[$s] - $voice\n";
|
||||
`$PATHagi/cepstral_generate.pl --debug --voice=$voice --dialog=$TTS_text[$s] >> $CEPLOGfile $hideCLI`;
|
||||
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
$enc = md5_hex("$TTS_textRAW[$s]-$voice"); # the hash
|
||||
$enc_ftl = substr($enc, 0, 2); # first letter of hash
|
||||
$TTS_filename_path[$s] = $PATHsounds . "/tts/" . $enc_ftl . "/tts-" . $enc;
|
||||
print STDERR "\nfilename: $TTS_filename_path[$s]\n";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$s++;
|
||||
}
|
||||
|
||||
$s=0;
|
||||
while ($s < $t)
|
||||
{
|
||||
if ($TTS_prompt[$s] =~ /survey_first_audio_file/)
|
||||
{$survey_first_audio_file = $TTS_filename_path[$s];}
|
||||
if ($TTS_prompt[$s] =~ /survey_opt_in_audio_file/)
|
||||
{$survey_opt_in_audio_file = $TTS_filename_path[$s];}
|
||||
if ($TTS_prompt[$s] =~ /survey_ni_audio_file/)
|
||||
{$survey_ni_audio_file = $TTS_filename_path[$s];}
|
||||
if ($TTS_prompt[$s] =~ /survey_third_audio_file/)
|
||||
{$survey_third_audio_file = $TTS_filename_path[$s];}
|
||||
if ($TTS_prompt[$s] =~ /survey_fourth_audio_file/)
|
||||
{$survey_fourth_audio_file = $TTS_filename_path[$s];}
|
||||
$s++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial')";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
@@ -592,7 +688,7 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
### check to see if the SURVEY settings should be pulled from the campaign settings in the database
|
||||
if ($call_handle_method =~ /SURVEYCAMP/)
|
||||
{
|
||||
$stmtA = "SELECT survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir FROM vicidial_campaigns where campaign_id='$VDADcampaign';";
|
||||
$stmtA = "SELECT survey_dtmf_digits,survey_ni_digit,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,survey_third_digit,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_status,survey_fourth_exten 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;
|
||||
@@ -601,17 +697,20 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
|
||||
$survey_first_audio_file = "$aryA[0]";
|
||||
$survey_dtmf_digits = "$aryA[1]";
|
||||
$survey_ni_digit = "$aryA[2]";
|
||||
$survey_opt_in_audio_file = "$aryA[3]";
|
||||
$survey_ni_audio_file = "$aryA[4]";
|
||||
$survey_method = "$aryA[5]";
|
||||
$survey_no_response_action = "$aryA[6]";
|
||||
$survey_ni_status = "$aryA[7]";
|
||||
$survey_response_digit_map = "$aryA[8]";
|
||||
$survey_xfer_exten = "$aryA[9]";
|
||||
$survey_camp_record_dir = "$aryA[10]";
|
||||
$survey_dtmf_digits = "$aryA[0]";
|
||||
$survey_ni_digit = "$aryA[1]";
|
||||
$survey_method = "$aryA[2]";
|
||||
$survey_no_response_action = "$aryA[3]";
|
||||
$survey_ni_status = "$aryA[4]";
|
||||
$survey_response_digit_map = "$aryA[5]";
|
||||
$survey_xfer_exten = "$aryA[6]";
|
||||
$survey_camp_record_dir = "$aryA[7]";
|
||||
$survey_third_digit = "$aryA[8]";
|
||||
$survey_third_status = "$aryA[9]";
|
||||
$survey_third_exten = "$aryA[10]";
|
||||
$survey_fourth_digit = "$aryA[11]";
|
||||
$survey_fourth_status = "$aryA[12]";
|
||||
$survey_fourth_exten = "$aryA[13]";
|
||||
|
||||
@digit_map = split(/\|/,$survey_response_digit_map);
|
||||
|
||||
@@ -620,15 +719,6 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
$sthA->finish();
|
||||
}
|
||||
|
||||
if ($call_handle_method =~ /SURVEYCAMPCEP/)
|
||||
{
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
$enc = md5_hex("$survey_customer_nameRAW-$voice"); # the hash
|
||||
$enc_ftl = substr($enc, 0, 2); # first letter of hash
|
||||
$survey_first_audio_file = $PATHsounds . "/tts/" . $enc_ftl . "/tts-" . $enc;
|
||||
}
|
||||
|
||||
# play the message and let them press a number
|
||||
$digits_to_collect = '1';
|
||||
$opt_code = enter_pin_number($survey_first_audio_file,$survey_dtmf_digits);
|
||||
@@ -723,188 +813,276 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
### third digit option
|
||||
if ($opt_code =~ /$survey_third_digit/)
|
||||
{
|
||||
# they opted in
|
||||
if ( ($opt_code =~ /\d/) || ($survey_no_response_action =~ /OPTOUT/) )
|
||||
{
|
||||
$now_date_epoch = time();
|
||||
$FDtarget = ($now_date_epoch + 60);
|
||||
($Fsec,$Fmin,$Fhour,$Fmday,$Fmon,$Fyear,$Fwday,$Fyday,$Fisdst) = localtime($FDtarget);
|
||||
$Fyear = ($Fyear + 1900);
|
||||
$Fmon++;
|
||||
if ($Fmon < 10) {$Fmon = "0$Fmon";}
|
||||
if ($Fmday < 10) {$Fmday = "0$Fmday";}
|
||||
if ($Fhour < 10) {$Fhour = "0$Fhour";}
|
||||
if ($Fmin < 10) {$Fmin = "0$Fmin";}
|
||||
if ($Fsec < 10) {$Fsec = "0$Fsec";}
|
||||
$FDtsSQLdate = "$Fyear$Fmon$Fmday$Fhour$Fmin$Fsec";
|
||||
if ( $survey_third_audio_file ne "")
|
||||
{
|
||||
$AGI->stream_file($survey_third_audio_file);
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set last_update_time='$FDtsSQLdate' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01017'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_third_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01018'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_third_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_third_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01019'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_third_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if (($use_internal_dnc =~ /Y/) && ($survey_third_status eq "DNC"))
|
||||
{
|
||||
$stmtA = "INSERT INTO vicidial_dnc set phone_number='$VDADphone';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01022'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
|
||||
|
||||
if ( $survey_opt_in_audio_file ne "")
|
||||
$dbhP=$dbhA; $mysql_count='01020'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$AGI->stream_file($survey_opt_in_audio_file);
|
||||
$agi_string = "-- VDAD vicidial_dnc insert: $affected_rows|$VDADphone";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if ($survey_method =~ /VOICEMAIL|EXTENSION|HANGUP/)
|
||||
}
|
||||
if (($use_campaign_dnc =~ /Y/) && ($survey_third_status eq "DNC"))
|
||||
{
|
||||
$stmtA = "INSERT INTO vicidial_campaign_dnc set phone_number='$VDADphone', campaign_id='$VDADcampaign';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01021'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$DROPexten='';
|
||||
if ($survey_method =~ /VOICEMAIL/)
|
||||
$agi_string = "-- VDAD vicidial_campaign_dnc insert: $affected_rows|$VDADphone|$VDADcampaign";
|
||||
&agi_output;
|
||||
}
|
||||
}
|
||||
|
||||
if (length($survey_third_exten) > 0)
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "exiting the VDAD SURVEY app, transferring call to $survey_third_exten"; &agi_output;}
|
||||
print "SET CONTEXT $ext_context\n";
|
||||
checkresult($result);
|
||||
print "SET EXTENSION $survey_third_exten\n";
|
||||
checkresult($result);
|
||||
print "SET PRIORITY 1\n";
|
||||
checkresult($result);
|
||||
}
|
||||
else
|
||||
{$AGI->hangup();}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
### fourth digit option
|
||||
if ($opt_code =~ /$survey_fourth_digit/)
|
||||
{
|
||||
if ( $survey_fourth_audio_file ne "")
|
||||
{
|
||||
$AGI->stream_file($survey_fourth_audio_file);
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01017'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_fourth_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01018'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_fourth_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_fourth_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01019'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_fourth_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if (($use_internal_dnc =~ /Y/) && ($survey_fourth_status eq "DNC"))
|
||||
{
|
||||
$stmtA = "INSERT INTO vicidial_dnc set phone_number='$VDADphone';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01020'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_dnc insert: $affected_rows|$VDADphone";
|
||||
&agi_output;
|
||||
}
|
||||
}
|
||||
if (($use_campaign_dnc =~ /Y/) && ($survey_fourth_status eq "DNC"))
|
||||
{
|
||||
$stmtA = "INSERT INTO vicidial_campaign_dnc set phone_number='$VDADphone', campaign_id='$VDADcampaign';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01021'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_campaign_dnc insert: $affected_rows|$VDADphone|$VDADcampaign";
|
||||
&agi_output;
|
||||
}
|
||||
}
|
||||
|
||||
if (length($survey_fourth_exten) > 0)
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "exiting the VDAD SURVEY app, transferring call to $survey_fourth_exten"; &agi_output;}
|
||||
print "SET CONTEXT $ext_context\n";
|
||||
checkresult($result);
|
||||
print "SET EXTENSION $survey_fourth_exten\n";
|
||||
checkresult($result);
|
||||
print "SET PRIORITY 1\n";
|
||||
checkresult($result);
|
||||
}
|
||||
else
|
||||
{$AGI->hangup();}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
# they opted in
|
||||
if ( ($opt_code =~ /\d/) || ($survey_no_response_action =~ /OPTOUT/) )
|
||||
{
|
||||
$now_date_epoch = time();
|
||||
$FDtarget = ($now_date_epoch + 60);
|
||||
($Fsec,$Fmin,$Fhour,$Fmday,$Fmon,$Fyear,$Fwday,$Fyday,$Fisdst) = localtime($FDtarget);
|
||||
$Fyear = ($Fyear + 1900);
|
||||
$Fmon++;
|
||||
if ($Fmon < 10) {$Fmon = "0$Fmon";}
|
||||
if ($Fmday < 10) {$Fmday = "0$Fmday";}
|
||||
if ($Fhour < 10) {$Fhour = "0$Fhour";}
|
||||
if ($Fmin < 10) {$Fmin = "0$Fmin";}
|
||||
if ($Fsec < 10) {$Fsec = "0$Fsec";}
|
||||
$FDtsSQLdate = "$Fyear$Fmon$Fmday$Fhour$Fmin$Fsec";
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set last_update_time='$FDtsSQLdate' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01022'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
|
||||
|
||||
if ( $survey_opt_in_audio_file ne "")
|
||||
{
|
||||
$AGI->stream_file($survey_opt_in_audio_file);
|
||||
}
|
||||
|
||||
if ($survey_method =~ /VOICEMAIL|EXTENSION|HANGUP/)
|
||||
{
|
||||
$DROPexten='';
|
||||
if ($survey_method =~ /VOICEMAIL/)
|
||||
{
|
||||
$survey_status='SVYVM';
|
||||
if (length($VDADvoicemail_ext)>0)
|
||||
{$DROPexten = "$voicemail_dump_exten$VDADvoicemail_ext";}
|
||||
}
|
||||
if ($survey_method =~ /EXTENSION/)
|
||||
{
|
||||
$survey_status='SVYEXT';
|
||||
if (length($survey_xfer_exten)>0)
|
||||
{
|
||||
$survey_status='SVYVM';
|
||||
if (length($VDADvoicemail_ext)>0)
|
||||
{$DROPexten = "$voicemail_dump_exten$VDADvoicemail_ext";}
|
||||
}
|
||||
if ($survey_method =~ /EXTENSION/)
|
||||
{
|
||||
$survey_status='SVYEXT';
|
||||
if (length($survey_xfer_exten)>0)
|
||||
$DROPexten = "$survey_xfer_exten";
|
||||
|
||||
if ($three_way_call_cid !~ /CUSTOMER/)
|
||||
{
|
||||
$DROPexten = "$survey_xfer_exten";
|
||||
$newcallerid = "\"$campaign_cid <$campaign_cid>\"";
|
||||
$AGI->set_callerid($newcallerid);
|
||||
|
||||
if ($three_way_call_cid !~ /CUSTOMER/)
|
||||
{
|
||||
$newcallerid = "\"$campaign_cid <$campaign_cid>\"";
|
||||
$AGI->set_callerid($newcallerid);
|
||||
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<$VDADphone\>"; &agi_output;}
|
||||
}
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<$VDADphone\>"; &agi_output;}
|
||||
}
|
||||
}
|
||||
if ($survey_method =~ /HANGUP/)
|
||||
{
|
||||
$survey_status='SVYHU';
|
||||
}
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01023'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01024'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if (length($DROPexten) > 0)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER',stage='XFER-0' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01025'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAC XFER status: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
|
||||
|
||||
if ($AGILOG) {$agi_string = "exiting the VDAD SURVEY app, transferring call to $DROPexten"; &agi_output;}
|
||||
print "SET CONTEXT $ext_context\n";
|
||||
checkresult($result);
|
||||
print "SET EXTENSION $DROPexten\n";
|
||||
checkresult($result);
|
||||
print "SET PRIORITY 1\n";
|
||||
checkresult($result);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($survey_method =~ /HANGUP/)
|
||||
{
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01026'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$AGI->hangup();
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($survey_method =~ /HANGUP/)
|
||||
{
|
||||
$survey_status='SVYHU';
|
||||
}
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01023'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if ($survey_method =~ /CAMPREC/)
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01024'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
if ($survey_method =~ /60/)
|
||||
{$timeout=60000;}
|
||||
if ($survey_method =~ /WAV/)
|
||||
{$format='WAV';}
|
||||
if ($survey_method =~ /GSM/)
|
||||
{$format='GSM';}
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$survey_status='SVYREC';
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
if (length($DROPexten) > 0)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER',stage='XFER-0' where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01027'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
$dbhP=$dbhA; $mysql_count='01025'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAC XFER status: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01028'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
if ($AGILOG) {$agi_string = "exiting the VDAD SURVEY app, transferring call to $DROPexten"; &agi_output;}
|
||||
print "SET CONTEXT $ext_context\n";
|
||||
checkresult($result);
|
||||
print "SET EXTENSION $DROPexten\n";
|
||||
checkresult($result);
|
||||
print "SET PRIORITY 1\n";
|
||||
checkresult($result);
|
||||
|
||||
if ( -e ('$survey_camp_record_dir/$VDADcampaign'))
|
||||
{$do_nothing=1;}
|
||||
else
|
||||
{`mkdir -p --mode=0666 $survey_camp_record_dir/$VDADcampaign`;}
|
||||
|
||||
$AGI->stream_file('beep');
|
||||
|
||||
$interrupt_digit = $AGI->record_file("$survey_camp_record_dir/$VDADcampaign/$VDADphone$filedate", "$format", '123456789*#', "$timeout", '0', 1, '10');
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "RECORDING FINISHED: $interrupt_digit|$survey_camp_record_dir/$VDADcampaign/$VDADphone$filedate|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01029'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($survey_method =~ /HANGUP/)
|
||||
{
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01030'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='01026'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
@@ -916,25 +1094,71 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ($survey_method =~ /CAMPREC/)
|
||||
{
|
||||
if ($survey_method =~ /60/)
|
||||
{$timeout=60000;}
|
||||
if ($survey_method =~ /WAV/)
|
||||
{$format='WAV';}
|
||||
if ($survey_method =~ /GSM/)
|
||||
{$format='GSM';}
|
||||
|
||||
$survey_status='SVYREC';
|
||||
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='PM', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01031'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='01027'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: PM|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='$survey_status' where lead_id = '$CIDlead_id';";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01028'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_list update: $survey_status|$affected_rows|$CIDlead_id";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
if ( -e ('$survey_camp_record_dir/$VDADcampaign'))
|
||||
{$do_nothing=1;}
|
||||
else
|
||||
{`mkdir -p --mode=0666 $survey_camp_record_dir/$VDADcampaign`;}
|
||||
|
||||
$AGI->stream_file('beep');
|
||||
|
||||
$interrupt_digit = $AGI->record_file("$survey_camp_record_dir/$VDADcampaign/$VDADphone$filedate", "$format", '123456789*#', "$timeout", '0', 1, '10');
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "RECORDING FINISHED: $interrupt_digit|$survey_camp_record_dir/$VDADcampaign/$VDADphone$filedate|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='$survey_status', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01029'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: $survey_status|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01032'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='01030'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
@@ -946,6 +1170,35 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Euniqueid=$uniqueid;
|
||||
$Euniqueid =~ s/\.\d+//gi;
|
||||
$now_date_epoch = time();
|
||||
$drop_seconds = $now_date_epoch - $start_time_epoch;
|
||||
$stmtA = "UPDATE vicidial_log FORCE INDEX(lead_id) set status='PM', end_epoch='$now_date_epoch', length_in_sec='$drop_seconds', term_reason='CALLER' where lead_id = '$CIDlead_id' and uniqueid LIKE \"$Euniqueid%\";";
|
||||
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01031'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vicidial_log update: PM|$affected_rows|$uniqueid|$drop_seconds|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01032'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG)
|
||||
{
|
||||
$agi_string = "-- VDAD vac record deleted: |$affected_rows|$VDADcampaign|";
|
||||
&agi_output;
|
||||
}
|
||||
|
||||
$AGI->hangup();
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
##### END DO THE SURVEY #####
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# 90401-1347 - Fixed quiet flag
|
||||
# 90417-0519 - Added custom field updates for timezone and last/largest sale amounts
|
||||
# 90423-0453 - Added calls file and hours file reports
|
||||
# 90424-1157 - Added orders file report
|
||||
#
|
||||
|
||||
$secX = time();
|
||||
@@ -122,6 +123,7 @@ if (length($ARGV[0])>1)
|
||||
print " [--vt-sales-update] = updates the Vtiger account custom sales fields based upon today sales order data\n";
|
||||
print " [--vt-sales-update-alldate] = updates the Vtiger account custom sales fields based upon all sales order data\n";
|
||||
print " [--vt-timezone-update] = updates the Vtiger account custom timezone field based upon ViciDial timezone/state\n";
|
||||
print " [--vt-territory-update] = updates the Vtiger account tickersymbol field based upon ViciDial user territory\n";
|
||||
print " report generation options:\n";
|
||||
print " [--report-call-file] = generates a spec call file from vicidial records\n";
|
||||
print " [--report-hours-file] = generates a spec agent hours file from vicidial records\n";
|
||||
@@ -212,6 +214,11 @@ if (length($ARGV[0])>1)
|
||||
$vt_timezone_update=1;
|
||||
if ($q < 1) {print "\n----- VTIGER TIMEZONE FIELD UPDATE -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-vt-territory-update/i)
|
||||
{
|
||||
$vt_territory_update=1;
|
||||
if ($q < 1) {print "\n----- VTIGER USER TERRITORY UPDATE -----\n\n";}
|
||||
}
|
||||
if ($args =~ /--report-call-file/i)
|
||||
{
|
||||
$report_call_file=1;
|
||||
@@ -352,6 +359,7 @@ $g=0; ### number of leads with multi-alt-entries
|
||||
$h=0; ### number of timezone updates
|
||||
$j=0; ### number of saleamount updates
|
||||
$m=0; ### number of exported records to file
|
||||
$n=0; ### number of territory updates
|
||||
|
||||
|
||||
### open the output file for writing ###
|
||||
@@ -373,6 +381,9 @@ if ($report_orders_file > 0)
|
||||
open(OFout, ">$VTofWEBfile")
|
||||
|| die "Can't open $VTofWEBfile: $!\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
##### BEGIN REPORT HOURS FILE #####
|
||||
if ($report_hours_file > 0)
|
||||
{
|
||||
@@ -439,7 +450,7 @@ if ($report_hours_file > 0)
|
||||
if ($DB) {print "printing $last_user|$Lrep\n";}
|
||||
|
||||
if ($w > 0)
|
||||
{print HFout "$Lrep,$TODAY,4,15,$L_ob_talk,$L_ib_talk,$L_acw,$L_onhook,$L_train,$L_break,$L_wait\n";}
|
||||
{print HFout "$last_user,$TODAY,4,15,$L_ob_talk,$L_ib_talk,$L_acw,$L_onhook,$L_train,$L_break,$L_wait\n";}
|
||||
$last_user = $user[$w];
|
||||
$Lrep=$rep[$w];
|
||||
$L_ob_talk=0;
|
||||
@@ -676,6 +687,79 @@ while ($sthBrowsC > $i)
|
||||
|
||||
|
||||
|
||||
##### BEGIN USER TERRITORY UPDATE #####
|
||||
if ($vt_territory_update > 0)
|
||||
{
|
||||
$stmtB="SELECT tickersymbol from vtiger_account where accountid='$crmid[$i]';";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$territory = $aryB[0];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if (length($territory)>0)
|
||||
{
|
||||
$VL_exists=0;
|
||||
$stmtA = "SELECT count(*) FROM vicidial_users where user_code='$territory';";
|
||||
$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;
|
||||
$VL_exists = "$aryA[0]";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($VL_exists > 0)
|
||||
{
|
||||
$user='';
|
||||
$stmtA = "SELECT user FROM vicidial_users where user_code='$territory';";
|
||||
$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;
|
||||
$user = "$aryA[0]";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if (length($territory)>0)
|
||||
{
|
||||
$user_id='';
|
||||
$stmtB="SELECT id from vtiger_users where user_name='$user';";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$user_id = $aryB[0];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if (length($user_id)>0)
|
||||
{
|
||||
$stmtB = "UPDATE vtiger_crmentity SET smownerid='$user_id' where accountid='$crmid[$i]';";
|
||||
if ($T < 1) {$affected_rowsB = $dbhB->do($stmtB) or die "Couldn't execute query: |$stmtB|\n";}
|
||||
if($DB){print "|$affected_rowsB|$stmtB|\n";}
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
##### END USER TERRITORY UPDATE #####
|
||||
|
||||
|
||||
|
||||
##### BEGIN SALE AMOUNT UPDATE #####
|
||||
if ( ( ($vt_sales_update > 0) || ($vt_sales_update_alldate > 0) ) && ( ($vt_last_saleamount_field_exists > 0) && ($vt_largest_saleamount_field_exists > 0) ) )
|
||||
{
|
||||
@@ -752,9 +836,9 @@ while ($sthBrowsC > $i)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$website = $aryB[0];
|
||||
@webARY = split(/-/,$website);
|
||||
$account = $webARY[0];
|
||||
$sequence = $webARY[1];
|
||||
@webARY = split(/-/,$website);
|
||||
$account = $webARY[0];
|
||||
$sequence = $webARY[1];
|
||||
$territory = $aryB[1];
|
||||
$business_line = $aryB[2];
|
||||
}
|
||||
@@ -830,7 +914,7 @@ while ($sthBrowsC > $i)
|
||||
if ($call_type =~ /AUTO/) {$ct='3';}
|
||||
else {$ct='2';}
|
||||
|
||||
print CFout "$transaction,15,$rep,$account,$sequence,$territory,$phone,$disposition,$call_length,$call_date,$ct\n";
|
||||
print CFout "$transaction,15,$user,$account,$sequence,$territory,$phone,$disposition,$call_length,$call_date,$ct\n";
|
||||
$m++;
|
||||
$w++;
|
||||
}
|
||||
@@ -856,7 +940,7 @@ while ($sthBrowsC > $i)
|
||||
$call_date = "$aryA[6]";
|
||||
$call_type = "$aryA[7]";
|
||||
|
||||
print CFout "$transaction,15,$rep,$account,$sequence,$territory,$phone,$disposition,$call_length,$call_date,1\n";
|
||||
print CFout "$transaction,15,$user,$account,$sequence,$territory,$phone,$disposition,$call_length,$call_date,1\n";
|
||||
$m++;
|
||||
$w++;
|
||||
}
|
||||
@@ -872,6 +956,89 @@ while ($sthBrowsC > $i)
|
||||
##### BEGIN REPORT ORDERS FILE #####
|
||||
if ($report_orders_file > 0)
|
||||
{
|
||||
$VS_exists=0;
|
||||
$stmtB="SELECT count(*) from vtiger_salesorder where accountid='$crmid[$i]' and duedate > \"$TODAY 00:00:00\" order by duedate;";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$VS_exists = $aryB[0];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($VS_exists > 0)
|
||||
{
|
||||
$stmtB="SELECT website,phone,accountname,ownership,siccode from vtiger_account where accountid='$crmid[$i]';";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$website = $aryB[0];
|
||||
@webARY = split(/-/,$website);
|
||||
$account = $webARY[0];
|
||||
$sequence = $webARY[1];
|
||||
$phone = $aryB[1];
|
||||
$company = $aryB[2];
|
||||
$ownership = $aryB[3];
|
||||
@ownARY = split(/ /,$ownership);
|
||||
$first_name = $ownARY[0];
|
||||
$last_name = $ownARY[1];
|
||||
$VCstatus = $aryB[4];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$stmtA = "SELECT status FROM vicidial_statuses where status_name='$VCstatus';";
|
||||
$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;
|
||||
$VCstatus = "$aryA[0]";
|
||||
$sthA->finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sthA->finish();
|
||||
$stmtA = "SELECT status FROM vicidial_campaign_statuses where status_name='$VCstatus';";
|
||||
$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;
|
||||
$VCstatus = "$aryA[0]";
|
||||
$sthA->finish();
|
||||
}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$k=0;
|
||||
$stmtB="SELECT salesorderid,total,duedate from vtiger_salesorder where accountid='$crmid[$i]' and duedate > \"$TODAY 00:00:00\" order by duedate;";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
while ($sthBrows > $k)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$salesorderid = $aryB[0];
|
||||
$total = $aryB[1];
|
||||
chop($total);
|
||||
$duedate = $aryB[2];
|
||||
|
||||
print OFout "$salesorderid,$phone,$account,$sequence,$company,$first_name,$last_name,$VCstatus,$duedate,$total\n";
|
||||
$m++;
|
||||
$k++;
|
||||
}
|
||||
$sthB->finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1023,6 +1190,7 @@ while ($sthBrowsC > $i)
|
||||
{$Falert .= "PHONE DUPLICATES: $f\n";}
|
||||
$Falert .= "TIMEZONE UPDATES: $h\n";
|
||||
$Falert .= "SALE AMOUNT UPDATES:$j\n";
|
||||
$Falert .= "TERRITORY UPDATES: $n\n";
|
||||
$Falert .= "REPORT RECORDS: $m\n";
|
||||
|
||||
if ($q < 1) {print "$Falert";}
|
||||
|
||||
@@ -15,6 +15,10 @@ New scripts:
|
||||
/vicidial/non_agent_api.php - the script that is accessed to execute commands
|
||||
|
||||
|
||||
Changes:
|
||||
80724-1723 - First build
|
||||
90428-0208 - Added blind_monitor function
|
||||
|
||||
|
||||
|
||||
API Functions: ('function' variable)
|
||||
@@ -35,10 +39,43 @@ VERSION: 2.0.5-4|BUILD: 80910-0020|DATE: 2008-09-10 00:26:43|EPOCH: 1221020803
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
blind_monitor - calls user-defined phone and places them in session as blind monitor
|
||||
|
||||
NOTE: api user for this function must have user_level set to 7 or higher
|
||||
|
||||
REQUIRED FIELDS-
|
||||
phone_login - alpha-numeric, no spaces or special characters allowed
|
||||
session_id - must be all numbers, 7 digits
|
||||
server_ip - must be all numbers and dots, max 15 characters
|
||||
source - description of what originated the API call (maximum 20 characters)
|
||||
stage - MONITOR, BARGE or HIJACK, default is MONITOR
|
||||
(HIJACK option is not currently functional)
|
||||
|
||||
|
||||
Example URL strings for API calls:
|
||||
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=blind_monitor&phone_login=350a&session_id=8600051&server_ip=10.10.10.16&stage=MONITOR
|
||||
|
||||
Example responses:
|
||||
SUCCESS: blind_monitor HAS BEEN LAUNCHED - 350a|010*010*010*017*350|8600051
|
||||
|
||||
ERROR: blind_monitor INVALID PHONE LOGIN - 350q
|
||||
|
||||
ERROR: blind_monitor INVALID SESSION ID - 8602051
|
||||
|
||||
ERROR: blind_monitor USER DOES NOT HAVE PERMISSION TO BLIND MONITOR - 6666|0
|
||||
|
||||
ERROR: NO FUNCTION SPECIFIED
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
add_lead - adds a new lead to the vicidial_list table with several fields and options
|
||||
|
||||
NOTE: api user for this function must have modify_leads set to 1
|
||||
NOTE: api user for this function must have modify_leads set to 1 and user_level
|
||||
must be set to 8 or higher
|
||||
|
||||
REQUIRED FIELDS-
|
||||
phone_number - must be all numbers, 6-16 digits
|
||||
|
||||
@@ -634,7 +634,15 @@ cpd_amd_action ENUM('DISABLED','DISPO','MESSAGE') default 'DISABLED',
|
||||
agent_allow_group_alias ENUM('Y','N') default 'N',
|
||||
default_group_alias VARCHAR(30) default '',
|
||||
vtiger_search_dead ENUM('DISABLED','ASK','RESURRECT') default 'ASK',
|
||||
vtiger_status_call ENUM('Y','N') default 'N'
|
||||
vtiger_status_call ENUM('Y','N') default 'N',
|
||||
survey_third_digit VARCHAR(1) default '',
|
||||
survey_third_audio_file VARCHAR(50) default 'US_thanks_no_contact',
|
||||
survey_third_status VARCHAR(6) default 'NI',
|
||||
survey_third_exten VARCHAR(20) default '8300',
|
||||
survey_fourth_digit VARCHAR(1) default '',
|
||||
survey_fourth_audio_file VARCHAR(50) default 'US_thanks_no_contact',
|
||||
survey_fourth_status VARCHAR(6) default 'NI',
|
||||
survey_fourth_exten VARCHAR(20) default '8300'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists (
|
||||
@@ -1085,7 +1093,8 @@ vtiger_pass VARCHAR(50),
|
||||
vtiger_url VARCHAR(255),
|
||||
qc_features_active ENUM('1','0') default '0',
|
||||
outbound_autodial_active ENUM('1','0') default '1',
|
||||
outbound_calls_per_second SMALLINT(3) UNSIGNED default '40'
|
||||
outbound_calls_per_second SMALLINT(3) UNSIGNED default '40',
|
||||
enable_tts_integration ENUM('0','1') default '0'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -1455,6 +1464,12 @@ index (user),
|
||||
index (call_date)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_tts_prompts (
|
||||
tts_id VARCHAR(50) PRIMARY KEY NOT NULL,
|
||||
tts_name VARCHAR(100),
|
||||
active ENUM('Y','N'),
|
||||
tts_text TEXT
|
||||
);
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||
|
||||
@@ -1551,7 +1566,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number);
|
||||
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
|
||||
CREATE INDEX comment_a on live_inbound_log (comment_a);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1138';
|
||||
UPDATE system_settings SET db_schema_version='1139';
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -30,3 +30,24 @@ ALTER TABLE vicidial_users ADD user_code VARCHAR(100) default '';
|
||||
ALTER TABLE vicidial_users ADD territory VARCHAR(100) default '';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1138';
|
||||
|
||||
ALTER TABLE vicidial_campaigns ADD survey_third_digit VARCHAR(1) default '';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_third_audio_file VARCHAR(50) default 'US_thanks_no_contact';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_third_status VARCHAR(6) default 'NI';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_third_exten VARCHAR(20) default '8300';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_fourth_digit VARCHAR(1) default '';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_fourth_audio_file VARCHAR(50) default 'US_thanks_no_contact';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_fourth_status VARCHAR(6) default 'NI';
|
||||
ALTER TABLE vicidial_campaigns ADD survey_fourth_exten VARCHAR(20) default '8300';
|
||||
|
||||
ALTER TABLE system_settings ADD enable_tts_integration ENUM('0','1') default '0';
|
||||
|
||||
CREATE TABLE vicidial_tts_prompts (
|
||||
tts_id VARCHAR(50) PRIMARY KEY NOT NULL,
|
||||
tts_name VARCHAR(100),
|
||||
active ENUM('Y','N'),
|
||||
tts_text TEXT
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1139';
|
||||
|
||||
|
||||
@@ -17,6 +17,20 @@ There are also 5 additional settings that will define the kind of status: sale,
|
||||
If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds||
|
||||
Email, User Code and Territory||
|
||||
These are optional fields||
|
||||
All options except for the Not Interested, Third and Fourth digit options will move on to the Survey Method call path||
|
||||
Survey Third Digit||
|
||||
This allows for a third call path if the Third digit as defined in this field is pressed by the customer||
|
||||
Survey Fourth Digit||
|
||||
This allows for a fourth call path if the Fourth digit as defined in this field is pressed by the customer||
|
||||
Survey Third Audio File||
|
||||
Survey Fourth Audio File||
|
||||
This is the third audio file to be played upon the selection by the customer of the Third Digit option||
|
||||
Survey Third Status||
|
||||
Survey Fourth Status||
|
||||
This is the third status used for the call upon the selection by the customer of the Third Digit option||
|
||||
Survey Third Extension||
|
||||
Survey Fourth Extension||
|
||||
This is the third extension used for the call upon the selection by the customer of the Third Digit option. Default is 8300 which immediately hangs up the call after the Audio File message is played||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -3548,7 +3548,7 @@ if ($ACTION == 'updateDISPO')
|
||||
$status_name = $row[0];
|
||||
}
|
||||
}
|
||||
if (strlen($dispo_choice) < 1) {$status_name = $dispo_chioce;}
|
||||
if (strlen($status_name) < 1) {$status_name = $dispo_chioce;}
|
||||
|
||||
### connect to your vtiger database
|
||||
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
|
||||
|
||||
@@ -45,10 +45,11 @@
|
||||
# 90105-1153 - Changed monitor links to use 0 prefix instead of 6
|
||||
# 90202-0108 - Changed options to pop-out frame, added outbound_autodial_active option
|
||||
# 90310-0906 - Added admin header
|
||||
# 90428-0727 - Changed listen and barge to use the API and manager must enter phone
|
||||
#
|
||||
|
||||
$version = '2.0.5-36';
|
||||
$build = '90310-0906';
|
||||
$version = '2.0.5-37';
|
||||
$build = '90428-0727';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -97,6 +98,11 @@ if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdispl
|
||||
elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];}
|
||||
if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];}
|
||||
elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];}
|
||||
if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"];}
|
||||
elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];}
|
||||
if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];}
|
||||
elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];}
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -115,6 +121,7 @@ while ($i < $qm_conf_ct)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if (!isset($RR)) {$RR=40;}
|
||||
if (!isset($group)) {$group='';}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
@@ -177,11 +184,18 @@ return false;
|
||||
|
||||
$load_ave = get_server_load(true);
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$NOW_DAY = date("Y-m-d");
|
||||
$NOW_HOUR = date("H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$epochSIXhoursAGO = ($STARTtime - 21600);
|
||||
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -195,17 +209,18 @@ $auth=$row[0];
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$NOW_DAY = date("Y-m-d");
|
||||
$NOW_HOUR = date("H:i:s");
|
||||
$STARTtime = date("U");
|
||||
$epochSIXhoursAGO = ($STARTtime - 21600);
|
||||
$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
|
||||
# and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) )
|
||||
if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) )
|
||||
{
|
||||
$stmt="select phone_login from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active='Y';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$monitor_phone = $row[0];
|
||||
}
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -306,6 +321,26 @@ $select_list .= "<option value=\"O\"";
|
||||
$select_list .= ">Only</option>";
|
||||
$select_list .= "</SELECT><BR><BR>";
|
||||
|
||||
$select_list .= " Monitor: <SELECT SIZE=1 NAME=monitor_active>";
|
||||
$select_list .= "<option value=\"\"";
|
||||
if (strlen($monitor_active) < 2) {$select_list .= " selected";}
|
||||
$select_list .= ">NONE</option>";
|
||||
$select_list .= "<option value=\"MONITOR\"";
|
||||
if ($monitor_active=='MONITOR') {$select_list .= " selected";}
|
||||
$select_list .= ">MONITOR</option>";
|
||||
$select_list .= "<option value=\"BARGE\"";
|
||||
if ($monitor_active=='BARGE') {$select_list .= " selected";}
|
||||
$select_list .= ">BARGE</option>";
|
||||
#$select_list .= "<option value=\"HIJACK\"";
|
||||
# if ($monitor_active=='HIJACK') {$select_list .= " selected";}
|
||||
#$select_list .= ">HIJACK</option>";
|
||||
$select_list .= "</SELECT><BR>";
|
||||
|
||||
$select_list .= "Phone: ";
|
||||
$select_list .= "<INPUT type=text size=10 maxlength=20 NAME=monitor_phone VALUE=\"$monitor_phone\">";
|
||||
$select_list .= "<BR><BR>";
|
||||
|
||||
|
||||
$select_list .= "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
$select_list .= "</TD></TR>";
|
||||
$select_list .= "<TR><TD ALIGN=CENTER>";
|
||||
@@ -325,6 +360,9 @@ $open_list = "<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#D9E6FE\"><
|
||||
<script language="Javascript">
|
||||
var select_list = '<? echo $select_list ?>';
|
||||
var open_list = '<? echo $open_list ?>';
|
||||
var monitor_phone = '<? echo $monitor_phone ?>';
|
||||
var user = '<? echo $PHP_AUTH_USER ?>';
|
||||
var pass = '<? echo $PHP_AUTH_PW ?>';
|
||||
|
||||
// functions to hide and show different DIVs
|
||||
function openDiv(divvar)
|
||||
@@ -335,6 +373,53 @@ $open_list = "<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#D9E6FE\"><
|
||||
{
|
||||
document.getElementById(divvar).innerHTML = open_list;
|
||||
}
|
||||
// function to launch monitoring calls
|
||||
function send_monitor(session_id,server_ip,stage)
|
||||
{
|
||||
// alert(session_id + "|" + server_ip + "|" + monitor_phone + "|" + stage + "|" + user);
|
||||
var xmlhttp=false;
|
||||
/*@cc_on @*/
|
||||
/*@if (@_jscript_version >= 5)
|
||||
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
||||
// and security blocked creation of the objects.
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
xmlhttp = false;
|
||||
}
|
||||
}
|
||||
@end @*/
|
||||
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
var monitorQuery = "source=realtime&function=blind_monitor&user=" + user + "&pass=" + pass + "&phone_login=" + monitor_phone + "&session_id=" + session_id + '&server_ip=' + server_ip + '&stage=' + stage;
|
||||
xmlhttp.open('POST', 'non_agent_api.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(monitorQuery);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
// alert(xmlhttp.responseText);
|
||||
var Xoutput = null;
|
||||
Xoutput = xmlhttp.responseText;
|
||||
var regXFerr = new RegExp("ERROR","g");
|
||||
var regXFscs = new RegExp("SUCCESS","g");
|
||||
if (Xoutput.match(regXFerr))
|
||||
{alert(xmlhttp.responseText);}
|
||||
if (Xoutput.match(regXFscs))
|
||||
{alert("SUCCESS: calling " + monitor_phone);}
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<STYLE type="text/css">
|
||||
@@ -389,7 +474,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$campaign_allow_inbound = $row[0];
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB$groupQS&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">\n";
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB$groupQS&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">\n";
|
||||
echo "<TITLE>VICIDIAL: Time On VDAD Campaign: $group</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
|
||||
$short_header=1;
|
||||
@@ -418,9 +503,9 @@ echo "<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#D9E6FE\"><TR><TD A
|
||||
echo "<a href=\"#\" onclick=\"openDiv('campaign_select_list');\">Choose Report Display Options</a>";
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</span>\n";
|
||||
echo "<a href=\"$PHP_SELF?RR=4000$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">STOP</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?RR=40$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">SLOW</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?RR=4$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">GO</a>";
|
||||
echo "<a href=\"$PHP_SELF?RR=4000$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">STOP</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?RR=40$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">SLOW</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?RR=4$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">GO</a>";
|
||||
if (eregi('ALL-ACTIVE',$group_string))
|
||||
{
|
||||
echo " <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";
|
||||
@@ -892,59 +977,59 @@ echo "$ingroup_detail";
|
||||
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW MORE</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>+ VIEW MORE</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW LESS</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>+ VIEW LESS</font></a>";
|
||||
}
|
||||
if ($UGdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>HIDE USER GROUP</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>HIDE USER GROUP</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>VIEW USER GROUP</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>VIEW USER GROUP</font></a>";
|
||||
}
|
||||
if ($UidORname>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>SHOW AGENT ID</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW AGENT ID</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>SHOW AGENT NAME</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW AGENT NAME</font></a>";
|
||||
}
|
||||
if ($SERVdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>HIDE SERVER INFO</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>HIDE SERVER INFO</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>SHOW SERVER INFO</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW SERVER INFO</font></a>";
|
||||
}
|
||||
if ($CALLSdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>HIDE WAITING CALLS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>HIDE WAITING CALLS</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>SHOW WAITING CALLS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW WAITING CALLS</font></a>";
|
||||
}
|
||||
if ($PHONEdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=0&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>HIDE PHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=0&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>HIDE PHONES</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=1&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>SHOW PHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=1&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW PHONES</font></a>";
|
||||
}
|
||||
if ($CUSTPHONEdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=0&with_inbound=$with_inbound\"><font size=1>HIDE CUSTPHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=0&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>HIDE CUSTPHONES</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=1&with_inbound=$with_inbound\"><font size=1>SHOW CUSTPHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=1&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\"><font size=1>SHOW CUSTPHONES</font></a>";
|
||||
}
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
@@ -1170,11 +1255,11 @@ $HTbegin = "|";
|
||||
$HDstation = "------------+";
|
||||
$HTstation = " STATION |";
|
||||
$HDphone = "------------+";
|
||||
$HTphone = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">PHONE</a> |";
|
||||
$HTphone = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">PHONE</a> |";
|
||||
$HDuser = "--------------------+";
|
||||
$HTuser = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">USER</a> |";
|
||||
$HTuser = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">USER</a> |";
|
||||
$HDusergroup = "--------------+";
|
||||
$HTusergroup = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">USER GROUP</a> |";
|
||||
$HTusergroup = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">USER GROUP</a> |";
|
||||
$HDsessionid = "------------------+";
|
||||
$HTsessionid = " SESSIONID |";
|
||||
$HDbarge = "-------+";
|
||||
@@ -1188,9 +1273,9 @@ $HTserver_ip = " SERVER IP |";
|
||||
$HDcall_server_ip = "-----------------+";
|
||||
$HTcall_server_ip = " CALL SERVER IP |";
|
||||
$HDtime = "---------+";
|
||||
$HTtime = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">MM:SS</a> |";
|
||||
$HTtime = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">MM:SS</a> |";
|
||||
$HDcampaign = "------------+";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">CAMPAIGN</a> |";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone\">CAMPAIGN</a> |";
|
||||
$HDcalls = "-------+";
|
||||
$HTcalls = " CALLS |";
|
||||
$HDpause = '';
|
||||
@@ -1218,12 +1303,12 @@ if ($UGdisplay < 1)
|
||||
$HDusergroup = '';
|
||||
$HTusergroup = '';
|
||||
}
|
||||
if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) )
|
||||
if ( ($SIPmonitorLINK<1) and ($IAXmonitorLINK<1) and (strlen($monitor_active)<5) )
|
||||
{
|
||||
$HDsessionid = "-----------+";
|
||||
$HTsessionid = " SESSIONID |";
|
||||
}
|
||||
if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) )
|
||||
if ( ($SIPmonitorLINK<2) and ($IAXmonitorLINK<2) and (strlen($monitor_active)>5) )
|
||||
{
|
||||
$HDbarge = '';
|
||||
$HTbarge = '';
|
||||
@@ -1431,6 +1516,7 @@ $calls_to_list = mysql_num_rows($rslt);
|
||||
$sessionid = sprintf("%-9s", $Asessionid[$i]);
|
||||
$Lstatus = $Astatus[$i];
|
||||
$status = sprintf("%-6s", $Astatus[$i]);
|
||||
$Lserver_ip = $Aserver_ip[$i];
|
||||
$server_ip = sprintf("%-15s", $Aserver_ip[$i]);
|
||||
$call_server_ip = sprintf("%-15s", $Acall_server_ip[$i]);
|
||||
$campaign_id = sprintf("%-10s", $Acampaign_id[$i]);
|
||||
@@ -1578,6 +1664,10 @@ $calls_to_list = mysql_num_rows($rslt);
|
||||
if ($IAXmonitorLINK>0) {$L=" <a href=\"iax:0$Lsessionid@$server_ip\">LISTEN</a>"; $R='';}
|
||||
if ($SIPmonitorLINK>1) {$R=" | <a href=\"sip:$Lsessionid@$server_ip\">BARGE</a>";}
|
||||
if ($IAXmonitorLINK>1) {$R=" | <a href=\"iax:$Lsessionid@$server_ip\">BARGE</a>";}
|
||||
if ( (strlen($monitor_phone)>1) and (preg_match("/MONITOR|BARGE/",$monitor_active) ) )
|
||||
{$L=" <a href=\"javascript:send_monitor('$Lsessionid','$Lserver_ip','MONITOR');\">LISTEN</a>"; $R='';}
|
||||
if ( (strlen($monitor_phone)>1) and (preg_match("/BARGE/",$monitor_active) ) )
|
||||
{$R=" | <a href=\"javascript:send_monitor('$Lsessionid','$Lserver_ip','BARGE');\">BARGE</a>";}
|
||||
|
||||
if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG |";}
|
||||
else {$CP = "";}
|
||||
|
||||
@@ -974,7 +974,22 @@ if (isset($_GET["user_code"])) {$user_code=$_GET["user_code"];}
|
||||
elseif (isset($_POST["user_code"])) {$user_code=$_POST["user_code"];}
|
||||
if (isset($_GET["territory"])) {$territory=$_GET["territory"];}
|
||||
elseif (isset($_POST["territory"])) {$territory=$_POST["territory"];}
|
||||
|
||||
if (isset($_GET["survey_third_digit"])) {$survey_third_digit=$_GET["survey_third_digit"];}
|
||||
elseif (isset($_POST["survey_third_digit"])) {$survey_third_digit=$_POST["survey_third_digit"];}
|
||||
if (isset($_GET["survey_fourth_digit"])) {$survey_fourth_digit=$_GET["survey_fourth_digit"];}
|
||||
elseif (isset($_POST["survey_fourth_digit"])) {$survey_fourth_digit=$_POST["survey_fourth_digit"];}
|
||||
if (isset($_GET["survey_third_audio_file"])) {$survey_third_audio_file=$_GET["survey_third_audio_file"];}
|
||||
elseif (isset($_POST["survey_third_audio_file"])) {$survey_third_audio_file=$_POST["survey_third_audio_file"];}
|
||||
if (isset($_GET["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_GET["survey_fourth_audio_file"];}
|
||||
elseif (isset($_POST["survey_fourth_audio_file"])) {$survey_fourth_audio_file=$_POST["survey_fourth_audio_file"];}
|
||||
if (isset($_GET["survey_third_status"])) {$survey_third_status=$_GET["survey_third_status"];}
|
||||
elseif (isset($_POST["survey_third_status"])) {$survey_third_status=$_POST["survey_third_status"];}
|
||||
if (isset($_GET["survey_fourth_status"])) {$survey_fourth_status=$_GET["survey_fourth_status"];}
|
||||
elseif (isset($_POST["survey_fourth_status"])) {$survey_fourth_status=$_POST["survey_fourth_status"];}
|
||||
if (isset($_GET["survey_third_exten"])) {$survey_third_exten=$_GET["survey_third_exten"];}
|
||||
elseif (isset($_POST["survey_third_exten"])) {$survey_third_exten=$_POST["survey_third_exten"];}
|
||||
if (isset($_GET["survey_fourth_exten"])) {$survey_fourth_exten=$_GET["survey_fourth_exten"];}
|
||||
elseif (isset($_POST["survey_fourth_exten"])) {$survey_fourth_exten=$_POST["survey_fourth_exten"];}
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
|
||||
@@ -1250,6 +1265,8 @@ $agent_pause_codes_active = ereg_replace("[^0-9a-zA-Z]","",$agent_pause_codes_ac
|
||||
$three_way_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$three_way_dial_prefix);
|
||||
$shift_enforcement = ereg_replace("[^0-9a-zA-Z]","",$shift_enforcement);
|
||||
$agent_shift_enforcement_override = ereg_replace("[^0-9a-zA-Z]","",$agent_shift_enforcement_override);
|
||||
$survey_third_status = ereg_replace("[^0-9a-zA-Z]","",$survey_third_status);
|
||||
$survey_fourth_status = ereg_replace("[^0-9a-zA-Z]","",$survey_fourth_status);
|
||||
|
||||
### DIGITS and Dots
|
||||
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
|
||||
@@ -1264,6 +1281,10 @@ $vtiger_server_ip = ereg_replace("[^\.0-9]","",$vtiger_server_ip);
|
||||
### ALPHA-NUMERIC and spaces and hash and star and comma
|
||||
$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf);
|
||||
$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_b_dtmf);
|
||||
$survey_third_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_digit);
|
||||
$survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit);
|
||||
$survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten);
|
||||
$survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten);
|
||||
|
||||
### ALPHACAPS-NUMERIC
|
||||
$xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number);
|
||||
@@ -1375,6 +1396,8 @@ $carrier_id = ereg_replace("[^-\_0-9a-zA-Z]","",$carrier_id);
|
||||
$group_alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_alias_id);
|
||||
$default_group_alias = ereg_replace("[^-\_0-9a-zA-Z]","",$default_group_alias);
|
||||
$vtiger_search_dead = ereg_replace("[^-\_0-9a-zA-Z]","",$vtiger_search_dead);
|
||||
$survey_third_audio_file = ereg_replace("[^-\_0-9a-zA-Z]","",$survey_third_audio_file);
|
||||
$survey_fourth_audio_file = ereg_replace("[^-\_0-9a-zA-Z]","",$survey_fourth_audio_file);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and comma
|
||||
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
|
||||
@@ -1682,11 +1705,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
|
||||
# 90413-0755 - Fixed filter and script slashes issues
|
||||
# 90417-0211 - Fixed filter and script slashes issues
|
||||
# 90422-0613 - Added user_code, territory and email to vicidial_users
|
||||
# 90429-0542 - Added 3rd&4th options to SURVEY campaigns
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.2.0-179';
|
||||
$build = '90422-0613';
|
||||
$admin_version = '2.2.0-180';
|
||||
$build = '90429-0542';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3183,7 +3207,7 @@ if ($SSoutbound_autodial_active > 0)
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_dtmf_digits">
|
||||
<BR>
|
||||
<B>Survey DTMF Digits -</B> This field is where you define the digits that a customer can press as an option on a survey campaign. valid dtmf digits are 0123456789*#
|
||||
<B>Survey DTMF Digits -</B> This field is where you define the digits that a customer can press as an option on a survey campaign. valid dtmf digits are 0123456789*#. All options except for the Not Interested, Third and Fourth digit options will move on to the Survey Method call path.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_ni_digit">
|
||||
@@ -3230,6 +3254,32 @@ if ($SSoutbound_autodial_active > 0)
|
||||
<BR>
|
||||
<B>Survey Campaign Recording Directory -</B> If the Survey Method of CAMPREC_60_WAV is selected then the customer response will be recorded and placed in a directory named after the campaign inside of this directory.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_third_digit">
|
||||
<BR>
|
||||
<B>Survey Third Digit -</B> This allows for a third call path if the Third digit as defined in this field is pressed by the customer.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_fourth_digit">
|
||||
<BR>
|
||||
<B>Survey Fourth Digit -</B> This allows for a fourth call path if the Fourth digit as defined in this field is pressed by the customer.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_third_audio_file">
|
||||
<BR>
|
||||
<B>Survey Third Audio File -</B> This is the third audio file to be played upon the selection by the customer of the Third Digit option.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_third_status">
|
||||
<BR>
|
||||
<B>Survey Third Status -</B> This is the third status used for the call upon the selection by the customer of the Third Digit option.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-survey_third_exten">
|
||||
<BR>
|
||||
<B>Survey Third Extension -</B> This is the third extension used for the call upon the selection by the customer of the Third Digit option. Default is 8300 which immediately hangs up the call after the Audio File message is played.
|
||||
|
||||
|
||||
<?
|
||||
}
|
||||
?>
|
||||
@@ -7091,7 +7141,7 @@ if ($ADD==20)
|
||||
{
|
||||
echo "<br><B>CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id</B>\n";
|
||||
|
||||
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call from vicidial_campaigns where campaign_id='$source_campaign_id';";
|
||||
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten from vicidial_campaigns where campaign_id='$source_campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
|
||||
@@ -9759,7 +9809,7 @@ if ($ADD=='40A')
|
||||
{
|
||||
echo "<br><B>SURVEY SETTINGS MODIFIED: $campaign_id</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_campaigns SET survey_first_audio_file='$survey_first_audio_file',survey_dtmf_digits='$survey_dtmf_digits',survey_ni_digit='$survey_ni_digit',survey_opt_in_audio_file='$survey_opt_in_audio_file',survey_ni_audio_file='$survey_ni_audio_file',survey_method='$survey_method',survey_no_response_action='$survey_no_response_action',survey_ni_status='$survey_ni_status',survey_response_digit_map='$survey_response_digit_map',survey_xfer_exten='$survey_xfer_exten',survey_camp_record_dir='$survey_camp_record_dir',voicemail_ext='$voicemail_ext' where campaign_id='$campaign_id';";
|
||||
$stmt="UPDATE vicidial_campaigns SET survey_first_audio_file='$survey_first_audio_file',survey_dtmf_digits='$survey_dtmf_digits',survey_ni_digit='$survey_ni_digit',survey_opt_in_audio_file='$survey_opt_in_audio_file',survey_ni_audio_file='$survey_ni_audio_file',survey_method='$survey_method',survey_no_response_action='$survey_no_response_action',survey_ni_status='$survey_ni_status',survey_response_digit_map='$survey_response_digit_map',survey_xfer_exten='$survey_xfer_exten',survey_camp_record_dir='$survey_camp_record_dir',voicemail_ext='$voicemail_ext',survey_third_digit='$survey_third_digit',survey_fourth_digit='$survey_fourth_digit',survey_third_audio_file='$survey_third_audio_file',survey_fourth_audio_file='$survey_fourth_audio_file',survey_third_status='$survey_third_status',survey_fourth_status='$survey_fourth_status',survey_third_exten='$survey_third_exten',survey_fourth_exten='$survey_fourth_exten' where campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -13264,6 +13314,14 @@ if ($ADD==31)
|
||||
$default_group_alias = $row[105];
|
||||
$vtiger_search_dead = $row[106];
|
||||
$vtiger_status_call = $row[107];
|
||||
$survey_third_digit = $row[108];
|
||||
$survey_third_audio_file = $row[109];
|
||||
$survey_third_status = $row[110];
|
||||
$survey_third_exten = $row[111];
|
||||
$survey_fourth_digit = $row[112];
|
||||
$survey_fourth_audio_file = $row[113];
|
||||
$survey_fourth_status = $row[114];
|
||||
$survey_fourth_exten = $row[115];
|
||||
|
||||
if (ereg("DISABLED",$list_order_mix))
|
||||
{$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;}
|
||||
@@ -14354,6 +14412,17 @@ if ($ADD==31)
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Method: </td><td><select size=1 name=survey_method><option>AGENT_XFER</option><option>VOICEMAIL</option><option>EXTENSION</option><option>HANGUP</option><option>CAMPREC_60_WAV</option><option SELECTED>$survey_method</option></select> $NWB#vicidial_campaigns-survey_method$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey No-Response Action: </td><td><select size=1 name=survey_no_response_action><option>OPTIN</option><option>OPTOUT</option><option SELECTED>$survey_no_response_action</option></select> $NWB#vicidial_campaigns-survey_no_response_action$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Not Interested Status: </td><td><select name=survey_ni_status>$survey_ni_status_list</select> $NWB#vicidial_campaigns-survey_ni_status$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Digit: </td><td><input type=text size=5 maxlength=1 name=survey_third_digit value=\"$survey_third_digit\"> $NWB#vicidial_campaigns-survey_third_digit$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_third_audio_file value=\"$survey_third_audio_file\"> $NWB#vicidial_campaigns-survey_third_audio_file$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Status: </td><td><input type=text size=10 maxlength=6 name=survey_third_status value=\"$survey_third_status\"> $NWB#vicidial_campaigns-survey_third_status$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Third Extension: </td><td><input type=text size=20 maxlength=20 name=survey_third_exten value=\"$survey_third_exten\"> $NWB#vicidial_campaigns-survey_third_exten$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Digit: </td><td><input type=text size=5 maxlength=1 name=survey_fourth_digit value=\"$survey_fourth_digit\"> $NWB#vicidial_campaigns-survey_fourth_digit$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Audio File: </td><td><input type=text size=50 maxlength=50 name=survey_fourth_audio_file value=\"$survey_fourth_audio_file\"> $NWB#vicidial_campaigns-survey_fourth_audio_file$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Status: </td><td><input type=text size=10 maxlength=6 name=survey_fourth_status value=\"$survey_fourth_status\"> $NWB#vicidial_campaigns-survey_fourth_status$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Fourth Extension: </td><td><input type=text size=20 maxlength=20 name=survey_fourth_exten value=\"$survey_fourth_exten\"> $NWB#vicidial_campaigns-survey_fourth_exten$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Response Digit Map: </td><td><input type=text size=70 maxlength=100 name=survey_response_digit_map value=\"$survey_response_digit_map\"> $NWB#vicidial_campaigns-survey_response_digit_map$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Survey Xfer Extension: </td><td><input type=text size=12 maxlength=20 name=survey_xfer_exten value=\"$survey_xfer_exten\"> $NWB#vicidial_campaigns-survey_xfer_exten$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B9CBFD><td align=right>Survey Campaign Recording Directory: </td><td><input type=text size=70 maxlength=255 name=survey_camp_record_dir value=\"$survey_camp_record_dir\"> $NWB#vicidial_campaigns-survey_camp_record_dir$NWE</td></tr>\n";
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
# 80909-2012 - Added support for campaign-specific DNC lists
|
||||
# 80910-0020 - Added support for multi-alt-phones, added version function
|
||||
# 90118-1056 - Added logging of API functions
|
||||
# 90428-0209 - Added blind_monitor function
|
||||
#
|
||||
|
||||
$version = '2.0.5-5';
|
||||
$build = '90118-1056';
|
||||
$version = '2.2.0-6';
|
||||
$build = '90428-0209';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -99,7 +100,14 @@ if (isset($_GET["multi_alt_phones"])) {$multi_alt_phones=$_GET["multi_alt_phon
|
||||
elseif (isset($_POST["multi_alt_phones"])) {$multi_alt_phones=$_POST["multi_alt_phones"];}
|
||||
if (isset($_GET["source"])) {$source=$_GET["source"];}
|
||||
elseif (isset($_POST["source"])) {$source=$_POST["source"];}
|
||||
|
||||
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
|
||||
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
@@ -174,6 +182,10 @@ if ($non_latin < 1)
|
||||
$multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones);
|
||||
$multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones);
|
||||
$source = ereg_replace("[^0-9a-zA-Z]","",$source);
|
||||
$phone_login = ereg_replace("[^0-9a-zA-Z]","",$phone_login);
|
||||
$session_id = ereg_replace("[^0-9]","",$session_id);
|
||||
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
|
||||
$stage = ereg_replace("[^A-Z]","",$stage);
|
||||
}
|
||||
|
||||
if (strlen($list_id)<1) {$list_id='999';}
|
||||
@@ -253,6 +265,126 @@ if ($function == 'version')
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### blind_monitor - sends call to phone from session from listening
|
||||
################################################################################
|
||||
if ($function == 'blind_monitor')
|
||||
{
|
||||
if(strlen($source)<2)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "Invalid Source";
|
||||
echo "$result: $result_reason - $source\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
echo "ERROR: Invalid Source: |$source|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and user_level > 6;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$allowed_user=$row[0];
|
||||
if ($allowed_user < 1)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "blind_monitor USER DOES NOT HAVE PERMISSION TO BLIND MONITOR";
|
||||
echo "$result: $result_reason: |$user|$allowed_user|\n";
|
||||
$data = "$allowed_user";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_conferences where conf_exten='$session_id' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$session_exists=$row[0];
|
||||
|
||||
if ($session_exists < 1)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "blind_monitor INVALID SESSION ID";
|
||||
echo "$result: $result_reason - $session_id|$server_ip|$user\n";
|
||||
$data = "$session_id";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from phones where login='$phone_login';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$phone_exists=$row[0];
|
||||
|
||||
if ($phone_exists < 1)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "blind_monitor INVALID PHONE LOGIN";
|
||||
echo "$result: $result_reason - $phone_login|$user\n";
|
||||
$data = "$phone_login";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT dialplan_number,server_ip,outbound_cid from phones where login='$phone_login';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$dialplan_number = $row[0];
|
||||
$monitor_server_ip =$row[1];
|
||||
$outbound_cid = $row[2];
|
||||
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$monitor_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S";
|
||||
|
||||
$PADuser = sprintf("%08s", $user);
|
||||
while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);}
|
||||
$BMquery = "BM$StarTtime$PADuser";
|
||||
|
||||
if ( (ereg('MONITOR',$stage)) or (strlen($stage)<1) ) {$stage = '0';}
|
||||
if (ereg('BARGE',$stage)) {$stage = '';}
|
||||
if (ereg('HIJACK',$stage)) {$stage = '';}
|
||||
|
||||
### insert a new lead in the system with this phone number
|
||||
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
if ($affected_rows > 0)
|
||||
{
|
||||
$man_id = mysql_insert_id($link);
|
||||
|
||||
$result = 'SUCCESS';
|
||||
$result_reason = "blind_monitor HAS BEEN LAUNCHED";
|
||||
echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n";
|
||||
$data = "$phone_login|$monitor_dialstring|$session_id|$man_id";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### add_lead - inserts a lead into the vicidial_list table
|
||||
################################################################################
|
||||
@@ -269,7 +401,7 @@ if ($function == 'add_lead')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and modify_leads='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and modify_leads='1' and user_level > 7;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
Reference in New Issue
Block a user