added remote agent extension groups feature
git-svn-id: svn://192.168.202.10@1379 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -90,6 +90,10 @@ OTHER CHANGES:
|
||||
of calls sent to a Remote Agent also allows for setting of a disposition
|
||||
for more information read the AGENT_API.txt doc.
|
||||
|
||||
20. Added Extension Groups feature to Remote Agents section allowing calls to be
|
||||
sent to different numbers in a round-robin method when enabled on
|
||||
multi-line remote agent accounts. To enable, you must create Extension
|
||||
Group entries and enable Extension Group in the Remote Agent entry.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
# 100123-1015 - Added voicemail_id lookup for user from AGENTDIRECT drop
|
||||
# 100212-0653 - Added AGENTVMAIL AGENTDIRECT option for no-queue, hold time and after hours features
|
||||
# 100226-0927 - Fixed reinsert issue in vicidial_auto_calls table with auto_call_id
|
||||
# 100319-0614 - Added extension group remote agent feature
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -132,7 +133,7 @@ $start_moh=1;
|
||||
$at='@';
|
||||
$S='*';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=130;
|
||||
$mysql_log_count=143;
|
||||
$one_mysql_log=0;
|
||||
|
||||
|
||||
@@ -356,7 +357,7 @@ if ($extension =~ /^999\d\d\*/)
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
$dbhP=$dbhA; $mysql_count='01139'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
@@ -1660,7 +1661,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
else
|
||||
{$vlia_users="''";}
|
||||
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 and server_ip='$VARserver_ip' $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 and server_ip='$VARserver_ip' $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -1674,13 +1675,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADextension = $aryA[2];
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADgroup_weight = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
|
||||
|
||||
if ($AGENTgrab > 0)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1693,6 +1695,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADextension = $aryA[1];
|
||||
$VDADuser = $AGENTuser;
|
||||
$VDADserver_ip = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
@@ -1725,7 +1728,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($aco_sub<1)
|
||||
{
|
||||
$cbc=0;
|
||||
$stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1735,10 +1738,10 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
while ($sthArows > $cbc)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
|
||||
$VDADconf_exten = "$aryA[0]";
|
||||
$VDADuser = "$aryA[1]";
|
||||
$VDADextension = "$aryA[2]";
|
||||
$VDADconf_exten = $aryA[0];
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
|
||||
$cbc++;
|
||||
}
|
||||
@@ -1850,7 +1853,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$calls_today = "$aryA[0]";
|
||||
$calls_today = $aryA[0];
|
||||
$calls_today++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1880,6 +1883,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
|
||||
### BEGIN REMOTE AGENT SECTION
|
||||
if ($VDADextension =~ /^R\//)
|
||||
{
|
||||
### set the callerid to the ACQS value(calleridname)
|
||||
@@ -1895,10 +1899,67 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADconf_exten = "$phone_number$S$vendor_id";
|
||||
}
|
||||
|
||||
if (length($ra_user) > 0)
|
||||
{
|
||||
$extension_group='';
|
||||
$stmtA = "SELECT extension_group,extension_group_order FROM vicidial_remote_agents where user_start='$ra_user';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01131'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$extension_group = $aryA[0];
|
||||
$extension_group_order = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ( (length($extension_group) > 0) and ($extension_group !~ /^NONE/) )
|
||||
{
|
||||
$extension_group_orderSQL = 'order by last_call_time';
|
||||
if ($extension_group_order =~ /RANK/)
|
||||
{$extension_group_orderSQL = 'order by rank desc, last_call_time';}
|
||||
if ($extension_group_order =~ /CALL_COUNT/)
|
||||
{$extension_group_orderSQL = 'order by call_count_today, last_call_time';}
|
||||
$stmtA = "UPDATE vicidial_extension_groups set last_callerid='$callerid',last_call_time=NOW(),call_count_today=(call_count_today + 1) where extension_group_id='$extension_group' and ( (campaign_groups='') or (campaign_groups LIKE \"%|$channel_group|%\") ) $extension_group_orderSQL limit 1;";
|
||||
$VEGaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01132'; $MEL_aff_rows=$VEGaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN GROUP : |$VEGaffected_rows|update of veg table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
if ($VEGaffected_rows > 0)
|
||||
{
|
||||
$stmtA = "SELECT extension,extension_id,call_count_today FROM vicidial_extension_groups where last_callerid='$callerid' order by last_call_time desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01133'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = $aryA[0];
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN SET : |$VDADconf_exten|$aryA[1]|$aryA[2]|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$phone_number\>"; &agi_output;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set ra_extension='$VDADconf_exten' where extension='$VDADextension' and ra_user='$ra_user';";
|
||||
$rVLAaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01140'; $MEL_aff_rows=$rVLAaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set extension='$VDADconf_exten' where callerid='$callerid';";
|
||||
$rVACaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01141'; $MEL_aff_rows=$rVACaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_remote_agent_log set callerid='$callerid',uniqueid='$uniqueid',ra_user='$ra_user',user='$VDADuser',call_time=NOW(),extension='$VDADconf_exten',lead_id='$insert_lead_id',phone_number='$phone_number',campaign_id='$channel_group',processed='N';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01137'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN LOG : |$RALaffected_rows|CID changed: \"$callerid\" \<$phone_number\>\n|$stmtA|"; &agi_output;}
|
||||
}
|
||||
### END REMOTE AGENT SECTION
|
||||
|
||||
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$insert_lead_id' and call_date='$SQLdate';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
@@ -2062,7 +2123,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
else
|
||||
{$vlia_users="''";}
|
||||
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($vlia_users) $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -2077,13 +2138,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADextension = $aryA[2];
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADgroup_weight = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
|
||||
|
||||
if ($AGENTgrab > 0)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
$stmtA = "SELECT conf_exten,extension,server_ip,ra_user from vicidial_live_agents WHERE user='$AGENTuser';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -2096,6 +2158,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADextension = $aryA[1];
|
||||
$VDADuser = $AGENTuser;
|
||||
$VDADserver_ip = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
@@ -2129,7 +2192,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($aco_sub<1)
|
||||
{
|
||||
$cbc=0;
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,last_call_time,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -2143,6 +2206,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADextension = $aryA[2];
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$VDADlast_call_time = $aryA[4];
|
||||
$ra_user = $aryA[5];
|
||||
$cbc++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -2293,6 +2357,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
if ($min < 10) {$min = "0$min";}
|
||||
if ($sec < 10) {$sec = "0$sec";}
|
||||
|
||||
### BEGIN REMOTE AGENT SSECTION
|
||||
if ($VDADextension =~ /^R\//)
|
||||
{
|
||||
### set the callerid to the ACQS value(calleridname)
|
||||
@@ -2308,10 +2373,69 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
|
||||
$VDADremDIALstr = "$a$S$b$S$c$S$d$S$phone_number$S$vendor_id";
|
||||
}
|
||||
|
||||
if (length($ra_user) > 0)
|
||||
{
|
||||
$extension_group='';
|
||||
$stmtA = "SELECT extension_group,extension_group_order FROM vicidial_remote_agents where user_start='$ra_user';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01134'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$extension_group = $aryA[0];
|
||||
$extension_group_order = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ( (length($extension_group) > 0) and ($extension_group !~ /^NONE/) )
|
||||
{
|
||||
$extension_group_orderSQL = 'order by last_call_time';
|
||||
if ($extension_group_order =~ /RANK/)
|
||||
{$extension_group_orderSQL = 'order by rank desc, last_call_time';}
|
||||
if ($extension_group_order =~ /CALL_COUNT/)
|
||||
{$extension_group_orderSQL = 'order by call_count_today, last_call_time';}
|
||||
$stmtA = "UPDATE vicidial_extension_groups set last_callerid='$callerid',last_call_time=NOW(),call_count_today=(call_count_today + 1) where extension_group_id='$extension_group' and ( (campaign_groups='') or (campaign_groups LIKE \"%|$channel_group|%\") ) $extension_group_orderSQL limit 1;";
|
||||
$VEGaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01135'; $MEL_aff_rows=$VEGaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN GROUP : |$VEGaffected_rows|update of veg table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
if ($VEGaffected_rows > 0)
|
||||
{
|
||||
$stmtA = "SELECT extension,extension_id,call_count_today FROM vicidial_extension_groups where last_callerid='$callerid' order by last_call_time desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01136'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = $aryA[0];
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN SET : |$VDADconf_exten|$aryA[1]|$aryA[2]|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$phone_number\>"; &agi_output;}
|
||||
|
||||
$VDADremDIALstr = "$a$S$b$S$c$S$d$S$VDADconf_exten";
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set ra_extension='$VDADremDIALstr' where extension='$VDADextension' and ra_user='$ra_user';";
|
||||
$rVLAaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01142'; $MEL_aff_rows=$rVLAaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set extension='$VDADremDIALstr' where callerid='$callerid';";
|
||||
$rVACaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01143'; $MEL_aff_rows=$rVACaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_remote_agent_log set callerid='$callerid',uniqueid='$uniqueid',ra_user='$ra_user',user='$VDADuser',call_time=NOW(),extension='$VDADconf_exten',lead_id='$insert_lead_id',phone_number='$phone_number',campaign_id='$channel_group',processed='N';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01138'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN LOG : |$RALaffected_rows|CID changed: \"$callerid\" \<$phone_number\>\n|$stmtA|"; &agi_output;}
|
||||
}
|
||||
### END REMOTE AGENT SECTION
|
||||
|
||||
$stmtA = "UPDATE vicidial_closer_log set queue_seconds='$drop_timer' where lead_id = '$insert_lead_id' and call_date='$SQLdate';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
@@ -72,12 +72,13 @@
|
||||
# 91112-1101 - Changed ENTERQUEUE to CALLOUTBOUND in QM logging for outbound calls
|
||||
# 91230-1159 - Change to callee callerID when sending the call to VMAIL
|
||||
# 100205-1024 - Fixed CPD send to message
|
||||
# 100319-0610 - Added extension group remote agent feature
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_outbound.agi';
|
||||
$AGILOG = '0';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=57;
|
||||
$mysql_log_count=67;
|
||||
$one_mysql_log=0;
|
||||
|
||||
|
||||
@@ -1412,7 +1413,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
$VDADuser='';
|
||||
while ( (length($VDADuser)<1) && ($r<3) )
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1422,9 +1423,10 @@ while ($drop_timer <= $DROP_TIME)
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = "$aryA[0]";
|
||||
$VDADuser = "$aryA[1]";
|
||||
$VDADextension = "$aryA[2]";
|
||||
$VDADconf_exten = $aryA[0];
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1439,7 +1441,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
}
|
||||
if ($r > 2)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,ra_user FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1449,9 +1451,10 @@ while ($drop_timer <= $DROP_TIME)
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = "$aryA[0]";
|
||||
$VDADuser = "$aryA[1]";
|
||||
$VDADextension = "$aryA[2]";
|
||||
$VDADconf_exten = $aryA[0];
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$ra_user = $aryA[3];
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1460,6 +1463,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
}
|
||||
}
|
||||
|
||||
### BEGIN REMOTE AGENT SECTION
|
||||
if ($VDADextension =~ /^R\//)
|
||||
{
|
||||
### set the callerid to the ACQS value(calleridname)
|
||||
@@ -1485,13 +1489,65 @@ while ($drop_timer <= $DROP_TIME)
|
||||
$sthA->finish();
|
||||
$VDADconf_exten = "$VDADphone$S$vendor_id";
|
||||
}
|
||||
if (length($ra_user) > 0)
|
||||
{
|
||||
$extension_group='';
|
||||
$stmtA = "SELECT extension_group,extension_group_order FROM vicidial_remote_agents where user_start='$ra_user';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01058'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$extension_group = $aryA[0];
|
||||
$extension_group_order = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ( (length($extension_group) > 0) and ($extension_group !~ /^NONE/) )
|
||||
{
|
||||
$extension_group_orderSQL = 'order by last_call_time';
|
||||
if ($extension_group_order =~ /RANK/)
|
||||
{$extension_group_orderSQL = 'order by rank desc, last_call_time';}
|
||||
if ($extension_group_order =~ /CALL_COUNT/)
|
||||
{$extension_group_orderSQL = 'order by call_count_today, last_call_time';}
|
||||
$stmtA = "UPDATE vicidial_extension_groups set last_callerid='$callerid',last_call_time=NOW(),call_count_today=(call_count_today + 1) where extension_group_id='$extension_group' and ( (campaign_groups='') or (campaign_groups LIKE \"%|$VDADcampaign|%\") ) $extension_group_orderSQL limit 1;";
|
||||
$VEGaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01059'; $MEL_aff_rows=$VEGaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN GROUP : |$VEGaffected_rows|update of veg table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
if ($VEGaffected_rows > 0)
|
||||
{
|
||||
$stmtA = "SELECT extension,extension_id,call_count_today FROM vicidial_extension_groups where last_callerid='$callerid' order by last_call_time desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01060'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = $aryA[0];
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN SET : |$VDADconf_exten|$aryA[1]|$aryA[2]|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<$VDADphone\>"; &agi_output;}
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';";
|
||||
$stmtA = "UPDATE vicidial_live_agents set ra_extension='$VDADconf_exten' where extension='$VDADextension' and ra_user='$ra_user';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01066'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_remote_agent_log set callerid='$callerid',uniqueid='$uniqueid',ra_user='$ra_user',user='$VDADuser',call_time=NOW(),extension='$VDADconf_exten',lead_id='$CIDlead_id',phone_number='$VDADphone',campaign_id='$VDADcampaign',processed='N';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01064'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN LOG : |$RALaffected_rows|CID changed: \"$callerid\" \<$VDADphone\>\n|$stmtA|"; &agi_output;}
|
||||
}
|
||||
### END REMOTE AGENT SECTION
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer', extension='$VDADconf_exten' where callerid='$callerid';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01038'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
@@ -1603,7 +1659,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
$VDADuser='';
|
||||
while ( (length($VDADuser)<1) && ($r<3) )
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,ra_user FROM vicidial_live_agents where status IN('QUEUE','INCALL') and campaign_id='$VDADcampaign' and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1613,10 +1669,11 @@ while ($drop_timer <= $DROP_TIME)
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = "$aryA[0]";
|
||||
$VDADuser = "$aryA[1]";
|
||||
$VDADextension = "$aryA[2]";
|
||||
$VDADserver_ip = "$aryA[3]";
|
||||
$VDADconf_exten = $aryA[0];
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$ra_user = $aryA[4];
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1631,7 +1688,7 @@ while ($drop_timer <= $DROP_TIME)
|
||||
}
|
||||
if ($r > 2)
|
||||
{
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;";
|
||||
$stmtA = "SELECT conf_exten,user,extension,server_ip,ra_user FROM vicidial_live_agents where callerid='$callerid' order by last_call_time limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -1641,10 +1698,11 @@ while ($drop_timer <= $DROP_TIME)
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = "$aryA[0]";
|
||||
$VDADuser = "$aryA[1]";
|
||||
$VDADextension = "$aryA[2]";
|
||||
$VDADserver_ip = "$aryA[3]";
|
||||
$VDADconf_exten = $aryA[0];
|
||||
$VDADuser = $aryA[1];
|
||||
$VDADextension = $aryA[2];
|
||||
$VDADserver_ip = $aryA[3];
|
||||
$ra_user = $aryA[4];
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1653,13 +1711,9 @@ while ($drop_timer <= $DROP_TIME)
|
||||
}
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01045'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAD XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
|
||||
### format the remote server dialstring to get the call to the overflow agent meetme room
|
||||
$S='*';
|
||||
$VDADremDIALstr='';
|
||||
if( $VDADserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ )
|
||||
{
|
||||
$a = leading_zero($1);
|
||||
@@ -1668,8 +1722,8 @@ while ($drop_timer <= $DROP_TIME)
|
||||
$d = leading_zero($4);
|
||||
$VDADremDIALstr = "$a$S$b$S$c$S$d$S";
|
||||
}
|
||||
$VDADremDIALstr .= "$VDADconf_exten";
|
||||
|
||||
### BEGIN REMOTE AGENT SECTION
|
||||
if ($VDADextension =~ /^R\//)
|
||||
{
|
||||
### set the callerid to the ACQS value(calleridname)
|
||||
@@ -1695,10 +1749,70 @@ while ($drop_timer <= $DROP_TIME)
|
||||
$VDADremDIALstr = "$a$S$b$S$c$S$d$S$VDADphone$S$vendor_id";
|
||||
}
|
||||
|
||||
if (length($ra_user) > 0)
|
||||
{
|
||||
$extension_group='';
|
||||
$stmtA = "SELECT extension_group,extension_group_order FROM vicidial_remote_agents where user_start='$ra_user';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01061'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$extension_group = $aryA[0];
|
||||
$extension_group_order = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ( (length($extension_group) > 0) and ($extension_group !~ /^NONE/) )
|
||||
{
|
||||
$extension_group_orderSQL = 'order by last_call_time';
|
||||
if ($extension_group_order =~ /RANK/)
|
||||
{$extension_group_orderSQL = 'order by rank desc, last_call_time';}
|
||||
if ($extension_group_order =~ /CALL_COUNT/)
|
||||
{$extension_group_orderSQL = 'order by call_count_today, last_call_time';}
|
||||
$stmtA = "UPDATE vicidial_extension_groups set last_callerid='$callerid',last_call_time=NOW(),call_count_today=(call_count_today + 1) where extension_group_id='$extension_group' and ( (campaign_groups='') or (campaign_groups LIKE \"%|$VDADcampaign|%\") ) $extension_group_orderSQL limit 1;";
|
||||
$VEGaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01062'; $MEL_aff_rows=$VEGaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN GROUP : |$VEGaffected_rows|update of veg table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
if ($VEGaffected_rows > 0)
|
||||
{
|
||||
$stmtA = "SELECT extension,extension_id,call_count_today FROM vicidial_extension_groups where last_callerid='$callerid' order by last_call_time desc limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='01063'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VDADconf_exten = $aryA[0];
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN SET : |$VDADconf_exten|$aryA[1]|$aryA[2]|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<$VDADphone\>"; &agi_output;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set ra_extension='$VDADremDIALstr$VDADconf_exten' where extension='$VDADextension' and ra_user='$ra_user';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01067'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_remote_agent_log set callerid='$callerid',uniqueid='$uniqueid',ra_user='$ra_user',user='$VDADuser',call_time=NOW(),extension='$VDADconf_exten',lead_id='$CIDlead_id',phone_number='$VDADphone',campaign_id='$VDADcampaign',processed='N';";
|
||||
$RALaffected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01065'; $MEL_aff_rows=$RALaffected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- REMOTE EXTEN LOG : |$RALaffected_rows|CID changed: \"$callerid\" \<$VDADphone\>\n|$stmtA|"; &agi_output;}
|
||||
}
|
||||
### END REMOTE AGENT SECTION
|
||||
|
||||
$VDADremDIALstr .= "$VDADconf_exten";
|
||||
|
||||
$stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer', extension='$VDADremDIALstr' where callerid='$callerid';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
$dbhP=$dbhA; $mysql_count='01045'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
|
||||
if ($AGILOG) {$agi_string = "-- VDAD XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;}
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
# 91013-1128 - Added full inbound compatibility with vicidial_live_inbound_agents table
|
||||
# 91123-1802 - Added outbound_autodial field
|
||||
# 100309-0555 - Added queuemetrics_loginout option
|
||||
# 100318-2307 - Added ra_user field input to vla table
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -549,7 +550,7 @@ while($one_day_interval > 0)
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,campaign_id,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,channel,uniqueid,callerid,user_level,comments,last_state_change,outbound_autodial) values('$DBremote_user[$h]','$server_ip','$DBremote_conf_exten[$h]','R/$DBremote_user[$h]','READY','$DBremote_campaign[$h]','$DBremote_random[$h]','$SQLdate','$FDtsSQLdate','$SQLdate','$DBremote_closer[$h]','','','','$DBuser_level[$h]','REMOTE','$SQLdate','$CAMPAIGN_autodial[$h]');";
|
||||
$stmtA = "INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,campaign_id,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,channel,uniqueid,callerid,user_level,comments,last_state_change,outbound_autodial,ra_user) values('$DBremote_user[$h]','$server_ip','$DBremote_conf_exten[$h]','R/$DBremote_user[$h]','READY','$DBremote_campaign[$h]','$DBremote_random[$h]','$SQLdate','$FDtsSQLdate','$SQLdate','$DBremote_closer[$h]','','','','$DBuser_level[$h]','REMOTE','$SQLdate','$CAMPAIGN_autodial[$h]','$DBuser_start[$h]');";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print STDERR "$DBremote_user[$h] NEW INSERT\n";}
|
||||
if ($TESTrun > 0)
|
||||
|
||||
@@ -28,12 +28,16 @@ New scripts:
|
||||
|
||||
|
||||
|
||||
Required variables for API calls:
|
||||
Required variables for all API calls:
|
||||
# user - is the API user
|
||||
# pass - is the API user password
|
||||
# agent_user - is the vicidial agent user whose session that you want to affect
|
||||
# source - description of what originated the API call (maximum 20 characters)
|
||||
|
||||
Optional variable for all API calls:
|
||||
# close_window_link - will display a link to close the window, useful if you pop up the API link in a browser window
|
||||
# language - currently only works for close window link: en=English, es=Spanish
|
||||
|
||||
|
||||
|
||||
To hangup the call, disposition it and then pause the agent, do the following in order:
|
||||
|
||||
@@ -369,6 +369,8 @@ last_state_change DATETIME,
|
||||
agent_territories TEXT,
|
||||
outbound_autodial ENUM('Y','N') default 'N',
|
||||
manager_ingroup_set ENUM('Y','N','SET') default 'N',
|
||||
ra_user VARCHAR(20) default '',
|
||||
ra_extension VARCHAR(100) default '',
|
||||
index (random_id),
|
||||
index (last_call_time),
|
||||
index (last_update_time),
|
||||
@@ -395,6 +397,7 @@ queue_priority TINYINT(2) default '0',
|
||||
agent_only VARCHAR(20) default '',
|
||||
agent_grab VARCHAR(20) default '',
|
||||
queue_position SMALLINT(4) UNSIGNED default '1',
|
||||
extension VARCHAR(100) default '',
|
||||
index (uniqueid),
|
||||
index (callerid),
|
||||
index (call_time),
|
||||
@@ -897,7 +900,9 @@ server_ip VARCHAR(15) NOT NULL,
|
||||
conf_exten VARCHAR(20),
|
||||
status ENUM('ACTIVE','INACTIVE') default 'INACTIVE',
|
||||
campaign_id VARCHAR(8),
|
||||
closer_campaigns TEXT
|
||||
closer_campaigns TEXT,
|
||||
extension_group VARCHAR(20) default 'NONE',
|
||||
extension_group_order VARCHAR(20) default 'NONE'
|
||||
);
|
||||
|
||||
CREATE TABLE live_inbound_log (
|
||||
@@ -954,7 +959,7 @@ user VARCHAR(20),
|
||||
server_ip VARCHAR(15) NOT NULL,
|
||||
event_time DATETIME,
|
||||
lead_id INT(9) UNSIGNED,
|
||||
campaign_id VARCHAR(8),
|
||||
campaign_id VARCHAR(8),
|
||||
pause_epoch INT(10) UNSIGNED,
|
||||
pause_sec SMALLINT(5) UNSIGNED default '0',
|
||||
wait_epoch INT(10) UNSIGNED,
|
||||
@@ -2000,6 +2005,36 @@ index (card_id),
|
||||
index (call_time)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_extension_groups (
|
||||
extension_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
extension_group_id VARCHAR(20) NOT NULL,
|
||||
extension VARCHAR(100) default '8300',
|
||||
rank MEDIUMINT(7) default '0',
|
||||
campaign_groups TEXT,
|
||||
call_count_today MEDIUMINT(7) default '0',
|
||||
last_call_time DATETIME,
|
||||
last_callerid VARCHAR(20) default '',
|
||||
index (extension_group_id)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_remote_agent_log (
|
||||
uniqueid VARCHAR(20) default '',
|
||||
callerid VARCHAR(20) default '',
|
||||
ra_user VARCHAR(20),
|
||||
user VARCHAR(20),
|
||||
call_time DATETIME,
|
||||
extension VARCHAR(100) default '',
|
||||
lead_id INT(9) UNSIGNED default '0',
|
||||
phone_number VARCHAR(18) default '',
|
||||
campaign_id VARCHAR(20) default '',
|
||||
processed ENUM('Y','N') default 'N',
|
||||
comment VARCHAR(255) default '',
|
||||
index (call_time),
|
||||
index (ra_user),
|
||||
index (extension),
|
||||
index (phone_number)
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||
|
||||
@@ -2139,7 +2174,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
|
||||
|
||||
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1208',db_schema_update_date=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1209',db_schema_update_date=NOW();
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -173,3 +173,43 @@ UPDATE system_settings SET db_schema_version='1207',db_schema_update_date=NOW();
|
||||
ALTER TABLE vicidial_user_groups ADD agent_fullscreen ENUM('Y','N') default 'N';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1208',db_schema_update_date=NOW();
|
||||
|
||||
ALTER TABLE vicidial_auto_calls ADD extension VARCHAR(100) default '';
|
||||
|
||||
ALTER TABLE vicidial_live_agents ADD ra_user VARCHAR(20) default '';
|
||||
ALTER TABLE vicidial_live_agents ADD ra_extension VARCHAR(100) default '';
|
||||
|
||||
ALTER TABLE vicidial_remote_agents ADD extension_group VARCHAR(20) default 'NONE';
|
||||
ALTER TABLE vicidial_remote_agents ADD extension_group_order VARCHAR(20) default 'NONE';
|
||||
|
||||
CREATE TABLE vicidial_extension_groups (
|
||||
extension_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
extension_group_id VARCHAR(20) NOT NULL,
|
||||
extension VARCHAR(100) default '8300',
|
||||
rank MEDIUMINT(7) default '0',
|
||||
campaign_groups TEXT,
|
||||
call_count_today MEDIUMINT(7) default '0',
|
||||
last_call_time DATETIME,
|
||||
last_callerid VARCHAR(20) default '',
|
||||
index (extension_group_id)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_remote_agent_log (
|
||||
uniqueid VARCHAR(20) default '',
|
||||
callerid VARCHAR(20) default '',
|
||||
ra_user VARCHAR(20),
|
||||
user VARCHAR(20),
|
||||
call_time DATETIME,
|
||||
extension VARCHAR(100) default '',
|
||||
lead_id INT(9) UNSIGNED default '0',
|
||||
phone_number VARCHAR(18) default '',
|
||||
campaign_id VARCHAR(20) default '',
|
||||
processed ENUM('Y','N') default 'N',
|
||||
comment VARCHAR(255) default '',
|
||||
index (call_time),
|
||||
index (ra_user),
|
||||
index (extension),
|
||||
index (phone_number)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1209',db_schema_update_date=NOW();
|
||||
|
||||
@@ -53,6 +53,37 @@ Agent Allow Dial Override Xfer||
|
||||
Agent Allow Consultative Xfer||
|
||||
Agent Fullscreen||
|
||||
This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled||
|
||||
Add Extension Group||
|
||||
New Group Extension Addition||
|
||||
Modify Extension Group||
|
||||
Delete Extension Group||
|
||||
Extension Groups||
|
||||
Add Extension Group Entry||
|
||||
Extension Group||
|
||||
This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers||
|
||||
Extension:||
|
||||
This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry||
|
||||
This field allows you to rank the extension group entries that share the same extension group. Default is 0||
|
||||
Campaigns Groups||
|
||||
In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string||
|
||||
EXTENSION GROUP ENTRY NOT ADDED||
|
||||
there is already an extension group entry with these values||
|
||||
EXTENSION GROUP ENTRY ADDED||
|
||||
MODIFY AN EXTENSION GROUP ENTRY||
|
||||
Click here to see Admin chages to this extension group entry||
|
||||
DELETE THIS EXTENSION GROUP ENTRY||
|
||||
Call Count Today||
|
||||
Last Call Time||
|
||||
Last Call ID||
|
||||
EXTENSION GROUP ENTRY NOT MODIFIED||
|
||||
EXTENSION GROUP ENTRY MODIFIED||
|
||||
EXTENSION GROUP ENTRY NOT DELETED||
|
||||
EXTENSION GROUP ENTRY DELETION CONFIRMATION||
|
||||
Click here to delete extension group entry||
|
||||
EXTENSION GROUP ENTRY DELETION COMPLETED||
|
||||
EXTENSION GROUP LISTINGS||
|
||||
Extension Group||
|
||||
If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
# - $alt_user
|
||||
# - $stage
|
||||
# - $status
|
||||
# - $close_window_link
|
||||
# - $language
|
||||
|
||||
# CHANGELOG:
|
||||
# 80703-2225 - First build of script
|
||||
@@ -43,10 +45,10 @@
|
||||
# 91211-1805 - Added st_login_log and st_get_agent_active_lead functions, added alt_user
|
||||
# 91228-1059 - Added update_fields function
|
||||
# 100315-2021 - Added ra_call_control function
|
||||
#
|
||||
# 100318-0605 - Added close_window_link and language options
|
||||
|
||||
$version = '2.2.0-12';
|
||||
$build = '100315-2021';
|
||||
$version = '2.2.0-13';
|
||||
$build = '100318-0605';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -147,6 +149,9 @@ if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["close_window_link"])) {$close_window_link=$_GET["close_window_link"];}
|
||||
elseif (isset($_POST["close_window_link"])) {$close_window_link=$_POST["close_window_link"];}
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
@@ -345,7 +350,6 @@ if ($function == 'external_hangup')
|
||||
$result_reason = "external_hangup not valid";
|
||||
echo "$result: $result_reason - $value|$agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -413,7 +417,6 @@ if ($function == 'external_status')
|
||||
$result_reason = "external_status not valid";
|
||||
echo "$result: $result_reason - $value|$agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -481,7 +484,6 @@ if ($function == 'external_pause')
|
||||
$result_reason = "external_pause not valid";
|
||||
echo "$result: $result_reason - $value|$agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -568,7 +570,6 @@ if ($function == 'external_dial')
|
||||
$data = "$phone_code|$search|$preview|$focus";
|
||||
echo "$result: $result_reason - $value|$data|$agent_user|$alt_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -796,7 +797,6 @@ if ($function == 'change_ingroups')
|
||||
$data = "$value|$blended|$ingroup_choices";
|
||||
echo "$result: $result_reason - $data|$agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1033,7 +1033,6 @@ if ($function == 'update_fields')
|
||||
$data = "$agent_user";
|
||||
echo "$result: $result_reason - $data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1259,7 +1258,6 @@ if ($function == 'update_fields')
|
||||
$result_reason = "no fields have been defined";
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1268,7 +1266,6 @@ if ($function == 'update_fields')
|
||||
$result_reason = "agent_user does not have a lead on their screen";
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1308,7 +1305,6 @@ if ($function == 'set_timer_action')
|
||||
$data = "$agent_user|$value";
|
||||
echo "$result: $result_reason - $data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1371,7 +1367,6 @@ if ($function == 'st_login_log')
|
||||
$data = "$value|$vendor_id";
|
||||
echo "$result: $result_reason - $data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1425,7 +1420,6 @@ if ($function == 'st_get_agent_active_lead')
|
||||
$data = "$value|$vendor_id";
|
||||
echo "$result: $result_reason - $data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1514,7 +1508,6 @@ if ($function == 'ra_call_control')
|
||||
$result_reason = "ra_call_control not valid";
|
||||
echo "$result: $result_reason - $value|$agent_user|$stage\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1786,6 +1779,24 @@ if ($function == 'ra_call_control')
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - optional "close window" link
|
||||
################################################################################
|
||||
if ($close_window_link > 0)
|
||||
{
|
||||
$close_this_window_text = 'Close This Window';
|
||||
if ($language=='es')
|
||||
{$close_this_window_text = 'Cerrar esta ventana';}
|
||||
echo "\n<a href=\"javascript:window.opener='x';window.close();\">$close_this_window_text</a>\n";
|
||||
}
|
||||
################################################################################
|
||||
### END - optional "close window" link
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
|
||||
@@ -1213,6 +1213,14 @@ if (isset($_GET["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_
|
||||
elseif (isset($_POST["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_POST["agent_xfer_park_customer_dial"];}
|
||||
if (isset($_GET["agent_fullscreen"])) {$agent_fullscreen=$_GET["agent_fullscreen"];}
|
||||
elseif (isset($_POST["agent_fullscreen"])) {$agent_fullscreen=$_POST["agent_fullscreen"];}
|
||||
if (isset($_GET["extension_id"])) {$extension_id=$_GET["extension_id"];}
|
||||
elseif (isset($_POST["extension_id"])) {$extension_id=$_POST["extension_id"];}
|
||||
if (isset($_GET["extension_group_id"])) {$extension_group_id=$_GET["extension_group_id"];}
|
||||
elseif (isset($_POST["extension_group_id"])) {$extension_group_id=$_POST["extension_group_id"];}
|
||||
if (isset($_GET["campaign_groups"])) {$campaign_groups=$_GET["campaign_groups"];}
|
||||
elseif (isset($_POST["campaign_groups"])) {$campaign_groups=$_POST["campaign_groups"];}
|
||||
if (isset($_GET["extension_group"])) {$extension_group=$_GET["extension_group"];}
|
||||
elseif (isset($_POST["extension_group"])) {$extension_group=$_POST["extension_group"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -1418,6 +1426,7 @@ if ($non_latin < 1)
|
||||
$enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log);
|
||||
$callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled);
|
||||
$callcard_admin = ereg_replace("[^0-9]","",$callcard_admin);
|
||||
$extension_id = ereg_replace("[^0-9]","",$extension_id);
|
||||
|
||||
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
|
||||
|
||||
@@ -1700,6 +1709,8 @@ if ($non_latin < 1)
|
||||
$timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action);
|
||||
$record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call);
|
||||
$scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert);
|
||||
$extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id);
|
||||
$extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and slash and dot
|
||||
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
|
||||
@@ -1713,6 +1724,7 @@ if ($non_latin < 1)
|
||||
$filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename);
|
||||
$am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten);
|
||||
$am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override);
|
||||
$campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and comma
|
||||
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
|
||||
@@ -2309,6 +2321,7 @@ if ($ADD==1411) {$hh='ingroups'; echo "Copy DID";}
|
||||
if ($ADD==1511) {$hh='ingroups'; echo "Add Call Menu";}
|
||||
if ($ADD==1611) {$hh='ingroups'; echo "Copy Call Menu";}
|
||||
if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";}
|
||||
if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";}
|
||||
if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";}
|
||||
if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";}
|
||||
if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";}
|
||||
@@ -2345,6 +2358,7 @@ if ($ADD==2411) {$hh='ingroups'; echo "New Copied DID Addition";}
|
||||
if ($ADD==2511) {$hh='ingroups'; echo "New Call Menu";}
|
||||
if ($ADD==2611) {$hh='ingroups'; echo "New Call Menu";}
|
||||
if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";}
|
||||
if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";}
|
||||
if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";}
|
||||
if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";}
|
||||
if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";}
|
||||
@@ -2404,6 +2418,7 @@ if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";}
|
||||
if ($ADD==3311) {$hh='ingroups'; echo "Modify DID";}
|
||||
if ($ADD==3511) {$hh='ingroups'; echo "Modify Call Menu";}
|
||||
if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";}
|
||||
if ($ADD==32111) {$hh='remoteagent'; echo "Modify Extension Group";}
|
||||
if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";}
|
||||
if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";}
|
||||
if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";}
|
||||
@@ -2443,6 +2458,7 @@ if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";}
|
||||
if ($ADD==4311) {$hh='ingroups'; echo "Modify DID";}
|
||||
if ($ADD==4511) {$hh='ingroups'; echo "Modify Call Menu";}
|
||||
if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";}
|
||||
if ($ADD==42111) {$hh='remoteagent'; echo "Modify Extension Group";}
|
||||
if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";}
|
||||
if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";}
|
||||
if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";}
|
||||
@@ -2474,6 +2490,7 @@ if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";}
|
||||
if ($ADD==5311) {$hh='ingroups'; echo "Delete DID";}
|
||||
if ($ADD==5511) {$hh='ingroups'; echo "Delete Call Menu";}
|
||||
if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";}
|
||||
if ($ADD==52111) {$hh='remoteagent'; echo "Delete Extension Group";}
|
||||
if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";}
|
||||
if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";}
|
||||
if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";}
|
||||
@@ -2505,6 +2522,7 @@ if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";}
|
||||
if ($ADD==6311) {$hh='ingroups'; echo "Delete DID";}
|
||||
if ($ADD==6511) {$hh='ingroups'; echo "Delete Call Menu";}
|
||||
if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";}
|
||||
if ($ADD==62111) {$hh='remoteagent'; echo "Delete Extension Group";}
|
||||
if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";}
|
||||
if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";}
|
||||
if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";}
|
||||
@@ -2540,6 +2558,7 @@ if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";}
|
||||
if ($ADD==1300) {$hh='ingroups'; echo "DIDs";}
|
||||
if ($ADD==1500) {$hh='ingroups'; echo "Call Menus";}
|
||||
if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";}
|
||||
if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";}
|
||||
if ($ADD==100000) {$hh='usergroups'; echo "User Groups";}
|
||||
if ($ADD==1000000) {$hh='scripts'; echo "Scripts";}
|
||||
if ($ADD==10000000) {$hh='filters'; echo "Filters";}
|
||||
@@ -4770,6 +4789,11 @@ if ($ADD==99999)
|
||||
<BR>
|
||||
<B>External Extension -</B> This is the number that you want the calls forwarded to. Make sure that it is a full dial plan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_remote_agents-extension_group">
|
||||
<BR>
|
||||
<B>Extension Group -</B> If set to something other than NONE or empty this will override the External Extension field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_remote_agents-status">
|
||||
<BR>
|
||||
@@ -4786,6 +4810,29 @@ if ($ADD==99999)
|
||||
<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign.
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>VICIDIAL_EXTENSION_GROUPS TABLE</FONT></B><BR><BR>
|
||||
<A NAME="vicidial_extension_groups-extension_group_id">
|
||||
<BR>
|
||||
<B>Extension Group -</B> This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_extension_groups-extension">
|
||||
<BR>
|
||||
<B>Extension -</B> This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_extension_groups-rank">
|
||||
<BR>
|
||||
<B>Rank -</B> This field allows you to rank the extension group entries that share the same extension group. Default is 0.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_extension_groups-campaign_groups">
|
||||
<BR>
|
||||
<B>Campaigns Groups -</B> In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string.
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>VICIDIAL_CAMPAIGN_LISTS</FONT></B><BR><BR>
|
||||
@@ -6583,9 +6630,9 @@ if ($ADD=="1")
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=10> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=20> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
}
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=10>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=20>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Level: </td><td align=left><select size=1 name=user_level>";
|
||||
$h=1;
|
||||
@@ -6657,9 +6704,9 @@ if ($ADD=="1A")
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=10> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Number: </td><td align=left><input type=text name=user id=user size=20 maxlength=20> <input type=button name=auto_user value=\"AUTO-GENERATE\" onClick=\"user_auto()\"> $NWB#vicidial_users-user$NWE</td></tr>\n";
|
||||
}
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=10>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Password: </td><td align=left><input type=text name=pass size=20 maxlength=20>$NWB#vicidial_users-pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Full Name: </td><td align=left><input type=text name=full_name size=20 maxlength=100>$NWB#vicidial_users-full_name$NWE</td></tr>\n";
|
||||
|
||||
if ($LOGuser_level==9) {$levelMAX=10;}
|
||||
@@ -7442,6 +7489,46 @@ if ($ADD==11111)
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=12111 display the ADD NEW EXTENSION GROUP SCREEN
|
||||
######################
|
||||
|
||||
if ($ADD==12111)
|
||||
{
|
||||
if ($LOGmodify_remoteagents==1)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>Add Extension Group Entry<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=22111>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><input type=text name=extension_group_id size=20 maxlength=20> (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Extension: </td><td align=left><input type=text name=extension size=18 maxlength=18> (numbers only)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Rank: </td><td align=left><select size=1 name=rank>\n";
|
||||
$n=99; $rank=0;
|
||||
while ($n>=-99)
|
||||
{
|
||||
if ($n == $rank)
|
||||
{echo "<option SELECTED value=\"$n\">$n</option>\n";}
|
||||
else
|
||||
{echo "<option value=\"$n\">$n</option>\n";}
|
||||
$n--;
|
||||
}
|
||||
echo "</select> $NWB#vicidial_extension_groups-rank$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campaigns Groups: </td><td align=left><input type=text name=campaign_groups size=50 maxlength=255> (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=111111 display the ADD NEW USERS GROUP SCREEN
|
||||
######################
|
||||
@@ -8203,10 +8290,10 @@ if ($ADD=="2")
|
||||
{
|
||||
$user = 'AUTOGENERA';
|
||||
}
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) )
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) )
|
||||
{
|
||||
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>user id must be between 2 and 10 characters long\n";
|
||||
echo "<br>user id must be between 2 and 20 characters long\n";
|
||||
echo "<br>full name and password must be at least 2 characters long\n";
|
||||
echo "<br>you must select a user group\n";
|
||||
}
|
||||
@@ -8491,10 +8578,10 @@ if ($ADD=="2A")
|
||||
{echo "<br>USER NOT ADDED - there is already a user in the system with this user number\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) )
|
||||
if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) )
|
||||
{
|
||||
echo "<br>USER NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>user id must be between 2 and 10 characters long\n";
|
||||
echo "<br>user id must be between 2 and 20 characters long\n";
|
||||
echo "<br>full name and password must be at least 2 characters long\n";
|
||||
echo "<!-- |$user|$pass|$full_name| -->\n";
|
||||
}
|
||||
@@ -9581,7 +9668,7 @@ if ($ADD==21111)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');";
|
||||
$stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>REMOTE AGENTS ADDED: $user_start</B>\n";
|
||||
@@ -9598,6 +9685,51 @@ if ($ADD==21111)
|
||||
$ADD=10000;
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=22111 adds new extension group entry to the system
|
||||
######################
|
||||
|
||||
if ($ADD==22111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{echo "<br>EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) )
|
||||
{
|
||||
echo "<br>EXTENSION GROUP ENTRY NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>extension group id and extension and rank must be at least 2 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extension_id = $row[0];
|
||||
|
||||
echo "<br><B>EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension</B>\n";
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
}
|
||||
$ADD=12000;
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=211111 adds new user group to the system
|
||||
######################
|
||||
@@ -12585,7 +12717,7 @@ if ($ADD==41111)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';";
|
||||
$stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group' where remote_agent_id='$remote_agent_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>REMOTE AGENTS MODIFIED</B>\n";
|
||||
@@ -12608,6 +12740,46 @@ if ($ADD==41111)
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=42111 modify extenison group entry in the system
|
||||
######################
|
||||
|
||||
if ($ADD==42111)
|
||||
{
|
||||
if ($LOGmodify_remoteagents==1)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($extension_id) < 1) or (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) )
|
||||
{
|
||||
echo "<br>EXTENSION GROUP ENTRY NOT MODIFIED - Please go back and look at the data you entered\n";
|
||||
echo "<br>Extension group id and extension must be at least 2 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>EXTENSION GROUP ENTRY MODIFIED</B>\n";
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
$ADD=32111; # go to extension group modification form below
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=411111 modify user group info in the system
|
||||
######################
|
||||
@@ -14027,6 +14199,28 @@ if ($ADD==51111)
|
||||
$ADD='31111'; # go to remote agent modification below
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=52111 confirmation before deletion of extension group record
|
||||
######################
|
||||
|
||||
if ($ADD==52111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) )
|
||||
{
|
||||
echo "<br>EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n";
|
||||
echo "<br>extension_id be at least 1 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><B>EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id</B>\n";
|
||||
echo "<br><br><a href=\"$PHP_SELF?ADD=62111&extension_id=$extension_id&CoNfIrM=YES\">Click here to delete extension group entry $extension_id</a><br><br><br>\n";
|
||||
}
|
||||
|
||||
$ADD='32111'; # go to extension group modification below
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=511111 confirmation before deletion of user group record
|
||||
######################
|
||||
@@ -15158,6 +15352,41 @@ if ($ADD==61111)
|
||||
$ADD='10000'; # go to remote agents list
|
||||
}
|
||||
|
||||
######################
|
||||
# ADD=62111 delete extension group record
|
||||
######################
|
||||
|
||||
if ($ADD==62111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) )
|
||||
{
|
||||
echo "<br>EXTENSION GROUP ENTRY NOT DELETED - Please go back and look at the data you entered\n";
|
||||
echo "<br>extension_id be at least 1 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="DELETE from vicidial_extension_groups where extension_id='$extension_id' limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id</B>\n";
|
||||
echo "<br><br>\n";
|
||||
}
|
||||
|
||||
$ADD='12000'; # go to extension group list
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=611111 delete user group record
|
||||
######################
|
||||
@@ -20618,7 +20847,7 @@ if ($ADD==31111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';";
|
||||
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group from vicidial_remote_agents where remote_agent_id='$remote_agent_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$remote_agent_id = $row[0];
|
||||
@@ -20628,18 +20857,37 @@ if ($ADD==31111)
|
||||
$conf_exten = $row[4];
|
||||
$status = $row[5];
|
||||
$campaign_id = $row[6];
|
||||
$extension_group = $row[8];
|
||||
|
||||
##### get extension group listing for dynamic pulldown
|
||||
$stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;";
|
||||
$rsltx=mysql_query($stmt, $link);
|
||||
$extengrp_to_print = mysql_num_rows($rsltx);
|
||||
$extengrp_list='';
|
||||
$o=0;
|
||||
while ($extengrp_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rsltx);
|
||||
$extengrp_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "<br>MODIFY A REMOTE AGENTS ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=41111>\n";
|
||||
echo "<input type=hidden name=remote_agent_id value=\"$row[0]\">\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User ID Start: </td><td align=left><input type=text name=user_start size=6 maxlength=6 value=\"$user_start\"> (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=3&user=$user_start\">User ID Start</a>: </td><td align=left><input type=text name=user_start size=6 maxlength=6 value=\"$user_start\"> (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Number of Lines: </td><td align=left><input type=text name=number_of_lines size=3 maxlength=3 value=\"$number_of_lines\"> (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Server IP: </td><td align=left><select size=1 name=server_ip>\n";
|
||||
echo "$servers_list";
|
||||
echo "<option SELECTED>$row[3]</option>\n";
|
||||
echo "</select>$NWB#vicidial_remote_agents-server_ip$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>External Extension: </td><td align=left><input type=text name=conf_exten size=20 maxlength=20 value=\"$conf_exten\"> (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><select size=1 name=extension_group>\n";
|
||||
echo "$extengrp_list";
|
||||
echo "<option>NONE</option>\n";
|
||||
echo "<option SELECTED>$extension_group</option>\n";
|
||||
echo "</select>$NWB#vicidial_remote_agents-extension_group$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><select size=1 name=status><option SELECTED>ACTIVE</option><option>INACTIVE</option><option SELECTED>$status</option></select>$NWB#vicidial_remote_agents-status$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
|
||||
echo "$campaigns_list";
|
||||
@@ -20670,6 +20918,76 @@ if ($ADD==31111)
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=32111 modify extension group entry in the system
|
||||
######################
|
||||
|
||||
if ($ADD==32111)
|
||||
{
|
||||
if ($LOGmodify_remoteagents==1)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups where extension_id='$extension_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extension_id = $row[0];
|
||||
$extension_group_id = $row[1];
|
||||
$extension = $row[2];
|
||||
$rank = $row[3];
|
||||
$campaign_groups = $row[4];
|
||||
$call_count_today = $row[5];
|
||||
$last_call_time = $row[6];
|
||||
$last_callerid = $row[7];
|
||||
|
||||
echo "<br>MODIFY AN EXTENSION GROUP ENTRY: $row[0]<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=42111>\n";
|
||||
echo "<input type=hidden name=extension_id value=\"$extension_id\">\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Extension Group: </td><td align=left><input type=text name=extension_group_id size=20 maxlength=20 value=\"$extension_group_id\"> (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Extension: </td><td align=left><input type=text name=extension size=18 maxlength=18 value=\"$extension\"> (numbers only)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Rank: </td><td align=left><select size=1 name=rank>\n";
|
||||
$n=99;
|
||||
$rankfound=0;
|
||||
while ($n>=-99)
|
||||
{
|
||||
if ($n == $rank)
|
||||
{echo "<option SELECTED value=\"$n\">$n</option>\n"; $rankfound++;}
|
||||
else
|
||||
{echo "<option value=\"$n\">$n</option>\n";}
|
||||
$n--;
|
||||
}
|
||||
if ($rankfound < 1)
|
||||
{echo "<option SELECTED value=\"$rank\">$rank</option>\n";}
|
||||
|
||||
echo "</select> $NWB#vicidial_extension_groups-rank$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campaigns Groups: </td><td align=left><input type=text name=campaign_groups size=50 maxlength=255 value=\"$campaign_groups\"> (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Call Count Today: </td><td align=left>$call_count_today</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Last Call Time: </td><td align=left>$last_call_time</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Last Call ID: </td><td align=left>$last_callerid</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
if ($LOGdelete_remote_agents > 0)
|
||||
{
|
||||
echo "<br><br><a href=\"$PHP_SELF?ADD=52111&extension_id=$extension_id\">DELETE THIS EXTENSION GROUP ENTRY</a>\n";
|
||||
}
|
||||
if ($LOGuser_level >= 9)
|
||||
{
|
||||
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=EXTENGROUP&stage=$extension_id\">Click here to see Admin chages to this extension group entry</FONT>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=311111 modify user group info in the system
|
||||
######################
|
||||
@@ -21563,7 +21881,7 @@ if ($ADD==31111111111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>VMailDump Exten: </td><td align=left><input type=text name=voicemail_dump_exten size=20 maxlength=20 value=\"$row[30]\">$NWB#phones-voicemail_dump_exten$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Exten Context: </td><td align=left><input type=text name=ext_context size=20 maxlength=20 value=\"$row[31]\">$NWB#phones-ext_context$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Context: </td><td align=left><input type=text name=phone_context size=20 maxlength=20 value=\"$row[70]\">$NWB#phones-phone_context$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Conf File Secret: </td><td align=left><input type=text name=conf_secret size=20 maxlength=20 value=\"$row[72]\">$NWB#phones-conf_secret$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#CCFFFF><td align=right>Conf File Secret: </td><td align=left><input type=text name=conf_secret size=20 maxlength=20 value=\"$row[72]\">$NWB#phones-conf_secret$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>DTMFSend Channel: </td><td align=left><input type=text name=dtmf_send_extension size=40 maxlength=100 value=\"$row[32]\">$NWB#phones-dtmf_send_extension$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound Call Group: </td><td align=left><input type=text name=call_out_number_group size=40 maxlength=100 value=\"$row[33]\">$NWB#phones-call_out_number_group$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Browser Location: </td><td align=left><input type=text name=client_browser size=40 maxlength=100 value=\"$row[34]\">$NWB#phones-client_browser$NWE</td></tr>\n";
|
||||
@@ -23820,6 +24138,53 @@ if ($ADD==10000)
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=12000 display all extension group entries
|
||||
######################
|
||||
if ($ADD==12000)
|
||||
{
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups order by extension_group_id,rank,extension";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$extensiongroups_to_print = mysql_num_rows($rslt);
|
||||
|
||||
echo "<br>EXTENSION GROUP LISTINGS:\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td><font size=1 color=white><B>GROUP</B></td>";
|
||||
echo "<td><font size=1 color=white><B>EXTENSION</B></td>";
|
||||
echo "<td><font size=1 color=white><B>RANK </B></td>";
|
||||
echo "<td><font size=1 color=white><B>RESTRICT </B></td>";
|
||||
echo "<td><font size=1 color=white><B>COUNT </B></td>";
|
||||
echo "<td><font size=1 color=white><B>LAST CALL </B></td>";
|
||||
echo "<td><font size=1 color=white><B>LAST ID </B></td>";
|
||||
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
|
||||
|
||||
$o=0;
|
||||
while ($extensiongroups_to_print > $o)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=32111&extension_id=$row[0]\">$row[1]</a></td>";
|
||||
echo "<td><font size=1> $row[2]</td>";
|
||||
echo "<td><font size=1> $row[3]</td>";
|
||||
echo "<td><font size=1> $row[4]</td>";
|
||||
echo "<td><font size=1> $row[5]</td>";
|
||||
echo "<td><font size=1> $row[6]</td>";
|
||||
echo "<td><font size=1> $row[7]</td>";
|
||||
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=32111&extension_id=$row[0]\">MODIFY</a></td></tr>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
|
||||
|
||||
######################
|
||||
# ADD=100000 display all user groups
|
||||
######################
|
||||
|
||||
@@ -1111,6 +1111,10 @@ $SScallcard_enabled = $row[2];
|
||||
<a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Remote Agents </a>
|
||||
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add New Remote Agents </a>
|
||||
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Extension Groups </a>
|
||||
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Extension Group </a>
|
||||
</TD></TR>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user