in branch 2.0.5 removed default 91NXXNXXXXXX dialplan entries

in trunk, several bug fixes: inbound stream file, extended alt dial 
added dialed_number and dialed_label to script variables

git-svn-id: svn://192.168.202.10@1186 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-07-20 05:02:02 +00:00
parent 81e82aa670
commit c567e19811
16 changed files with 442 additions and 256 deletions
@@ -130,64 +130,6 @@ exten => i,1,Playback(invalid) ; "That's not valid, try again"
; exten => 1112223333,2,Dial(sip/gs102,55,o)
; exten => 1112223333,3,Hangup
; Extension 7275551212 - Inbound local number from PRI with 10 digit delivery
exten => 7275551212,1,Ringing
exten => 7275551212,2,Wait(1)
exten => 7275551212,3,AGI(agi://127.0.0.1:4577/call_log--fullCID--${EXTEN}-----${CALLERID}-----${CALLERIDNUM}-----${CALLERIDNAME})
exten => 7275551212,4,Answer
exten => 7275551212,5,Dial(sip/spa2000&sip/spa2001,30,To)
exten => 7275551212,6,Voicemail,u2000
; dial a long distance outbound number to the UK
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _901144XXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _901144XXXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},55,To)
exten => _901144XXXXXXXXXX,3,Hangup
; dial a long distance outbound number to Australia
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _901161XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _901161XXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},,To)
exten => _901161XXXXXXXXX,3,Hangup
; Extensions for performance testing
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${TRUNKloop}/${EXTEN:2},,tTo)
exten => _91999NXXXXXX,3,Hangup
exten => 999999999999,1,AGI(agi://127.0.0.1:4577/call_log)
exten => 999999999999,2,Dial(${TRUNKloop}/${EXTEN:1},,tTo)
exten => 999999999999,3,Hangup
; dial an 800 outbound number
exten => _91800NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91800NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91800NXXXXXX,3,Hangup
exten => _91888NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91888NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91888NXXXXXX,3,Hangup
exten => _91877NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91877NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91877NXXXXXX,3,Hangup
exten => _91866NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91866NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91866NXXXXXX,3,Hangup
; dial a local outbound number (modified because of only LD T1)
exten => _9NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXXXXX,2,Dial(${TRUNK}/1727${EXTEN:1},,To)
exten => _9NXXXXXX,3,Hangup
; dial a local 727 outbound number with area code
exten => _9727NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9727NXXXXXX,2,Dial(${TRUNK}/1${EXTEN:1},,To)
exten => _9727NXXXXXX,3,Hangup
; dial a long distance outbound number
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls
exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},,To)
exten => _91NXXNXXXXXX,3,Hangup
; This is a loopback dialaround to allow for hearing of ringing for 3way calls
exten => _881NXXNXXXXXX,1,Answer
exten => _881NXXNXXXXXX,2,Dial(${TRUNKloop}/9${EXTEN:2},,To)
@@ -130,26 +130,6 @@ exten => i,1,Playback(invalid) ; "That's not valid, try again"
; exten => 1112223333,2,Dial(sip/gs102,55,o)
; exten => 1112223333,3,Hangup
; Extension 7275551212 - Inbound local number from PRI with 10 digit delivery
exten => 7275551212,1,Ringing
exten => 7275551212,2,Wait(1)
exten => 7275551212,3,AGI(agi://127.0.0.1:4577/call_log--fullCID--${EXTEN}-----${CALLERID(all)}-----${CALLERID(num)}-----${CALLERID(name)})
exten => 7275551212,4,Answer
exten => 7275551212,5,Dial(sip/spa2000&sip/spa2001,30,To)
exten => 7275551212,6,Voicemail,u2000
; dial a long distance outbound number to the UK
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _901144XXXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _901144XXXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},55,To)
exten => _901144XXXXXXXXXX,3,Hangup
; dial a long distance outbound number to Australia
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _901161XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _901161XXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},,To)
exten => _901161XXXXXXXXX,3,Hangup
; Extensions for performance testing
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${TRUNKloop}/${EXTEN:2},,tTo)
@@ -158,36 +138,6 @@ exten => 999999999999,1,AGI(agi://127.0.0.1:4577/call_log)
exten => 999999999999,2,Dial(${TRUNKloop}/${EXTEN:1},,tTo)
exten => 999999999999,3,Hangup
; dial an 800 outbound number
exten => _91800NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91800NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91800NXXXXXX,3,Hangup
exten => _91888NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91888NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91888NXXXXXX,3,Hangup
exten => _91877NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91877NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91877NXXXXXX,3,Hangup
exten => _91866NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91866NXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _91866NXXXXXX,3,Hangup
; dial a local outbound number (modified because of only LD T1)
exten => _9NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXXXXX,2,Dial(${TRUNK}/1727${EXTEN:1},,To)
exten => _9NXXXXXX,3,Hangup
; dial a local 727 outbound number with area code
exten => _9727NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9727NXXXXXX,2,Dial(${TRUNK}/1${EXTEN:1},,To)
exten => _9727NXXXXXX,3,Hangup
; dial a long distance outbound number
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls
exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},,To)
exten => _91NXXNXXXXXX,3,Hangup
; This is a loopback dialaround to allow for hearing of ringing for 3way calls
exten => _881NXXNXXXXXX,1,Answer
exten => _881NXXNXXXXXX,2,Dial(${TRUNKloop}/9${EXTEN:2},,To)
@@ -450,7 +450,7 @@ F - Female|F - Femmina|
### BEGIN translation phrases for 2.0.5 release build 890
Date of Birth: |Data di Nascita: |
YOU MUST BE PAUSED TO CHANGE GROUPS|DEVI ESSERE IN PAUSA PER CAMBIARE GRUPPO|
Calls in Queue:|Chiede, in coda:|
Calls in Queue:|Chiamate in coda:|
Timeclock|Orologio|
The user and password you entered are not active in the system|Lutente e la password che hai inserito non sono attivi nel sistema|
Please try again|Si prega di riprovare|
+12 -12
View File
@@ -7603,18 +7603,18 @@ else
if (vdc_header_date_format.match(regALdate))
{
var statusmon='';
if (mon == 1) {statusmon = "JAN";}
if (mon == 2) {statusmon = "FEB";}
if (mon == 3) {statusmon = "MAR";}
if (mon == 4) {statusmon = "APR";}
if (mon == 5) {statusmon = "MAY";}
if (mon == 6) {statusmon = "JUN";}
if (mon == 7) {statusmon = "JLY";}
if (mon == 8) {statusmon = "AUG";}
if (mon == 9) {statusmon = "SEP";}
if (mon == 10) {statusmon = "OCT";}
if (mon == 11) {statusmon = "NOV";}
if (mon == 12) {statusmon = "DEC";}
if (month == 1) {statusmon = "JAN";}
if (month == 2) {statusmon = "FEB";}
if (month == 3) {statusmon = "MAR";}
if (month == 4) {statusmon = "APR";}
if (month == 5) {statusmon = "MAY";}
if (month == 6) {statusmon = "JUN";}
if (month == 7) {statusmon = "JLY";}
if (month == 8) {statusmon = "AUG";}
if (month == 9) {statusmon = "SEP";}
if (month == 10) {statusmon = "OCT";}
if (month == 11) {statusmon = "NOV";}
if (month == 12) {statusmon = "DEC";}
status_date = statusmon + " " + daym;
}
+68 -55
View File
@@ -98,6 +98,7 @@
# 90702-2129 - Fixed rare agent alert bug, added option to send to remote agent as phone*vendor_id
# 90709-1648 - Fixed alt-number transfers
# 90712-2307 - Added agent grab call in queue
# 90720-0023 - Added checks for filename validity before streaming, changed initial heavy search from 3 to 2 seconds
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -778,23 +779,26 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
}
if ($after_hours_action =~ /MESSAGE/)
{
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($after_hours_message_filename =~ /\|/)
if (length($after_hours_message_filename) > 0)
{
@after_hours_message_filename_array = split(/\|/,$after_hours_message_filename);
$w=0;
foreach(@after_hours_message_filename_array)
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($after_hours_message_filename =~ /\|/)
{
if (length($after_hours_message_filename_array[$w])>0)
@after_hours_message_filename_array = split(/\|/,$after_hours_message_filename);
$w=0;
foreach(@after_hours_message_filename_array)
{
$AGI->stream_file("$after_hours_message_filename_array[$w]");
if (length($after_hours_message_filename_array[$w])>0)
{
$AGI->stream_file("$after_hours_message_filename_array[$w]");
}
$w++;
}
$w++;
}
else
{$AGI->stream_file("$after_hours_message_filename");}
}
else
{$AGI->stream_file("$after_hours_message_filename");}
sleep(1);
### insert a NEW record to the vicidial_manager table to hangup the channel
@@ -924,23 +928,26 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/)
if ($no_agent_action =~ /MESSAGE/)
{
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($no_agent_action_value =~ /\|/)
if (length($no_agent_action_value) > 0)
{
@no_agent_action_value_array = split(/\|/,$no_agent_action_value);
$w=0;
foreach(@no_agent_action_value_array)
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($no_agent_action_value =~ /\|/)
{
if (length($no_agent_action_value_array[$w])>0)
@no_agent_action_value_array = split(/\|/,$no_agent_action_value);
$w=0;
foreach(@no_agent_action_value_array)
{
$AGI->stream_file("$no_agent_action_value_array[$w]");
if (length($no_agent_action_value_array[$w])>0)
{
$AGI->stream_file("$no_agent_action_value_array[$w]");
}
$w++;
}
$w++;
}
else
{$AGI->stream_file("$no_agent_action_value");}
}
else
{$AGI->stream_file("$no_agent_action_value");}
sleep(1);
### insert a NEW record to the vicidial_manager table to hangup the channel
@@ -960,7 +967,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/)
##### PLAY WELCOME MESSAGE #####
if ( ($welcome_message_filename !~ /---NONE---/) && ( ($play_welcome_message =~ /ALWAYS/) || ( ($no_delay_call_route =~ /N/) && ($play_welcome_message =~ /YES_UNLESS_NODELAY/) ) ) )
if ( ($welcome_message_filename !~ /---NONE---/) && (length($welcome_message_filename) > 0) && ( ($play_welcome_message =~ /ALWAYS/) || ( ($no_delay_call_route =~ /N/) && ($play_welcome_message =~ /YES_UNLESS_NODELAY/) ) ) )
{
if ($welcome_message_filename =~ /\|/)
{
@@ -1578,7 +1585,7 @@ if ( ($agent_search_method =~ /^SO|^LO/) && ($skipLOSO < 1) )
else
{
### For Debugging purposes display the call ahead of this call
if ( ($rec_countWAIT == '1') && ($drop_timer > 3) && ($AGILOG) )
if ( ($rec_countWAIT == '1') && ($drop_timer > 2) && ($AGILOG) )
{
$stmtA = "SELECT call_time,campaign_id,last_update_time,callerid,status,channel FROM vicidial_auto_calls where status = 'LIVE' and server_ip='$VARserver_ip' and campaign_id = '$channel_group' and call_time < \"$SQLdateBEGIN\" and lead_id != '$insert_lead_id';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
@@ -1933,7 +1940,7 @@ if ($agent_search_method =~ /^LO|^LB/)
}
else
{
if ( ($rec_countWAITrem == '1') && ($drop_timer > 3) && ($AGILOG) )
if ( ($rec_countWAITrem == '1') && ($drop_timer > 2) && ($AGILOG) )
{
$stmtA = "SELECT call_time,campaign_id,last_update_time,callerid,status,channel FROM vicidial_auto_calls where status = 'LIVE' and campaign_id = '$channel_group' and call_time < \"$SQLdateBEGIN\" and lead_id != '$insert_lead_id';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
@@ -2025,7 +2032,7 @@ if ($hold_recall_xfer_group !~ /NONE/)
if ($rec_countWAITrem > 0) {$place = $rec_countWAITrem;}
$place++;
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHKEY',data1='3',data2='$place',serverid='$queuemetrics_log_id';";
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHKEY',data1='2',data2='$place',serverid='$queuemetrics_log_id';";
$Baffected_rows = $dbhB->do($stmtB);
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02078'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
@@ -2053,7 +2060,7 @@ if ($hold_recall_xfer_group !~ /NONE/)
}
}
if ($if_wait_play_welcome > 0)
if ( ($if_wait_play_welcome > 0) && ($welcome_message_filename !~ /---NONE---/) && (length($welcome_message_filename) > 0) )
{
$if_wait_play_welcome=0;
@@ -2113,30 +2120,33 @@ if ( ($hold_message_counter > $prompt_interval) && ($prompt_interval > 0) )
$dbhP=$dbhA; $mysql_count='02081'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
if ($onhold_prompt_filename =~ /\|/)
if (length($onhold_prompt_filename) > 0)
{
@onhold_prompt_filename_array = split(/\|/,$onhold_prompt_filename);
$w=0;
foreach(@onhold_prompt_filename_array)
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
if ($onhold_prompt_filename =~ /\|/)
{
if (length($onhold_prompt_filename_array[$w])>0)
@onhold_prompt_filename_array = split(/\|/,$onhold_prompt_filename);
$w=0;
foreach(@onhold_prompt_filename_array)
{
$AGI->stream_file("$onhold_prompt_filename_array[$w]");
if (length($onhold_prompt_filename_array[$w])>0)
{
$AGI->stream_file("$onhold_prompt_filename_array[$w]");
}
$w++;
}
$w++;
}
else
{$AGI->stream_file("$onhold_prompt_filename");} # this prompt must be less than 10 seconds long
}
else
{$AGI->stream_file("$onhold_prompt_filename");} # this prompt must be less than 10 seconds long
$hold_message_counter = 0;
$start_moh=1;
$moh_delay=1;
if ($play_place_in_line =~ /Y/i) {$start_place_in_line=1; $moh_delay=2;}
if ($play_estimate_hold_time =~ /Y/i) {$start_hold_estimate=1; $moh_delay=2;}
if ($hold_time_option !~ /NONE/) {$start_hold_estimate=1; $moh_delay=2;};
if ($drop_timer >= 3) {$drop_timer = ($drop_timer + 5);} # add prompt play time to total queue time
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 5);} # add prompt play time to total queue time
}
else {$hold_message_counter++;}
if ($hold_tone_counter > 3)
@@ -2177,12 +2187,12 @@ if ( ($start_place_in_line > 0) && ($moh_delay == '1') )
{
$AGI->stream_file('queue-thereare'); # you are currently caller number
$AGI->say_number("$place");
if ($drop_timer >= 3) {$drop_timer = ($drop_timer + 2);} # add prompt play time to total queue time
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 2);} # add prompt play time to total queue time
}
else
{
$AGI->stream_file('queue-youarenext'); # your call is now first in line
if ($drop_timer >= 3) {$drop_timer = ($drop_timer + 5);} # add prompt play time to total queue time
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 5);} # add prompt play time to total queue time
}
$start_place_in_line=0;
@@ -2289,7 +2299,7 @@ if ( ($start_hold_estimate > 0) && ($moh_delay == '1') )
}
}
}
if ($drop_timer >= 3) {$drop_timer = ($drop_timer + 3);} # add prompt play time to total queue time
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 3);} # add prompt play time to total queue time
$start_hold_estimate=0;
$wait_in_queue = 1; # trigger hold-time-option is applicable
@@ -2325,7 +2335,7 @@ if ($hold_time_option =~ /PRESS_VMAIL/)
$dbhP=$dbhA; $mysql_count='02086'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
if ($drop_timer >= 3) {$drop_timer = ($drop_timer + 8);} # add prompt play time to total queue time
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 8);} # add prompt play time to total queue time
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
@@ -2406,23 +2416,26 @@ if ($hold_time_option =~ /CALLERID_CALLBACK/)
$DROPexten = "8300";
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
if ($hold_time_option_callback_filename =~ /\|/)
if (length($hold_time_option_callback_filename) > 0)
{
@hold_time_option_callback_filename_array = split(/\|/,$hold_time_option_callback_filename);
$w=0;
foreach(@hold_time_option_callback_filename_array)
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
if ($hold_time_option_callback_filename =~ /\|/)
{
if (length($hold_time_option_callback_filename_array[$w])>0)
@hold_time_option_callback_filename_array = split(/\|/,$hold_time_option_callback_filename);
$w=0;
foreach(@hold_time_option_callback_filename_array)
{
$AGI->stream_file("$hold_time_option_callback_filename_array[$w]");
if (length($hold_time_option_callback_filename_array[$w])>0)
{
$AGI->stream_file("$hold_time_option_callback_filename_array[$w]");
}
$w++;
}
$w++;
}
else
{$AGI->stream_file("$hold_time_option_callback_filename");} # this prompt must be less than 10 seconds long
}
else
{$AGI->stream_file("$hold_time_option_callback_filename");} # this prompt must be less than 10 seconds long
}
else
{
@@ -2514,7 +2527,7 @@ if ($wait_in_queue < 1)
##### wait before looking again for an agent to take the call
if ($wait_in_queue > 0)
{
if ($drop_timer < 3)
if ($drop_timer < 2)
{
### sleep for 23 hundredths of a second
usleep(1*230*1000);
+19 -12
View File
@@ -27,6 +27,7 @@ $US = '_';
$MT[0] = '';
$Q=0;
$DB=0;
$uniqueidLIST='|';
# Default FTP account variables
$VARREPORT_host = '10.0.0.4';
@@ -427,7 +428,7 @@ $TOTAL_SALES=0;
###########################################################################
########### CURRENT DAY SALES GATHERING outbound-only: vicidial_log ######
###########################################################################
$stmtA = "select vicidial_log.user,first_name,last_name,address1,address2,city,state,postal_code,vicidial_list.phone_number,vicidial_list.email,security_phrase,vicidial_list.comments,call_date,vicidial_list.lead_id,vicidial_users.full_name,vicidial_log.status,vicidial_list.vendor_lead_code,vicidial_list.source_id,vicidial_log.list_id,title,address3,last_local_call_time,uniqueid,length_in_sec from vicidial_list,vicidial_log,vicidial_users where campaign_id IN($campaignSQL) $sale_statusesSQL and call_date > '$shipdate 00:00:01' and call_date < '$shipdate 23:59:59' and vicidial_log.lead_id=vicidial_list.lead_id and vicidial_users.user=vicidial_log.user;";
$stmtA = "select vicidial_log.user,first_name,last_name,address1,address2,city,state,postal_code,vicidial_list.phone_number,vicidial_list.email,security_phrase,vicidial_list.comments,call_date,vicidial_list.lead_id,vicidial_users.full_name,vicidial_log.status,vicidial_list.vendor_lead_code,vicidial_list.source_id,vicidial_log.list_id,title,address3,last_local_call_time,uniqueid,length_in_sec from vicidial_list,vicidial_log,vicidial_users where campaign_id IN($campaignSQL) $sale_statusesSQL and call_date > '$shipdate 00:00:01' and call_date < '$shipdate 23:59:59' and vicidial_log.lead_id=vicidial_list.lead_id and vicidial_users.user=vicidial_log.user order by call_date;";
#$stmtA = "select vicidial_users.user,first_name,last_name,address1,address2,city,state,postal_code,phone_number,email,security_phrase,comments,last_local_call_time,lead_id,vicidial_users.full_name,status,vendor_lead_code,source_id,list_id,title,address3,last_local_call_time from vicidial_list,vicidial_users where list_id NOT IN('999','998') $sale_statusesSQL and called_count > 0 and vicidial_users.user=vicidial_list.user;";
if ($DB) {print "|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -477,7 +478,7 @@ if (length($with_inboundSQL)>3)
###########################################################################
########### CURRENT DAY SALES GATHERING inbound-only: vicidial_closer_log ######
###########################################################################
$stmtA = "select vicidial_closer_log.user,first_name,last_name,address1,address2,city,state,postal_code,vicidial_list.phone_number,vicidial_list.email,security_phrase,vicidial_list.comments,call_date,vicidial_list.lead_id,vicidial_users.full_name,vicidial_closer_log.status,vicidial_list.vendor_lead_code,vicidial_list.source_id,vicidial_closer_log.list_id,campaign_id,title,address3,last_local_call_time,xfercallid,closecallid,uniqueid,length_in_sec,queue_seconds from vicidial_list,vicidial_closer_log,vicidial_users where campaign_id IN($with_inboundSQL) $close_statusesSQL and call_date > '$shipdate 00:00:01' and call_date < '$shipdate 23:59:59' and vicidial_closer_log.lead_id=vicidial_list.lead_id and vicidial_users.user=vicidial_closer_log.user;";
$stmtA = "select vicidial_closer_log.user,first_name,last_name,address1,address2,city,state,postal_code,vicidial_list.phone_number,vicidial_list.email,security_phrase,vicidial_list.comments,call_date,vicidial_list.lead_id,vicidial_users.full_name,vicidial_closer_log.status,vicidial_list.vendor_lead_code,vicidial_list.source_id,vicidial_closer_log.list_id,campaign_id,title,address3,last_local_call_time,xfercallid,closecallid,uniqueid,length_in_sec,queue_seconds from vicidial_list,vicidial_closer_log,vicidial_users where campaign_id IN($with_inboundSQL) $close_statusesSQL and call_date > '$shipdate 00:00:01' and call_date < '$shipdate 23:59:59' and vicidial_closer_log.lead_id=vicidial_list.lead_id and vicidial_users.user=vicidial_closer_log.user order by call_date;";
if ($DB) {print "|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -664,6 +665,7 @@ exit;
### Subroutine for formatting of the output ###
sub select_format_loop
{
$str='';
if ($T)
{
# $user = '1234';
@@ -747,6 +749,7 @@ sub select_format_loop
{
$ivr_id = '0';
$ivr_filename = '';
$ivr_location = '';
$stmtB = "select recording_id,filename,location from recording_log where vicidial_id='$vicidial_id' and start_time > '$shipdate 00:00:01' and start_time < '$shipdate 23:59:59' order by start_time limit 10;";
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
@@ -760,10 +763,9 @@ sub select_format_loop
{
$ivr_id .= "|";
$ivr_filename .= "|";
$ivr_location .= "|";
}
$ivr_id .= "$aryB[0]";
$ivr_location .= "$aryB[2]";
$ivr_location = "$aryB[2]";
@ivr_path = split(/\//,$ivr_location);
$path_file = $ivr_path[$#ivr_path];
$ivr_filename .= "$path_file";
@@ -800,23 +802,22 @@ sub select_format_loop
$stmtB = "select recording_id,filename,location from recording_log where vicidial_id='$closecallid' and start_time > '$shipdate 00:00:01' and start_time < '$shipdate 23:59:59' order by start_time limit 10;";
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
$sthBrows=$sthB->rows;
$rec_countB=0;
while ($sthBrows > $rec_countB)
$sthBrowsR=$sthB->rows;
$rec_countBR=0;
while ($sthBrowsR > $rec_countBR)
{
@aryB = $sthB->fetchrow_array;
if (length($ivr_id) > 1)
{
$ivr_id .= "|";
$ivr_filename .= "|";
$ivr_location .= "|";
}
$ivr_id .= "$aryB[0]";
$ivr_location .= "$aryB[2]";
$ivr_location = "$aryB[2]";
@ivr_path = split(/\//,$ivr_location);
$path_file = $ivr_path[$#ivr_path];
$ivr_filename .= "$path_file";
$rec_countB++;
$rec_countBR++;
if ($ftp_audio_transfer > 0)
{
`$wgetbin -q --output-document=$tempdir/$path_file $aryB[2] `;
@@ -959,11 +960,17 @@ sub select_format_loop
$phone_areacode = substr($phone_number, 0, 3);
if (length($closer) < 1) {$closer = $user;}
$application = substr($did_name, 0, 4);
$queue_seconds = int($queue_seconds + .5);
$talk_seconds = ($length_in_sec - $queue_seconds);
$queue_seconds =~ s/\..*//gi;
$dispo_time = 0;
$str = "$uniqueid\t$call_date_array[0]\t$call_date_array[1]\t$phone_areacode\t$phone_number\t$did_pattern\t$closer\t$queue_seconds\t$talk_seconds\t$dispo_time\t$application\t-\t$ivr_filename\t\n";
if ($uniqueidLIST !~ /\|$uniqueid\|/)
{
$str = "$uniqueid\t$call_date_array[0]\t$call_date_array[1]\t$phone_areacode\t$phone_number\t$did_pattern\t$closer\t$queue_seconds\t$talk_seconds\t$dispo_time\t$application\t-\t$ivr_filename\t\n";
$uniqueidLIST .= "$uniqueid|";
if ($DB > 0) {print "UNIQUE: -----$uniqueidLIST-----$uniqueid";}
}
}
@@ -1106,6 +1106,16 @@ while ($sthBrowsC > $i)
$fax = $aryB[7];
$email1 = $aryB[8];
$website = $aryB[9];
$accountname =~ s/'//gi;
$ownership =~ s/'//gi;
$siccode =~ s/'//gi;
$annualrevenue =~ s/'//gi;
$tickersymbol =~ s/'//gi;
$phone =~ s/'//gi;
$otherphone =~ s/'//gi;
$fax =~ s/'//gi;
$email1 =~ s/'//gi;
$website =~ s/'//gi;
}
$sthB->finish();
@@ -1123,6 +1133,9 @@ while ($sthBrowsC > $i)
$bill_state = $aryB[3];
$bill_street = $aryB[4];
$bill_pobox = $aryB[5];
$bill_city =~ s/'//gi;
$bill_code =~ s/'//gi;
$bill_street =~ s/'//gi;
}
$sthB->finish();
@@ -459,6 +459,14 @@ exten => 8374,3,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8374,4,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8374,5,Hangup
; VICIDIAL SURVEY transfer script AMD with Cepstral variables:
exten => 8375,1,Playback(sip-silence)
exten => 8375,2,AGI(agi://127.0.0.1:4577/call_log)
exten => 8375,3,AMD(2000|2000|1000|5000|120|50|4|256)
exten => 8375,4,AGI(VD_amd.agi,${EXTEN})
exten => 8375,5,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8375,6,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8375,7,Hangup
@@ -459,6 +459,14 @@ exten => 8374,3,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8374,4,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8374,5,Hangup
; VICIDIAL SURVEY transfer script AMD with Cepstral variables:
exten => 8375,1,Playback(sip-silence)
exten => 8375,2,AGI(agi://127.0.0.1:4577/call_log)
exten => 8375,3,AMD(2000|2000|1000|5000|120|50|4|256)
exten => 8375,4,AGI(VD_amd.agi,${EXTEN})
exten => 8375,5,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8375,6,AGI(agi-VDAD_ALL_outbound.agi,SURVEYCAMPCEP-----LB)
exten => 8375,7,Hangup
+1 -1
View File
@@ -449,7 +449,7 @@ F - Female|F - Femmina|
### BEGIN translation phrases for 2.0.5 release build 890
Date of Birth: |Data di Nascita: |
YOU MUST BE PAUSED TO CHANGE GROUPS|DEVI ESSERE IN PAUSA PER CAMBIARE GRUPPO|
Calls in Queue:|Chiede, in coda:|
Calls in Queue:|Chiamate in coda:|
Timeclock|Orologio|
The user and password you entered are not active in the system|Lutente e la password che hai inserito non sono attivi nel sistema|
Please try again|Si prega di riprovare|
+21 -3
View File
@@ -204,12 +204,13 @@
# 90705-2008 - Added AGENTSview function
# 90706-1431 - Added Agent view transfer selection
# 90712-2303 - Added view calls in queue, grab call from queue
# 90717-0638 - Fixed alt dial on overflow in-group calls
#
$version = '2.2.0-115';
$build = '90712-2303';
$version = '2.2.0-116';
$build = '90717-0638';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=234;
$mysql_log_count=235;
$one_mysql_log=0;
require("dbconnect.php");
@@ -1852,6 +1853,23 @@ if ($stage == "end")
### check to see if lead should be alt_dialed
if (strlen($alt_dial)<2) {$alt_dial = 'NONE';}
### check if inbound call, if so find a recent outbound call to pull alt_dial value from
if ($VLA_inOUT == 'INBOUND')
{
$one_hour_ago = date("Y-m-d H:i:s", mktime(date("H")-1,date("i"),date("s"),date("m"),date("d"),date("Y")));
##### find a recent outbound call associated with this inbound call
$stmt="SELECT alt_dial FROM vicidial_log where lead_id='$lead_id' and status IN('DROP','XDROP') and call_date > \"$one_hour_ago\" order by call_date desc limit 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00235',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$VL_alt_ct = mysql_num_rows($rslt);
if ($VL_alt_ct > 0)
{
$row=mysql_fetch_row($rslt);
$alt_dial = $row[0];
}
}
if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) )
{
$alt_dial_skip=0;
+23 -14
View File
@@ -238,10 +238,11 @@
# 90706-1432 - Added Agent view transfer selection
# 90709-1649 - Fixed alt-number transfers and dispo variable reset for webform
# 90712-2304 - Added ADD-ALL group selection, view calls in queue, grab call from queue, requeue button
# 90717-0640 - Added dialed_label and dialed_number to script variables
#
$version = '2.2.0-216';
$build = '90712-2304';
$version = '2.2.0-217';
$build = '90717-0640';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=61;
$one_mysql_log=0;
@@ -7081,6 +7082,8 @@ encoded=utf8_decode(xtest);
var SCserver_ip = server_ip;
var SCSIPexten = extension;
var SCsession_id = session_id;
var SCdialed_number = dialed_number;
var SCdialed_label = dialed_label;
var SCweb_vars = LIVE_web_vars;
if (encoded.match(RGiframe))
@@ -7124,6 +7127,8 @@ encoded=utf8_decode(xtest);
SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+');
SCserver_ip = SCserver_ip.replace(RGplus,'+');
SCSIPexten = SCSIPexten.replace(RGplus,'+');
SCdialed_number = SCdialed_number.replace(RGplus,'+');
SCdialed_label = SCdialed_label.replace(RGplus,'+');
SCweb_vars = SCweb_vars.replace(RGplus,'+');
}
@@ -7168,6 +7173,8 @@ encoded=utf8_decode(xtest);
var RGserver_ip = new RegExp("--A--server_ip--B--","g");
var RGSIPexten = new RegExp("--A--SIPexten--B--","g");
var RGsession_id = new RegExp("--A--session_id--B--","g");
var RGdialed_number = new RegExp("--A--dialed_number--B--","g");
var RGdialed_label = new RegExp("--A--dialed_label--B--","g");
var RGweb_vars = new RegExp("--A--web_vars--B--","g");
encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
@@ -7211,6 +7218,8 @@ encoded=utf8_decode(xtest);
encoded = encoded.replace(RGserver_ip, SCserver_ip);
encoded = encoded.replace(RGSIPexten, SCSIPexten);
encoded = encoded.replace(RGsession_id, SCsession_id);
encoded = encoded.replace(RGdialed_number, SCdialed_number);
encoded = encoded.replace(RGdialed_label, SCdialed_label);
encoded = encoded.replace(RGweb_vars, SCweb_vars);
}
decoded=encoded; // simple no ?
@@ -8106,18 +8115,18 @@ else
if (vdc_header_date_format.match(regALdate))
{
var statusmon='';
if (mon == 1) {statusmon = "JAN";}
if (mon == 2) {statusmon = "FEB";}
if (mon == 3) {statusmon = "MAR";}
if (mon == 4) {statusmon = "APR";}
if (mon == 5) {statusmon = "MAY";}
if (mon == 6) {statusmon = "JUN";}
if (mon == 7) {statusmon = "JLY";}
if (mon == 8) {statusmon = "AUG";}
if (mon == 9) {statusmon = "SEP";}
if (mon == 10) {statusmon = "OCT";}
if (mon == 11) {statusmon = "NOV";}
if (mon == 12) {statusmon = "DEC";}
if (month == 1) {statusmon = "JAN";}
if (month == 2) {statusmon = "FEB";}
if (month == 3) {statusmon = "MAR";}
if (month == 4) {statusmon = "APR";}
if (month == 5) {statusmon = "MAY";}
if (month == 6) {statusmon = "JUN";}
if (month == 7) {statusmon = "JLY";}
if (month == 8) {statusmon = "AUG";}
if (month == 9) {statusmon = "SEP";}
if (month == 10) {statusmon = "OCT";}
if (month == 11) {statusmon = "NOV";}
if (month == 12) {statusmon = "DEC";}
status_date = statusmon + " " + daym;
}
@@ -18,6 +18,7 @@
# 90310-2039 - Admin header
# 90508-0644 - Changed to PHP long tags
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
# 90717-1500 - Changed to be multi-campaign, multi-user-group select
#
require("dbconnect.php");
@@ -114,6 +115,44 @@ while ($i < $user_groups_to_print)
$user_groups[$i] =$row[0];
$i++;
}
$i=0;
$group_string='|';
$group_ct = count($group);
while($i < $group_ct)
{
$group_string .= "$group[$i]|";
$group_SQL .= "'$group[$i]',";
$groupQS .= "&group[]=$group[$i]";
$i++;
}
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";}
else
{
$group_SQL = eregi_replace(",$",'',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)";
}
$i=0;
$user_group_string='|';
$user_group_ct = count($user_group);
while($i < $user_group_ct)
{
$user_group_string .= "$user_group[$i]|";
$user_group_SQL .= "'$user_group[$i]',";
$user_groupQS .= "&user_group[]=$user_group[$i]";
$i++;
}
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";}
else
{
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
}
if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
?>
<HTML>
@@ -138,39 +177,58 @@ echo "<TITLE>Agent Performance Detail</TITLE></HEAD><BODY BGCOLOR=WHITE marginhe
echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>";
echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($campaigns_to_print > $o)
{
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
echo "<BR> to <BR><INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=user_group>\n";
echo "<option value=\"\">-- ALL USER GROUPS --</option>\n";
$o=0;
while ($user_groups_to_print > $o)
echo "</TD><TD VALIGN=TOP>User Groups:<BR>";
echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else
{echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0;
while ($user_groups_to_print > $o)
{
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "</TD><TD VALIGN=TOP>Shift:<BR>";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"$shift\">$shift</option>\n";
echo "<option value=\"\">--</option>\n";
echo "<option value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "</SELECT>\n";
echo "</SELECT><BR><BR>\n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</TD><TD VALIGN=TOP> &nbsp; &nbsp; &nbsp; &nbsp; ";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n";
echo " <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FONT>\n";
echo "</TD></TR></TABLE>";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\n";
@@ -228,7 +286,7 @@ $usersARY[0]='';
$user_namesARY[0]='';
$k=0;
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$rows_to_print = mysql_num_rows($rslt);
@@ -522,7 +580,7 @@ $PCusers='-';
$PCusersARY=$MT;
$PCuser_namesARY=$MT;
$k=0;
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<36000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$subs_to_print = mysql_num_rows($rslt);
+16 -5
View File
@@ -1883,11 +1883,12 @@ else
# 90628-2213 - Added Multi-campaign drop rate groups
# 90705-0926 - Added User Group agent view options
# 90710-1528 - Added Agent view and grab queue calls and every call pause options
# 90717-0646 - Added dialed_label and dialed_number to script variables
#
# 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-205';
$build = '90710-1528';
$admin_version = '2.2.0-206';
$build = '90717-0646';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -4496,10 +4497,10 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_scripts-script_text">
<B>Script Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
<B>Script Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
<DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example>
&#60;iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&#38;vendor_id=--A--vendor_lead_code--B--&#38;list_id=--A--list_id--B--&#38;gmt_offset_now=--A--gmt_offset_now--B--&#38;phone_code=--A--phone_code--B--&#38;phone_number=--A--phone_number--B--&#38;title=--A--title--B--&#38;first_name=--A--first_name--B--&#38;middle_initial=--A--middle_initial--B--&#38;last_name=--A--last_name--B--&#38;address1=--A--address1--B--&#38;address2=--A--address2--B--&#38;address3=--A--address3--B--&#38;city=--A--city--B--&#38;state=--A--state--B--&#38;province=--A--province--B--&#38;postal_code=--A--postal_code--B--&#38;country_code=--A--country_code--B--&#38;gender=--A--gender--B--&#38;date_of_birth=--A--date_of_birth--B--&#38;alt_phone=--A--alt_phone--B--&#38;email=--A--email--B--&#38;security_phrase=--A--security_phrase--B--&#38;comments=--A--comments--B--&#38;user=--A--user--B--&#38;campaign=--A--campaign--B--&#38;phone_login=--A--phone_login--B--&#38;fronter=--A--fronter--B--&#38;closer=--A--user--B--&#38;group=--A--group--B--&#38;channel_group=--A--group--B--&#38;SQLdate=--A--SQLdate--B--&#38;epoch=--A--epoch--B--&#38;uniqueid=--A--uniqueid--B--&#38;customer_zap_channel=--A--customer_zap_channel--B--&#38;server_ip=--A--server_ip--B--&#38;SIPexten=--A--SIPexten--B--&#38;session_id=--A--session_id--B--&#38;phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"&#62;
&#60;iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&#38;vendor_id=--A--vendor_lead_code--B--&#38;list_id=--A--list_id--B--&#38;gmt_offset_now=--A--gmt_offset_now--B--&#38;phone_code=--A--phone_code--B--&#38;phone_number=--A--phone_number--B--&#38;title=--A--title--B--&#38;first_name=--A--first_name--B--&#38;middle_initial=--A--middle_initial--B--&#38;last_name=--A--last_name--B--&#38;address1=--A--address1--B--&#38;address2=--A--address2--B--&#38;address3=--A--address3--B--&#38;city=--A--city--B--&#38;state=--A--state--B--&#38;province=--A--province--B--&#38;postal_code=--A--postal_code--B--&#38;country_code=--A--country_code--B--&#38;gender=--A--gender--B--&#38;date_of_birth=--A--date_of_birth--B--&#38;alt_phone=--A--alt_phone--B--&#38;email=--A--email--B--&#38;security_phrase=--A--security_phrase--B--&#38;comments=--A--comments--B--&#38;user=--A--user--B--&#38;campaign=--A--campaign--B--&#38;phone_login=--A--phone_login--B--&#38;fronter=--A--fronter--B--&#38;closer=--A--user--B--&#38;group=--A--group--B--&#38;channel_group=--A--group--B--&#38;SQLdate=--A--SQLdate--B--&#38;epoch=--A--epoch--B--&#38;uniqueid=--A--uniqueid--B--&#38;customer_zap_channel=--A--customer_zap_channel--B--&#38;server_ip=--A--server_ip--B--&#38;SIPexten=--A--SIPexten--B--&#38;session_id=--A--session_id--B--&#38;dialed_number=--A--dialed_number--B--&#38;dialed_label=--A--dialed_label--B--&#38;phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"&#62;
&#60;/iframe&#62;
</DIV>
@@ -5743,7 +5744,7 @@ if ($ADD==7111111)
$country_code = 'USA';
$gender = 'M';
$date_of_birth = '1970-01-01';
$alt_phone = '3125551212';
$alt_phone = '3125551111';
$email = 'test@test.com';
$security_phrase = 'SECUTIRY';
$comments = 'COMMENTS FIELD';
@@ -5761,6 +5762,8 @@ if ($ADD==7111111)
$RGserver_ip = '10.10.10.15';
$RGSIPexten = 'SIP/gs102';
$RGsession_id = '8600051';
$RGdialed_number = '3125551111';
$RGdialed_label = 'ALT';
echo "</title>\n";
echo "</head>\n";
@@ -5812,6 +5815,8 @@ if ($ADD==7111111)
$RGserver_ip = eregi_replace(' ','+',$RGserver_ip);
$RGSIPexten = eregi_replace(' ','+',$RGSIPexten);
$RGsession_id = eregi_replace(' ','+',$RGsession_id);
$RGdialed_number = eregi_replace(' ','+',$RGdialed_number);
$RGdialed_label = eregi_replace(' ','+',$RGdialed_label);
}
$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text);
@@ -5852,6 +5857,8 @@ if ($ADD==7111111)
$script_text = eregi_replace('--A--server_ip--B--',"$RGserver_ip",$script_text);
$script_text = eregi_replace('--A--SIPexten--B--',"$RGSIPexten",$script_text);
$script_text = eregi_replace('--A--session_id--B--',"$RGsession_id",$script_text);
$script_text = eregi_replace('--A--dialed_number--B--',"$RGdialed_number",$script_text);
$script_text = eregi_replace('--A--dialed_label--B--',"$RGdialed_label",$script_text);
$script_text = eregi_replace("\n","<BR>",$script_text);
@@ -6889,6 +6896,8 @@ if ($ADD==1111111)
echo "<option>server_ip</option>";
echo "<option>SIPexten</option>";
echo "<option>session_id</option>";
echo "<option>dialed_number</option>";
echo "<option>dialed_label</option>";
echo "</select>";
echo "<input type=\"button\" name=\"insertField\" value=\"Insert\" onClick=\"scriptInsertField();\"><BR>";
# END Insert Field
@@ -18992,6 +19001,8 @@ if ($ADD==3111111)
echo "<option>server_ip</option>";
echo "<option>SIPexten</option>";
echo "<option>session_id</option>";
echo "<option>dialed_number</option>";
echo "<option>dialed_label</option>";
echo "</select>";
echo "<input type=\"button\" name=\"insertField\" value=\"Insert\" onClick=\"scriptInsertField();\"><BR>";
# END Insert Field
@@ -0,0 +1,132 @@
<?php
# send_CID_call.php
#
# Send calls with custom callerID numbers from web form
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# CHANGES
#
# 90714-1355 - First Build
#
require("dbconnect.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
$ip = getenv("REMOTE_ADDR");
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["sender"])) {$sender=$_GET["sender"];}
elseif (isset($_POST["sender"])) {$sender=$_POST["sender"];}
if (isset($_GET["receiver"])) {$receiver=$_GET["receiver"];}
elseif (isset($_POST["receiver"])) {$receiver=$_POST["receiver"];}
if (isset($_GET["cid_number"])) {$cid_number=$_GET["cid_number"];}
elseif (isset($_POST["cid_number"])) {$cid_number=$_POST["cid_number"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
$sender = ereg_replace("[^0-9]","",$sender);
$receiver = ereg_replace("[^0-9]","",$receiver);
$cid_number = ereg_replace("[^0-9]","",$cid_number);
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
exit;
}
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
?>
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
.green {color: white; background-color: green}
.red {color: white; background-color: red}
.blue {color: white; background-color: blue}
.purple {color: white; background-color: purple}
-->
</STYLE>
<?
$stmt="select server_ip,server_id from servers;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$servers_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $servers_to_print)
{
$row=mysql_fetch_row($rslt);
$groups[$i] = $row[0];
$group_names[$i] = $row[1];
$i++;
}
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Manual CID call</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "Sender: <INPUT TYPE=TEXT NAME=sender SIZE=12 MAXLENGTH=10 VALUE=\"$sender\"> &nbsp; &nbsp; \n";
echo "Receiver: <INPUT TYPE=TEXT NAME=receiver SIZE=12 MAXLENGTH=10 VALUE=\"$receiver\"> &nbsp; &nbsp; \n";
echo "CID Number: <INPUT TYPE=TEXT NAME=cid_number SIZE=12 MAXLENGTH=10 VALUE=\"$cid_number\"> &nbsp; &nbsp; \n";
echo "Server: <SELECT SIZE=1 NAME=server_ip>\n";
$o=0;
while ($servers_to_print > $o)
{
if ($groups[$o] == $server_ip) {echo "<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
$o++;
}
echo "</SELECT> &nbsp; \n";
echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM><BR>\n\n";
if ( (strlen($sender) < 6) or (strlen($receiver) < 6) or (strlen($cid_number) < 6) or (strlen($server_ip) < 7) )
{
echo "\n\n";
echo "PLEASE ENTER A CALLER, RECEIVER AND CALLERID NUMBER ABOVE AND CLICK SUBMIT\n";
}
else
{
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$PHP_AUTH_USER','$NOW_TIME','CID','$server_ip','$sender','$receiver','0','$cid_number','$ip')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$Local_end = '@default';
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','TESTCIDCALL098765432','Exten: 91$receiver','Context: default','Channel: Local/91$sender$Local_end','Priority: 1','Callerid: \"$cid_number\" <$cid_number>','','','','','');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
echo "<B>Call sent from $sender to $receiver using CIDnumber: $cid_number</B>";
}
?>
</BODY></HTML>
+46 -29
View File
@@ -9,9 +9,10 @@
#
# CHANGES
# 90520-1928 - first build
# 90717-0651 - Added batch
#
$version = '2.2.0-1';
$version = '2.2.0-2';
$build = '90520-1928';
$MT[0]='';
@@ -33,6 +34,8 @@ if (isset($_GET["level"])) {$level=$_GET["level"];}
elseif (isset($_POST["level"])) {$level=$_POST["level"];}
if (isset($_GET["accountid"])) {$accountid=$_GET["accountid"];}
elseif (isset($_POST["accountid"])) {$accountid=$_POST["accountid"];}
if (isset($_GET["batch"])) {$batch=$_GET["batch"];}
elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
@@ -82,26 +85,35 @@ if ($non_latin < 1)
$level = ereg_replace("[^\_A-Z]","",$level);
$old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory);
$old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user);
$accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid);
}
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$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 > 7 and modify_users='1'";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
if (eregi("YES",$batch))
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
exit;
$USER='batch';
$PASS='batch';
}
else
{
$USER=$_SERVER['PHP_AUTH_USER'];
$PASS=$_SERVER['PHP_AUTH_PW'];
$USER = ereg_replace("[^0-9a-zA-Z]","",$USER);
$PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS);
$stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and modify_users='1'";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth))
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Invalid Username/Password: |$USER|$PASS|\n";
exit;
}
}
if ($enable_vtiger_integration > 0)
@@ -177,7 +189,11 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i
}
else
{
$stmtV="SELECT tickersymbol from vtiger_account where accountid='$accountid';";
if (eregi("YES",$batch))
{$AID_lookupSQL = "website='$accountid'";}
else
{$AID_lookupSQL = "accountid='$accountid'";}
$stmtV="SELECT tickersymbol,accountid from vtiger_account where $AID_lookupSQL;";
$rsltV=mysql_query($stmtV, $linkV);
if ($DB) {echo "$stmtV\n";}
$vat_ct = mysql_num_rows($rsltV);
@@ -185,6 +201,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i
{
$row=mysql_fetch_row($rsltV);
$territory = $row[0];
$accountid = $row[1];
$stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';";
$rslt=mysql_query($stmt, $link);
@@ -200,7 +217,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -229,7 +246,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_i
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$accountid', event_code='VTIGER MODIFY TERRITORY OWNER ACCOUNT', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$accountid', event_code='VTIGER MODIFY TERRITORY OWNER ACCOUNT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -388,7 +405,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -467,7 +484,7 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$territory', event_code='VTIGER MODIFY TERRITORY OWNER', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='VTIGER', event_type='MODIFY', record_id='$territory', event_code='VTIGER MODIFY TERRITORY OWNER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -562,7 +579,7 @@ if ($action == "PROCESS_ADD_USER_TERRITORY")
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -605,7 +622,7 @@ if ($action == "PROCESS_MODIFY_USER_TERRITORY")
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -642,7 +659,7 @@ if ($action == "DELETE_USER_TERRITORY")
$SQL_log = "$stmt|$stmtB|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -700,7 +717,7 @@ if ($action == "PROCESS_ADD_TERRITORY")
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -737,7 +754,7 @@ if ($action == "DELETE_TERRITORY")
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -774,7 +791,7 @@ if ($action == "PROCESS_MODIFY_TERRITORY")
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='MODIFY', record_id='$territory', event_code='ADMIN MODIFY TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}