update of translations of agent and admin interfaces

addition of Russian Agent translation

git-svn-id: svn://192.168.202.10@1081 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-03-23 15:23:20 +00:00
parent d06b492260
commit c1c7020752
123 changed files with 21026 additions and 9167 deletions
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel não é válido or queryCID $queryCID não é válido or filename: $filename não é válido, $ACTION comando não inserido\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel não é válido or exten $exten não é válido or filename: $filename não é válido, $ACTION comando não inserido\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_segundos > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanal $channel ist unzulässig or queryCID $queryCID ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht abgesetzt\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanal $channel ist unzulässig or exten $exten ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht abgesetzt\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_Sekunden > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Κανάλι $channel δεν ισχύει or exten $exten δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_δευτερόλεπτα > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel No es válido or queryCID $queryCID No es válido or filename: $filename No es válido, $ACTION comando no insertado\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel No es válido or exten $exten No es válido or filename: $filename No es válido, $ACTION comando no insertado\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_segundos > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel est invalide or queryCID $queryCID est invalide or filename: $filename est invalide, $ACTION commande non insérée\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canal $channel est invalide or exten $exten est invalide or filename: $filename est invalide, $ACTION commande non insérée\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_secondes > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canale $channel non e` valido or queryCID $queryCID non e` valido or filename: $filename non e` valido, $ACTION comando non inserito\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canale $channel non e` valido or exten $exten non e` valido or filename: $filename non e` valido, $ACTION comando non inserito\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_secondi > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanał $channel nie jest prawidłowy or queryCID $queryCID nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wstawiona\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanał $channel nie jest prawidłowy or exten $exten nie jest prawidłowy or filename: $filename nie jest prawidłowy, $ACTION komenda nie wstawiona\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_sekundy > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canaleta $channel é inválido or queryCID $queryCID é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Canaleta $channel é inválido or exten $exten é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_segundos > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+482
View File
@@ -0,0 +1,482 @@
<?
# active_list_refresh.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to serve updates of the live data to the display scripts
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $ADD - ('1','2','3','4','5')
# - $order - ('asc','desc')
# - $format - ('text','table','menu','selectlist','textarea')
# - $bgcolor - ('#123456','white','black','etc...')
# - $txtcolor - ('#654321','black','white','etc...')
# - $txtsize - ('1','2','3','etc...')
# - $selectsize - ('2','3','4','etc...')
# - $selectfontsize - ('8','10','12','etc...')
# - $selectedext - ('cc100')
# - $selectedtrunk - ('Zap/25-1')
# - $selectedlocal - ('SIP/cc100')
# - $textareaheight - ('8','10','12','etc...')
# - $textareawidth - ('8','10','12','etc...')
# - $field_name - ('extension','busyext','extension_xfer','etc...')
#
#
# changes
# 50323-1147 - First build of script
# 50401-1132 - small formatting changes
# 50502-1402 - added field_name as modifiable variable
# 50503-1213 - added session_name checking for extra security
# 50503-1311 - added conferences list
# 50610-1155 - Added NULL check on MySQL results to reduced errors
# 50711-1209 - removed HTTP authentication in favor of user/pass vars
# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1118 - Added variable filters to close security holes for login form
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];}
elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];}
if (isset($_GET["order"])) {$order=$_GET["order"];}
elseif (isset($_POST["order"])) {$order=$_POST["order"];}
if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];}
elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];}
if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];}
elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];}
if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];}
elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];}
if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];}
elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];}
if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];}
elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];}
if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];}
elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];}
if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];}
elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];}
if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];}
elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];}
if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];}
elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];}
if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];}
elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];}
if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];}
elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];}
### security strip all non-alphanumeric characters out of the variables ###
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
$ADD=ereg_replace("[^0-9]","",$ADD);
$order=ereg_replace("[^0-9a-zA-Z]","",$order);
$format=ereg_replace("[^0-9a-zA-Z]","",$format);
$bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor);
$txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor);
$txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize);
$selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize);
$selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize);
$selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext);
$selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk);
$selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal);
$textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight);
$textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth);
$field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name);
# default optional vars if not set
if (!isset($ADD)) {$ADD="1";}
if (!isset($order)) {$order='desc';}
if (!isset($format)) {$format="text";}
if (!isset($bgcolor)) {$bgcolor='white';}
if (!isset($txtcolor)) {$txtcolor='black';}
if (!isset($txtsize)) {$txtsize='2';}
if (!isset($selectsize)) {$selectsize='4';}
if (!isset($selectfontsize)) {$selectfontsize='10';}
if (!isset($textareaheight)) {$textareaheight='10';}
if (!isset($textareawidth)) {$textareawidth='20';}
$version = '0.0.8';
$build = '60619-1118';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='table')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build ADD: $ADD server_ip: $server_ip-->\n";
echo "<title>Показывать Списки: ";
if ($ADD==1) {echo "Активные расширения";}
if ($ADD==2) {echo "Занятые Расширения";}
if ($ADD==3) {echo "Внешние Линии";}
if ($ADD==4) {echo "Локальные Расширения";}
if ($ADD==5) {echo "Конференции";}
if ($ADD==99999) {echo "ПОМОЩЬ";}
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
######################
# ADD=1 display all live extensions on a server
######################
if ($ADD==1)
{
$pt='pt';
if (!$field_name) {$field_name = 'extension';}
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
if ($format=='selectlist')
{
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
}
if ($format=='textarea')
{
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
}
$stmt="SELECT extension,fullname FROM phones where server_ip = '$server_ip' order by extension $order";
if ($format=='table') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
$o=0;
while ($phones_to_print > $o) {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
echo "$row[0] - $row[1]";
echo "</TD></TR>\n";
}
if ( ($format=='text') or ($format=='textarea') )
{
echo "$row[0] - $row[1]\n";
}
if ( ($format=='menu') or ($format=='selectlist') )
{
echo "<OPTION ";
if ($row[0]=="$selectedext") {echo "SELECTED ";}
echo "VALUE=\"$row[0]\">";
echo "$row[0] - $row[1]";
echo "</OPTION>\n";
}
$o++;
}
if ($format=='table') {echo "</TABLE>\n";}
if ($format=='menu') {echo "</SELECT>\n";}
if ($format=='selectlist') {echo "</SELECT>\n";}
if ($format=='textarea') {echo "</TEXTAREA>\n";}
}
######################
# ADD=2 display all busy extensions on a server
######################
if ($ADD==2)
{
if (!$field_name) {$field_name = 'busyext';}
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
if ($format=='selectlist')
{
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
}
if ($format=='textarea')
{
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
}
$stmt="SELECT extension FROM live_channels where server_ip = '$server_ip' order by extension $order";
if ($format=='table') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
$o=0;
while ($busys_to_print > $o) {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
echo "$row[0]";
echo "</TD></TR>\n";
}
if ( ($format=='text') or ($format=='textarea') )
{
echo "$row[0]\n";
}
if ( ($format=='menu') or ($format=='selectlist') )
{
echo "<OPTION ";
if ($row[0]=="$selectedext") {echo "SELECTED ";}
echo "VALUE=\"$row[0]\">";
echo "$row[0]";
echo "</OPTION>\n";
}
$o++;
}
if ($format=='table') {echo "</TABLE>\n";}
if ($format=='menu') {echo "</SELECT>\n";}
if ($format=='selectlist') {echo "</SELECT>\n";}
if ($format=='textarea') {echo "</TEXTAREA>\n";}
}
######################
# ADD=3 display all busy outside lines(trunks) on a server
######################
if ($ADD==3)
{
if (!$field_name) {$field_name = 'trunk';}
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
if ($format=='selectlist')
{
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
}
if ($format=='textarea')
{
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
}
$stmt="SELECT channel, extension FROM live_channels where server_ip = '$server_ip' order by channel $order";
if ($format=='table') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
$o=0;
while ($busys_to_print > $o) {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
echo "$row[0] - $row[1]";
echo "</TD></TR>\n";
}
if ( ($format=='text') or ($format=='textarea') )
{
echo "$row[0] - $row[1]\n";
}
if ( ($format=='menu') or ($format=='selectlist') )
{
echo "<OPTION ";
if ($row[0]=="$selectedtrunk") {echo "SELECTED ";}
echo "VALUE=\"$row[0]\">";
echo "$row[0] - $row[1]";
echo "</OPTION>\n";
}
$o++;
}
if ($format=='table') {echo "</TABLE>\n";}
if ($format=='menu') {echo "</SELECT>\n";}
if ($format=='selectlist') {echo "</SELECT>\n";}
if ($format=='textarea') {echo "</TEXTAREA>\n";}
}
######################
# ADD=4 display all busy Local lines on a server
######################
if ($ADD==4)
{
if (!$field_name) {$field_name = 'local';}
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
if ($format=='selectlist')
{
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
}
if ($format=='textarea')
{
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
}
$stmt="SELECT channel, extension FROM live_sip_channels where server_ip = '$server_ip' order by channel $order";
if ($format=='table') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$busys_to_print = mysql_num_rows($rslt);}
$o=0;
while ($busys_to_print > $o) {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
echo "$row[0] - $row[1]";
echo "</TD></TR>\n";
}
if ( ($format=='text') or ($format=='textarea') )
{
echo "$row[0] - $row[1]\n";
}
if ( ($format=='menu') or ($format=='selectlist') )
{
echo "<OPTION ";
if ($row[0]=="$selectedlocal") {echo "SELECTED ";}
echo "VALUE=\"$row[0]\">";
echo "$row[0] - $row[1]";
echo "</OPTION>\n";
}
$o++;
}
if ($format=='table') {echo "</TABLE>\n";}
if ($format=='menu') {echo "</SELECT>\n";}
if ($format=='selectlist') {echo "</SELECT>\n";}
if ($format=='textarea') {echo "</TEXTAREA>\n";}
}
######################
# ADD=5 display all agc-usable conferences on a server
######################
if ($ADD==5)
{
$pt='pt';
if (!$field_name) {$field_name = 'conferences';}
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
if ($format=='selectlist')
{
echo "<SELECT SIZE=$selectsize name=\"$field_name\" STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">\n";
}
if ($format=='textarea')
{
echo "<TEXTAREA ROWS=$textareaheight COLS=$textareawidth NAME=extension WRAP=off STYLE=\"font-family : sans-serif; font-size : $selectfontsize$pt\">";
}
$stmt="SELECT conf_exten,extension FROM conferences where server_ip = '$server_ip' order by conf_exten $order";
if ($format=='table') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
$o=0;
while ($phones_to_print > $o) {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
echo "<TR><TD ALIGN=LEFT NOWRAP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=$txtcolor SIZE=$txtsize>";
echo "$row[0] - $row[1]";
echo "</TD></TR>\n";
}
if ( ($format=='text') or ($format=='textarea') )
{
echo "$row[0] - $row[1]\n";
}
if ( ($format=='menu') or ($format=='selectlist') )
{
echo "<OPTION ";
if ($row[0]=="$selectedext") {echo "SELECTED ";}
echo "VALUE=\"$row[0]\">";
echo "$row[0] - $row[1]";
echo "</OPTION>\n";
}
$o++;
}
if ($format=='table') {echo "</TABLE>\n";}
if ($format=='menu') {echo "</SELECT>\n";}
if ($format=='selectlist') {echo "</SELECT>\n";}
if ($format=='textarea') {echo "</TEXTAREA>\n";}
}
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
if ($format=='table') {echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";}
if ($format=='table') {echo "\n</body>\n</html>\n";}
exit;
?>
File diff suppressed because it is too large Load Diff
+196
View File
@@ -0,0 +1,196 @@
<?
# call_log_display.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send the inbound and outbound calls for a specific phone
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
# - $protocol - ('SIP','Zap','IAX2',...)
# - $in_limit - ('10','20','50','100',...)
# - $out_limit - ('10','20','50','100',...)
#
#
# changes
# 50406-1013 - First build of script
# 50407-1452 - Added definable limits
# 50503-1236 - added session_name checking for extra security
# 50610-1158 - Added NULL check on MySQL results to reduced errors
# 50711-1202 - removed HTTP authentication in favor of user/pass vars
# 60323-1550 - added option for showing different number dialed in log
# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1202 - Added variable filters to close security holes for login form
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
if (!isset($in_limit)) {$in_limit="100";}
if (!isset($out_limit)) {$out_limit="100";}
$number_dialed = 'number_dialed';
#$number_dialed = 'extension';
$version = '0.0.8';
$build = '60619-1202';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build EXTEN: $exten server_ip: $server_ip-->\n";
echo "<title>Показать Логи Вызовов";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{
$channel_live=0;
echo "Exten $exten это неправильно или протокол $protocol это неправильно\n";
exit;
}
else
{
##### print outbound calls from the call_log table
$stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$out_calls_count = mysql_num_rows($rslt);}
echo "$out_calls_count|";
$loop_count=0;
while ($out_calls_count>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
$call_time_M = ($row[3] / 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
$call_time_SEC = ($call_time_SEC * 60);
$call_time_SEC = round($call_time_SEC, 0);
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
$call_time_MS = "$call_time_M_int:$call_time_SEC";
if ($number_dialed == 'extension') {$row[2] = substr($row[2],-10);}
echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|";
}
echo "\n";
##### print inbound calls from the live_inbound_log table
$stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$in_calls_count = mysql_num_rows($rslt);}
echo "$in_calls_count|";
$loop_count=0;
while ($in_calls_count>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
$call_time_M = ($row[4] / 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
$call_time_SEC = ($call_time_SEC * 60);
$call_time_SEC = round($call_time_SEC, 0);
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
$call_time_MS = "$call_time_M_int:$call_time_SEC";
$callerIDnum = $row[3]; $callerIDname = $row[3];
$callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum);
$callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname);
echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|";
}
echo "\n";
}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
?>
+514
View File
@@ -0,0 +1,514 @@
<?
# conf_exten_check.php version 2.0.5
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $ACTION - ('refresh','register')
# - $client - ('agc','vdc')
# - $conf_exten - ('8600011',...)
# - $exten - ('123test',...)
# - $auto_dial_level - ('0','1','1.2',...)
# - $campagentstdisp - ('YES',...)
#
# changes
# 50509-1054 - First build of script
# 50511-1112 - Added ability to register a conference room
# 50610-1159 - Added NULL check on MySQL results to reduced errors
# 50706-1429 - script changed to not use HTTP login vars, user/pass instead
# 50706-1525 - Added date-time display for vicidial client display
# 50816-1500 - Added random update to vicidial_live_agents table for vdc users
# 51121-1353 - Altered echo statements for several small PHP speed optimizations
# 60410-1424 - Added ability to grab calls-being-placed and agent status
# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1201 - Added variable filters to close security holes for login form
# 61128-2255 - Added update for manual dial vicidial_live_agents
# 70319-1542 - Added agent disabled display function
# 71122-0205 - Added vicidial_live_agent status output
# 80424-0442 - Added non_latin lookup from system_settings
# 80519-1425 - Added calls-in-queue tally
# 80703-1106 - Added API functionality for Hangup and Dispo
# 81104-0229 - Added mysql error logging capability
# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries
# 90102-1402 - Added check for system and database time synchronization
# 90120-1720 - Added compatibility for API pause/resume and dial a number
# 90307-1855 - Added shift enforcement to send logout flag if outside of shift hours
#
$version = '2.0.5-18';
$build = '90307-1855';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=17;
$one_mysql_log=0;
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];}
elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];}
if (isset($_GET["client"])) {$client=$_GET["client"];}
elseif (isset($_POST["client"])) {$client=$_POST["client"];}
if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];}
elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];}
elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];}
if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];}
elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$i++;
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
}
# default optional vars if not set
if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($client)) {$client="agc";}
$Alogin='N';
$RingCalls='N';
$DiaLCalls='N';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$FILE_TIME = date("Ymd_His");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$random = (rand(1000000, 9999999) + 10000000);
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build MEETME: $conf_exten server_ip: $server_ip-->\n";
echo "<title>Conf Extension Check";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
if ($ACTION == 'refresh')
{
$MT[0]='';
$row=''; $rowx='';
$channel_live=1;
if (strlen($conf_exten)<1)
{
$channel_live=0;
echo "Conf Exten $conf_exten это неправильно\n";
exit;
}
else
{
if ($client == 'vdc')
{
$Acount=0;
$AexternalDEAD=0;
### see if the agent has a record in the vicidial_live_agents table
$stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$Acount=$row[0];
if ($Acount > 0)
{
$stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$Astatus=$row[0];
}
# ### find out if external table shows agent should be disabled
# $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';";
# if ($DB) {echo "|$stmt|\n";}
# $rslt=mysql_query($stmt, $link);
# $row=mysql_fetch_row($rslt);
# $AexternalDEAD=$row[0];
if ($auto_dial_level > 0)
{
### update the vicidial_live_agents every second with a new random number so it is shown to be alive
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);}
$retry_count=0;
while ( ($errno > 0) and ($retry_count < 5) )
{
$rslt=mysql_query($stmt, $link);
$one_mysql_log=1;
$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log);
$one_mysql_log=0;
$retry_count++;
}
if ($campagentstdisp == 'YES')
{
### grab the status of this agent to display
$stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$Alogin=$row[0];
$Acampaign=$row[1];
$AccampSQL=$row[2];
$AccampSQL = ereg_replace(' -','', $AccampSQL);
$AccampSQL = ereg_replace(' ',"','", $AccampSQL);
### grab the number of calls being placed from this server and campaign
$stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03007',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$RingCalls=$row[0];
if ($RingCalls > 0) {$RingCalls = "<font class=\"queue_text_red\">Звонки в очереди: $RingCalls</font>";}
else {$RingCalls = "<font class=\"queue_text\">Звонки в очереди: $RingCalls</font>";}
### grab the number of calls being placed from this server and campaign
$stmt="SELECT count(*) from vicidial_auto_calls where status NOT IN('XFER') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$DiaLCalls=$row[0];
}
else
{
$Alogin='N';
$RingCalls='N';
$DiaLCalls='N';
}
}
else
{
$Alogin='N';
$RingCalls='N';
$DiaLCalls='N';
### update the vicidial_live_agents every second with a new random number so it is shown to be alive
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);}
$retry_count=0;
while ( ($errno > 0) and ($retry_count < 5) )
{
$rslt=mysql_query($stmt, $link);
$one_mysql_log=1;
$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log);
$one_mysql_log=0;
$retry_count++;
}
}
### grab the API hangup and API dispo fields in vicidial_live_agents
$stmt="SELECT external_hangup,external_status,external_pause,external_dial from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$external_hangup = $row[0];
$external_status = $row[1];
$external_pause = $row[2];
$external_dial = $row[3];
if (strlen($external_status)<1) {$external_status = '::::::::::';}
$web_epoch = date("U");
$stmt="select UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater where server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03014',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$server_epoch = $row[0];
$db_epoch = $row[1];
$time_diff = ($server_epoch - $db_epoch);
$web_diff = ($db_epoch - $web_epoch);
##### grab the shift information the agent
$stmt="SELECT user_group,agent_shift_enforcement_override from vicidial_users where user='$user';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03015',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$VU_user_group = $row[0];
$VU_agent_shift_enforcement_override = $row[1];
### Gather timeclock and shift enforcement restriction settings
$stmt="SELECT shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$shift_enforcement = $row[0];
$LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]);
$LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL);
$LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR
$Ashift_logout=0;
if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|СТАРТ",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) )
{
$shift_ok=0;
if (strlen($LOGgroup_shiftsSQL) < 3)
{$Ashift_logout++;}
else
{
$HHMM = date("Hi");
$wday = date("w");
$stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'3017',$user,$server_ip,$session_name,$one_mysql_log);}
$shifts_to_print = mysql_num_rows($rslt);
$o=0;
while ( ($shifts_to_print > $o) and ($shift_ok < 1) )
{
$rowx=mysql_fetch_row($rslt);
$shift_id = $rowx[0];
$shift_start_time = $rowx[1];
$shift_length = $rowx[2];
$shift_weekdays = $rowx[3];
if (eregi("$wday",$shift_weekdays))
{
$HHshift_length = substr($shift_length,0,2);
$MMshift_length = substr($shift_length,3,2);
$HHshift_start_time = substr($shift_start_time,0,2);
$MMshift_start_time = substr($shift_start_time,2,2);
$HHshift_end_time = ($HHshift_length + $HHshift_start_time);
$MMshift_end_time = ($MMshift_length + $MMshift_start_time);
if ($MMshift_end_time > 59)
{
$MMshift_end_time = ($MMshift_end_time - 60);
$HHshift_end_time++;
}
if ($HHshift_end_time > 23)
{$HHshift_end_time = ($HHshift_end_time - 24);}
$HHshift_end_time = sprintf("%02s", $HHshift_end_time);
$MMshift_end_time = sprintf("%02s", $MMshift_end_time);
$shift_end_time = "$HHshift_end_time$MMshift_end_time";
if (
( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or
( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or
( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) )
)
{$shift_ok++;}
}
$o++;
}
if ($shift_ok < 1)
{$Ashift_logout++;}
}
}
if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) )
{$Alogin='TIME_SYNC';}
if ($Acount < 1)
{$Alogin='DEAD_VLA';}
if ($AexternalDEAD > 0)
{$Alogin='DEAD_EXTERNAL';}
if ($Ashift_logout > 0)
{$Alogin='SHIFT_ВЫХОД';}
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Статус: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . "|\n";
}
$total_conf=0;
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);}
if ($rslt) {$sip_list = mysql_num_rows($rslt);}
# echo "$sip_list|";
$loop_count=0;
while ($sip_list>$loop_count)
{
$loop_count++; $total_conf++;
$row=mysql_fetch_row($rslt);
$КаналA[$total_conf] = "$row[0]";
if ($format=='debug') {echo "\n<!-- $row[0] -->";}
}
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);}
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
# echo "$channels_list|";
$loop_count=0;
while ($channels_list>$loop_count)
{
$loop_count++; $total_conf++;
$row=mysql_fetch_row($rslt);
$КаналA[$total_conf] = "$row[0]";
if ($format=='debug') {echo "\n<!-- $row[0] -->";}
}
}
$channels_list = ($channels_list + $sip_list);
echo "$channels_list|";
$counter=0;
$countecho='';
while($total_conf > $counter)
{
$counter++;
$countecho = "$countecho$КаналA[$counter] ~";
# echo "$КаналA[$counter] ~";
}
echo "$countecho\n";
}
if ($ACTION == 'register')
{
$MT[0]='';
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($conf_exten)<1) || (strlen($exten)<1) )
{
$channel_live=0;
echo "Conf Exten $conf_exten это неправильно or Exten $exten это неправильно\n";
exit;
}
else
{
$stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03013',$user,$server_ip,$session_name,$one_mysql_log);}
}
echo "Конференция $conf_exten был зарегистрирован на $exten\n";
}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?>
+58
View File
@@ -0,0 +1,58 @@
<?
#
# dbconnect.php version 2.0.5
#
# database connection settings and some global web settings
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
foreach ($DBCagc as $DBCline)
{
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
if (ereg("^PATHlogs", $DBCline))
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
if (ereg("^PATHweb", $DBCline))
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);}
if (ereg("^VARDB_server", $DBCline))
{$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);}
if (ereg("^VARDB_database", $DBCline))
{$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);}
if (ereg("^VARDB_user", $DBCline))
{$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);}
if (ereg("^VARDB_pass", $DBCline))
{$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
if (ereg("^VARDB_port", $DBCline))
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
}
}
else
{
#defaults for DB connection
$VARDB_server = 'localhost';
$VARDB_user = 'cron';
$VARDB_pass = '1234';
$VARDB_database = '1234';
$WeBServeRRooT = '/usr/local/apache2/htdocs';
}
$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass");
if (!$link) {
die('MySQL connect ERROR: ' . mysql_error());
}
mysql_select_db("$VARDB_database",$link);
$local_DEF = 'Local/';
$conf_silent_prefix = '7';
$local_AMP = '@';
$ext_context = 'demo';
$recording_exten = '8309';
$WeBRooTWritablE = '1';
$non_latin = '0'; # set to 1 for UTF rules, overridden by system_settings
$flag_channels=0;
$flag_string = 'VICIast20';
?>
+351
View File
@@ -0,0 +1,351 @@
<?
# inbound_popup.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed to open up when a live_inbound call comes in giving the user
# options of what to do with the call or options to lookup the callerID on various web sites
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $uniqueid - ('1234567890.123456',...)
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $vmail_box - ('101','1234',...)
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
# - $ext_context - ('default','demo',...)
# - $ext_priority - ('1','2',...)
# - $voicemail_dump_exten - ('85026666666666')
# - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL)
#
#
# changes
# 50428-1500 - First build of script display only
# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links
# 50503-1244 - added session_name checking for extra security
# 50711-1203 - removed HTTP authentication in favor of user/pass vars
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1205 - Added variable filters to close security holes for login form
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];}
elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];}
if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];}
elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];}
if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];}
elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];}
if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];}
elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];}
if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);}
else {$local_web_callerID_URL = '';}
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
$version = '0.0.6';
$build = '60619-1205';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$DO = '-1';
if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
$forever_stop=0;
$user_abb = "$user$user$user$user";
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
{$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build UNIQUEID: $uniqueid server_ip: $server_ip-->\n";
?>
<script language="Javascript">
var server_ip = '<? echo $server_ip ?>';
var epoch_sec = '<? echo $StarTtime ?>';
var user_abb = '<? echo $user_abb ?>';
var vmail_box = '<? echo $vmail_box ?>';
var ext_context = '<? echo $ext_context ?>';
var ext_priority = '<? echo $ext_priority ?>';
var voicemail_dump_exten = '<? echo $voicemail_dump_exten ?>';
var session_name = '<? echo $session_name ?>';
var user = '<? echo $user ?>';
var pass = '<? echo $pass ?>';
// ################################################################################
// Send Hangup command for Live call connected to phone now to Manager
function livehangup_send_hangup(taskvar)
{
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
var queryCID = "HLagcP" + epoch_sec + user_abb;
var hangupvalue = taskvar;
livehangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Hangup&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID;
xmlhttp.open('POST', 'manager_send.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(livehangup_query);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
Nactiveext = null;
Nactiveext = xmlhttp.responseText;
alert(xmlhttp.responseText);
}
}
delete xmlhttp;
}
call_action_link_clear();
}
// ################################################################################
// Send Redirect command for ringing call to go directly to your voicemail
function liveredirect_send_vmail(taskvar,taskbox)
{
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
var queryCID = "RVagcP" + epoch_sec + user_abb;
var hangupvalue = taskvar;
var mailboxvalue = taskbox;
liveredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "" + mailboxvalue + "&ext_context=" + ext_context + "&ext_priority=" + ext_priority;
xmlhttp.open('POST', 'manager_send.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(liveredirect_query);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
Nactiveext = null;
Nactiveext = xmlhttp.responseText;
alert(xmlhttp.responseText);
}
}
delete xmlhttp;
}
call_action_link_clear();
}
// ################################################################################
// timeout to deactivate the call action links after 30 секунды
function link_timeout()
{
window.focus();
setTimeout("call_action_link_clear()", 30000);
}
// ################################################################################
// deactivates the call action links
function call_action_link_clear()
{
document.getElementById("callactions").innerHTML = "";
}
</script>
<?
echo "<title>ЖИВОЙ ВХОДЯЩИЙ ВЫЗОВ";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=\"#CCC2E0\" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onload=\"link_timeout();\">\n";
echo "<CENTER><H2>ЖИВОЙ ВХОДЯЩИЙ ВЫЗОВ</H2>\n";
echo "<B>$NOW_TIME</B><BR><BR>\n";
}
$MT[0]='';
$row=''; $rowx='';
$channel_live=1;
if (strlen($uniqueid)<9)
{
$channel_live=0;
echo "Uniqueid $uniqueid это неправильно\n";
exit;
}
else
{
$stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$channels_list = mysql_num_rows($rslt);
if ($channels_list>0)
{
$row=mysql_fetch_row($rslt);
# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|";
# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt|||||
if ($format=='debug') {echo "\n<!-- $row[0]|$row[1]|$row[2]|$row[3]|$row[4]|$row[5]|$row[6]|$row[7]|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]| -->";}
echo "<table width=95% cellpadding=1 cellspacing=3>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td>Канал: </td><td align=left>$row[1]</td></tr>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td>ВызывающийID: </td><td align=left>$row[3]</td></tr>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td colspan=2 align=center>\n";
$phone = eregi_replace(".*\<","",$row[3]);
$phone = eregi_replace("\>.*","",$phone);
$NPA = substr($phone, 0, 3);
$NXX = substr($phone, 3, 3);
$XXXX = substr($phone, 6, 4);
$D='-';
echo "<a href=\"http://www.google.com/search?hl=en&lr=&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&q=$NPA+$NXX+$XXXX&btnG=Search\" target=\"_blank\">GOOGLE</a> - \n";
echo "<a href=\"http://www.anywho.com/qry/wp_rl?npa=$NPA&telephone=$NXX$XXXX\" target=\"_blank\">ANYWHO</a> - \n";
echo "<a href=\"http://www.switchboard.com/bin/cgirlookup.dll?SR=&MEM=1&LNK=32%3A36&type=BOTH&at=$NPA&e=$NXX&n=$XXXX&search.x=55&search.y=20\" target=\"_blank\">SWITCHBOARD</a> - \n";
echo "<a href=\"http://yellowpages.superpages.com/listings.jsp?SRC=&STYPE=&PG=L&CB=&C=&N=&E=&T=&S=&Z=&A=727&X=533&P=8730&AXP=$NPA$NXX$XXXX&R=N&PS=15&search=Find+It\" target=\"_blank\">VERIZON</a> - \n";
echo "<a href=\"http://www.whitepages.com/1014/log_click/search/Reverse_Телефон?npa=$NPA&phone=$NXX$XXXX\" target=\"_blank\">WHITEPAGES</a> - \n";
echo "<a href=\"http://www.411.com/10742/search/Reverse_Телефон?phone=%28$NPA%29+$NXX$D$XXXX\" target=\"_blank\">411.COM</a> - \n";
echo "<a href=\"http://www.phonenumber.com/10006/search/Reverse_Телефон?npa=$NPA&phone=$NXX$XXXX\" target=\"_blank\">411.COM</a> - \n";
$local_web_callerID_QUERY_STRING ='';
$local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA";
$local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX";
$local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX";
$local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]";
$local_web_callerID_QUERY_STRING.="&callerID_Канал=$row[1]";
$local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]";
$local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]";
$local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]";
$local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]";
$local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]";
$local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]";
$local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]";
$local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]";
$local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]";
$local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]";
echo "<a href=\"$local_web_callerID_URL$local_web_callerID_QUERY_STRING\" target=\"_blank\">ПОЛЬЗОВАТЕЛЬСКИЙ</a> - \n";
echo "</td></tr>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td>Набранный Номер: </td><td align=left>$row[8]</td></tr>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td>Примечания:</td><td align=left>$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|</td></tr>\n";
echo "<tr bgcolor=\"#DDDDFF\"><td colspan=2 align=center>\n<span id=\"callactions\">";
echo "<a href=\"#\" onclick=\"livehangup_send_hangup('$row[1]');return false;\">РАЗЪЕДИНЕНИЕ</a> - \n";
echo "<a href=\"#\" onclick=\"liveredirect_send_vmail('$row[1]','$vmail_box');return false;\">ПОСЛАТЬ В МОЙ VOICEMAIL</a>\n";
echo "</span></td></tr>\n";
echo "</table>\n";
$stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
}
}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
?>
+278
View File
@@ -0,0 +1,278 @@
<?
# live_exten_check.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send whether the client channel is live and to what channel it is connected
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
# - $protocol - ('SIP','Zap','IAX2',...)
#
#
# changes
# 50404-1249 - First build of script
# 50406-1402 - added connected trunk lookup
# 50428-1452 - added live_inbound check for exten on 2nd line of output
# 50503-1233 - added session_name checking for extra security
# 50524-1429 - added parked calls count
# 50610-1204 - Added NULL check on MySQL results to reduced errors
# 50711-1204 - removed HTTP authentication in favor of user/pass vars
# 60103-1541 - added favorite extens status display
# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1203 - Added variable filters to close security holes for login form
# 60825-1029 - Fixed translation variable issue ChannelA
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];}
elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];}
if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];}
elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];}
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
$version = '2.0.1';
$build = '60825-1029';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build EXTEN: $exten server_ip: $server_ip-->\n";
echo "<title>Live Extension Check";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
echo "DateTime: $NOW_TIME|";
echo "UnixTime: $StarTtime|";
$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "$row[0]|";
$MT[0]='';
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{
$channel_live=0;
echo "Exten $exten это неправильно или протокол $protocol это неправильно\n";
exit;
}
else
{
$stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
echo "$channels_list|";
$loop_count=0;
while ($channels_list>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
$ChanneLA[$loop_count] = "$row[0]";
$ChanneLB[$loop_count] = "$row[1]";
if ($format=='debug') {echo "\n<!-- $row[0] $row[1] -->";}
}
}
$counter=0;
while($loop_count > $counter)
{
$counter++;
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
echo "КаналA: $ChanneLA[$counter] ~";
echo "КаналB: $ChanneLB[$counter] ~";
echo "КаналBtrunk: $row[0]|";
}
else
{
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
echo "КаналA: $ChanneLA[$counter] ~";
echo "КаналB: $ChanneLB[$counter] ~";
echo "КаналBtrunk: $row[0]|";
}
else
{
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
echo "КаналA: $ChanneLA[$counter] ~";
echo "КаналB: $ChanneLB[$counter] ~";
echo "КаналBtrunk: $row[0]|";
}
else
{
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
echo "КаналA: $ChanneLA[$counter] ~";
echo "КаналB: $ChanneLB[$counter] ~";
echo "КаналBtrunk: $row[0]|";
}
else
{
echo "Conversation: $counter ~";
echo "КаналA: $ChanneLA[$counter] ~";
echo "КаналB: $ChanneLB[$counter] ~";
echo "КаналBtrunk: $ChanneLA[$counter]|";
}
}
}
}
}
echo "\n";
### check for live_inbound entry
$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
if ($channels_list>0)
{
$row=mysql_fetch_row($rslt);
$LIuniqueid = "$row[0]";
$LIchannel = "$row[1]";
$LIcallerid = "$row[3]";
$LIdatetime = "$row[6]";
echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|";
if ($format=='debug') {echo "\n<!-- $row[0]|$row[1]|$row[2]|$row[3]|$row[4]|$row[5]|$row[6]|$row[7]|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]| -->";}
}
echo "\n";
### if favorites are present do a lookup to see if any are active
if ($favorites_count > 0)
{
$favorites = explode(',',$favorites_list);
$h=0;
$favs_print='';
while ($favorites_count > $h)
{
$fav_extension = explode('/',$favorites[$h]);
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$favs_print .= "$fav_extension[1]: $row[0] ~";
$h++;
}
echo "$favs_print\n";
}
if ($format=='debug') {echo "\n<!-- |$favorites_count|$favorites_list| -->";}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
?>
File diff suppressed because it is too large Load Diff
+146
View File
@@ -0,0 +1,146 @@
<?
# park_calls_display.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to send the details on the parked calls on the server
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $exten - ('cc101','testphone','49-1','1234','913125551212',...)
# - $protocol - ('SIP','Zap','IAX2',...)
#
#
# changes
# 50524-1515 - First build of script
# 50711-1208 - removed HTTP authentication in favor of user/pass vars
# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1205 - Added variable filters to close security holes for login form
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
if (!isset($park_limit)) {$park_limit="1000";}
$version = '0.0.4';
$build = '60619-1205';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) )
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) {
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build EXTEN: $exten server_ip: $server_ip-->\n";
echo "<title>Показать Паркованные Вызовы";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{
$channel_live=0;
echo "Exten $exten это неправильно или протокол $protocol это неправильно\n";
exit;
}
else
{
##### print parked calls from the parked_channels table
$stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$park_calls_count = mysql_num_rows($rslt);
echo "$park_calls_count\n";
$loop_count=0;
while ($park_calls_count>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|";
}
echo "\n";
}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
?>
+455
View File
@@ -0,0 +1,455 @@
<?
# timeclock.php - VICIDIAL system user timeclock
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGELOG
# 80523-0134 - First Build
# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field
# 80525-2351 - Added an audit log that is not to be editable
# 80602-0641 - Fixed status update bug
#
$version = '2.0.5-4';
$build = '80602-0641';
$StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s");
$last_action_date = $NOW_TIME;
$US='_';
$CL=':';
$AT='@';
$DS='-';
$date = date("r");
$ip = getenv("REMOTE_ADDR");
$browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
$agcDIR = eregi_replace('timeclock.php','',$agcPAGE);
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];}
elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];}
if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];}
elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];}
if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];}
elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["commit"])) {$commit=$_GET["commit"];}
elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];}
if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];}
elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (!isset($phone_login))
{
if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];}
elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];}
}
if (!isset($phone_pass))
{
if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];}
elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];}
}
### security strip all non-alphanumeric characters out of the variables ###
$DB=ereg_replace("[^0-9a-z]","",$DB);
$phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login);
$phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
$VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login);
$VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass);
$VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign);
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
$stage=ereg_replace("[^0-9a-zA-Z]","",$stage);
$commit=ereg_replace("[^0-9a-zA-Z]","",$commit);
$referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer);
require("dbconnect.php");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,admin_home_url FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$welcomeURL = $row[1];
$i++;
}
##### END SETTINGS LOOKUP #####
###########################################
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
if ( ($stage == 'login') or ($stage == 'logout') )
{
### see if user/pass exist for this user in vicidial_users table
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$valid_user=$row[0];
print "<!-- vicidial_users active count for $user: |$valid_user| -->\n";
if ($valid_user < 1)
{
### NOT A VALID USER/PASS
$VDdisplayMESSAGE = "Пользователя и пароль, которые вы вступили, не действующих в системе<BR>Пожалуйста, повторите попытку:";
echo"<HTML><HEAD>\n";
echo"<TITLE>VICIНАБОР НОМЕРА:Timeclock</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"</HEAD>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
echo "<INPUT TYPE=HIDDEN NAME=referrer VALUE=\"$referrer\">\n";
echo "<INPUT TYPE=HIDDEN NAME=stage VALUE=\"login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCFFCC\"><TR BGCOLOR=WHITE>";
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vtc_tab_vicidial.gif\" Border=0></TD>";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE><B>Timeclock </B></TD>";
echo "</TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Логин Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=user SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Пароль Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=pass SIZE=10 maxlength=20 VALUE=''></TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>ВЕРСИЯ: $version &nbsp; &nbsp; &nbsp; СБОРКА: $build</TD></TR>\n";
echo "</TABLE>\n";
echo "</FORM>\n\n";
echo "</body>\n\n";
echo "</html>\n\n";
exit;
}
else
{
### VALID USER/PASS, CONTINUE
### get name and group for this user
$stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$full_name = $row[0];
$user_group = $row[1];
print "<!-- vicidial_users name and group for $user: |$full_name|$user_group| -->\n";
### get vicidial_timeclock_status record count for this user
$stmt="SELECT count(*) from vicidial_timeclock_status where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$vts_count = $row[0];
$last_action_sec=99;
if ($vts_count > 0)
{
### vicidial_timeclock_status record found, grab status and date of last activity
$stmt="SELECT status,event_epoch from vicidial_timeclock_status where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$status = $row[0];
$event_epoch = $row[1];
$last_action_date = date("Y-m-d H:i:s", $event_epoch);
$last_action_sec = ($StarTtimE - $event_epoch);
if ($last_action_sec > 0)
{
$totTIME_H = ($last_action_sec / 3600);
$totTIME_H_int = round($totTIME_H, 2);
$totTIME_H_int = intval("$totTIME_H");
$totTIME_M = ($totTIME_H - $totTIME_H_int);
$totTIME_M = ($totTIME_M * 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if (strlen($totTIME_H_int) < 1) {$totTIME_H_int = "0";}
if ($totTIME_M_int < 10) {$totTIME_M_int = "0$totTIME_M_int";}
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_HMS = "$totTIME_H_int:$totTIME_M_int:$totTIME_S";
}
else
{
$totTIME_HMS='0:00:00';
}
print "<!-- vicidial_timeclock_status previous status for $user: |$status|$event_epoch|$last_action_sec| -->\n";
}
else
{
### No vicidial_timeclock_status record found, insert one
$stmt="INSERT INTO vicidial_timeclock_status set status='СТАРТ', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$status='СТАРТ';
$totTIME_HMS='0:00:00';
$affected_rows = mysql_affected_rows($link);
print "<!-- НОВЫЙ vicidial_timeclock_status record inserted for $user: |$affected_rows| -->\n";
}
if ( ($last_action_sec < 30) and ($status != 'СТАРТ') )
{
### You cannot log in or out within 30 секунды of your last login/logout
$VDdisplayMESSAGE = "Вы не можете войти или в течение 30 секунд после вашего последнего входа в систему или Logout";
echo"<HTML><HEAD>\n";
echo"<TITLE>VICIНАБОР НОМЕРА:Timeclock</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"</HEAD>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
echo "<INPUT TYPE=HIDDEN NAME=stage VALUE=\"login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=referrer VALUE=\"$referrer\">\n";
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCFFCC\"><TR BGCOLOR=WHITE>";
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vtc_tab_vicidial.gif\" Border=0></TD>";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE><B>Timeclock </B></TD>";
echo "</TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Логин Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=user SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Пароль Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=pass SIZE=10 maxlength=20 VALUE=''></TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>ВЕРСИЯ: $version &nbsp; &nbsp; &nbsp; СБОРКА: $build</TD></TR>\n";
echo "</TABLE>\n";
echo "</FORM>\n\n";
echo "</body>\n\n";
echo "</html>\n\n";
exit;
}
if ($commit == 'YES')
{
if ( ( ($status=='AUTOВЫХОД') or ($status=='СТАРТ') or ($status=='ВЫХОД') ) and ($stage=='login') )
{
$VDdisplayMESSAGE = "You have now logged-in";
$LOGtimeMESSAGE = "You logged in at $NOW_TIME";
### Add a record to the timeclock log
$stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$timeclock_id = mysql_insert_id($link);
print "<!-- НОВЫЙ vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
### Update the user's timeclock status record
$stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
### Add a record to the timeclock audit log
$stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- НОВЫЙ vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
}
if ( ($status=='LOGIN') and ($stage=='logout') )
{
$VDdisplayMESSAGE = "Вы уже зарегистрированы отказа";
$LOGtimeMESSAGE = "Вы вошли на$NOW_TIME<BR>Количество раз, когда вы были зарегистрированы в:$totTIME_HMS";
### Add a record to the timeclock log
$stmt="INSERT INTO vicidial_timeclock_log set event='ВЫХОД', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
$timeclock_id = mysql_insert_id($link);
print "<!-- НОВЫЙ vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
### Update last login record in the timeclock log
$stmt="UPDATE vicidial_timeclock_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- vicidial_timeclock_log record updated for $user: |$affected_rows| -->\n";
### Update the user's timeclock status record
$stmt="UPDATE vicidial_timeclock_status set status='ВЫХОД', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip' where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
### Add a record to the timeclock audit log
$stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='ВЫХОД', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- НОВЫЙ vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
### Update last login record in the timeclock audit log
$stmt="UPDATE vicidial_timeclock_audit_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n";
}
if ( ( ( ($status=='AUTOВЫХОД') or ($status=='СТАРТ') or ($status=='ВЫХОД') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) )
{echo "ОШИБКА: timeclock вход вход уже сделал:$status|$stage"; exit;}
if ($referrer=='agent')
{$BACKlink = "<A HREF=\"./vicidial.php?pl=$phone_login&pp=$phone_pass&VD_login=$user\"><font color=\"#003333\">BACK TO Агент Логин экрана</font></A>";}
if ($referrer=='admin')
{$BACKlink = "<A HREF=\"../vicidial/admin.php\"><font color=\"#003333\">BACK TO администрации</font></A>";}
if ($referrer=='welcome')
{$BACKlink = "<A HREF=\"$welcomeURL\"><font color=\"#003333\">BACK приветствовать экрана</font></A>";}
echo"<HTML><HEAD>\n";
echo"<TITLE>VICIНАБОР НОМЕРА:Timeclock</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"</HEAD>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCFFCC\"><TR BGCOLOR=WHITE>";
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vtc_tab_vicidial.gif\" Border=0></TD>";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE><B>Timeclock </B></TD>";
echo "</TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><B> $LOGtimeMESSAGE<BR>&nbsp; </B></TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><B> $BACKlink <BR>&nbsp; </B></TD></TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>ВЕРСИЯ: $version &nbsp; &nbsp; &nbsp; СБОРКА: $build</TD></TR>\n";
echo "</TABLE>\n";
echo "</body>\n\n";
echo "</html>\n\n";
exit;
}
if ( ($status=='AUTOВЫХОД') or ($status=='СТАРТ') or ($status=='ВЫХОД') )
{
$VDdisplayMESSAGE = "Время с момента вашего последнего входа в:$totTIME_HMS";
$log_action = 'login';
$button_name = 'LOGIN';
$LOGtimeMESSAGE = "Вы последнего зарегистрированного по адресу:$last_action_date<BR><BR>Нажмите кнопку Вход для входа в";
}
if ($status=='LOGIN')
{
$VDdisplayMESSAGE = "Количество раз, когда вы вышли в:$totTIME_HMS";
$log_action = 'logout';
$button_name = 'ВЫХОД';
$LOGtimeMESSAGE = "Вы вошли в по адресу: $last_action_date<BR>Количество раз, когда вы вышли в:$totTIME_HMS<BR><BR>Нажмите ВЫХОД для входа из";
}
echo"<HTML><HEAD>\n";
echo"<TITLE>VICIНАБОР НОМЕРА:Timeclock</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"</HEAD>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
echo "<INPUT TYPE=HIDDEN NAME=stage VALUE=\"$log_action\">\n";
echo "<INPUT TYPE=HIDDEN NAME=commit VALUE=\"YES\">\n";
echo "<INPUT TYPE=HIDDEN NAME=referrer VALUE=\"$referrer\">\n";
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n";
echo "<INPUT TYPE=HIDDEN NAME=pass VALUE=\"$pass\">\n";
echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCFFCC\"><TR BGCOLOR=WHITE>";
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vtc_tab_vicidial.gif\" Border=0></TD>";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE><B>Timeclock </B></TD>";
echo "</TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><B> $LOGtimeMESSAGE<BR>&nbsp; </B></TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=$button_name VALUE=$button_name> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>ВЕРСИЯ: $version &nbsp; &nbsp; &nbsp; СБОРКА: $build</TD></TR>\n";
echo "</TABLE>\n";
echo "</FORM>\n\n";
echo "</body>\n\n";
echo "</html>\n\n";
exit;
}
}
else
{
echo"<HTML><HEAD>\n";
echo"<TITLE>VICIНАБОР НОМЕРА:Timeclock</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"</HEAD>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
echo "<INPUT TYPE=HIDDEN NAME=stage VALUE=\"login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=referrer VALUE=\"$referrer\">\n";
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCFFCC\"><TR BGCOLOR=WHITE>";
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vtc_tab_vicidial.gif\" Border=0></TD>";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE><B>Timeclock </B></TD>";
echo "</TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Логин Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=user SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
echo "<TR><TD ALIGN=RIGHT>Пароль Пользователя: </TD>";
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=pass SIZE=10 maxlength=20 VALUE=''></TD></TR>\n";
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT> &nbsp; </TD></TR>\n";
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>ВЕРСИЯ: $version &nbsp; &nbsp; &nbsp; СБОРКА: $build</TD></TR>\n";
echo "</TABLE>\n";
echo "</FORM>\n\n";
echo "</body>\n\n";
echo "</html>\n\n";
}
exit;
?>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+140
View File
@@ -0,0 +1,140 @@
<?
# voicemail_check.php version 2.0.5
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed purely to check whether the voicemail box on the server defined has new and old messages
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
#
# required variables:
# - $server_ip
# - $session_name
# - $user
# - $pass
# optional variables:
# - $format - ('text','debug')
# - $vmail_box - ('101','1234',...)
#
#
# changes
# 50422-1147 - First build of script
# 50503-1241 - added session_name checking for extra security
# 50711-1201 - removed HTTP authentication in favor of user/pass vars
# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1204 - Added variable filters to close security holes for login form
#
require("dbconnect.php");
### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["format"])) {$format=$_GET["format"];}
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
$version = '0.0.5';
$build = '60619-1204';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Недопустимо Пользовательname/Пароль: |$user|$pass|\n";
exit;
}
else
{
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Недопустимо server_ip: |$server_ip| or Недопустимо session_name: |$session_name|\n";
exit;
}
else
{
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
if($SNauth==0)
{
echo "Недопустимо session_name: |$session_name|$server_ip|\n";
exit;
}
else
{
# do nothing for now
}
}
}
if ($format=='debug')
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- ВЕРСИЯ: $version СБОРКА: $build VMBOX: $vmail_box server_ip: $server_ip-->\n";
echo "<title>Проверка Voicemail";
echo "</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
}
$MT[0]='';
$row=''; $rowx='';
if (strlen($vmail_box)<1)
{
$channel_live=0;
echo "voicemail box $vmail_box это неправильно\n";
exit;
}
else
{
$stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$vmails_list = mysql_num_rows($rslt);
$loop_count=0;
while ($vmails_list>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
echo "$row[0]|$row[1]";
if ($format=='debug') {echo "\n<!-- $row[0] $row[1] -->";}
}
}
if ($format=='debug')
{
$ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime);
echo "\n<!-- время выполнения скрипта: $RUNtime секунды -->";
echo "\n</body>\n</html>\n";
}
exit;
?>
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanál $channel Nie je správny or queryCID $queryCID Nie je správny or filename: $filename Nie je správny, $ACTION príkaz nebol vložený\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Kanál $channel Nie je správny or exten $exten Nie je správny or filename: $filename Nie je správny, $ACTION príkaz nebol vložený\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -222,10 +222,11 @@
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-201';
$build = '90307-1736';
$version = '2.0.5-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2240,7 +2241,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4791,7 +4791,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4859,7 +4859,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7497,10 +7497,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_sekúnd > 0)
{
@@ -7515,6 +7511,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7530,7 +7527,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
@@ -959,6 +959,7 @@ if ($campaign_allow_inbound > 0)
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
+19 -7
View File
@@ -1644,11 +1644,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.0.5-172';
$build = '90310-2203';
$admin_version = '2.0.5-173';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2850,7 +2851,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Exportieren von Berichten -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager für den Zugriff auf die Ausfuhr rufen Berichte über die Berichte Bildschirm. Der Standardwert ist 0. Für die Export-Bericht fordert, um das folgende Feld wird für die Ausfuhr: <BR>call_date,phone_number,status,user,full_name,campaign_id/in-group,vendor_lead_code,source_id,list_id,gmt_offset_now,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,length_in_sec,user_group,alt_dial/queue_seconds
<B>Exportieren von Berichten -</B> Diese Einstellung, wenn auf 1 gesetzt wird ein Manager für den Zugriff auf die Ausfuhr rufen Berichte über die Berichte Bildschirm. Der Standardwert ist 0. Für die Export-Bericht fordert, um das folgende Feld wird für die Ausfuhr: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds
@@ -7891,6 +7892,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8014,6 +8018,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8144,6 +8151,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12410,6 +12420,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -14842,6 +14855,7 @@ if ( ($ADD==34) or ($ADD==31) )
}
}
echo "</TD></TR></TABLE></center>\n";
}
@@ -18771,7 +18785,7 @@ if ($ADD==1300)
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>INBOUND GRUPPE AUFLISTUNGEN:\n";
echo "<br>INBOUND DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -19864,9 +19878,6 @@ if ($ADD==999999)
}
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
@@ -20208,6 +20219,7 @@ if (isset($camp_lists))
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1;
-7
View File
@@ -911,13 +911,6 @@ if (strlen($reports_hh) > 1) {
<?}
### Do nothing if admin has no permissions
if($LOGast_admin_access < 1)
{
$ADD='99999999999999999999';
echo "</TABLE></center>\n";
echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen.\n";
}
if (strlen($reports_hh) > 1) {
?>
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php?relogin=YES&VD_lo
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php\"><IMG SRC=\"../a
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
@@ -959,6 +959,7 @@ if ($campaign_allow_inbound > 0)
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
+19 -7
View File
@@ -1644,11 +1644,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.0.5-172';
$build = '90310-2203';
$admin_version = '2.0.5-173';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2850,7 +2851,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Εξαγωγή Εκθέσεις -</B> Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει την πρόσβαση του διευθυντή της εξαγωγής κλήση εκθέσεις σχετικά με τις εκθέσεις της οθόνης. Η προεπιλογή είναι 0. Για την εξαγωγή ζητεί έκθεση, ώστε τα ακόλουθα τομέα χρησιμοποιείται για τις εξαγωγές: <BR>call_date,phone_number,status,user,full_name,campaign_id/in-group,vendor_lead_code,source_id,list_id,gmt_offset_now,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,length_in_sec,user_group,alt_dial/queue_seconds
<B>Εξαγωγή Εκθέσεις -</B> Αυτή η ρύθμιση, εάν ρυθμιστεί σε 1 θα επιτρέψει την πρόσβαση του διευθυντή της εξαγωγής κλήση εκθέσεις σχετικά με τις εκθέσεις της οθόνης. Η προεπιλογή είναι 0. Για την εξαγωγή ζητεί έκθεση, ώστε τα ακόλουθα τομέα χρησιμοποιείται για τις εξαγωγές: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds
@@ -7895,6 +7896,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8018,6 +8022,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8148,6 +8155,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12414,6 +12424,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -14857,6 +14870,7 @@ if ( ($ADD==34) or ($ADD==31) )
}
}
echo "</TD></TR></TABLE></center>\n";
}
@@ -18789,7 +18803,7 @@ if ($ADD==1300)
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>ΕΝΤΑΓΜΕΝΕΣ ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ:\n";
echo "<br>Εισερχόμενα DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -19882,9 +19896,6 @@ if ($ADD==999999)
}
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
@@ -20226,6 +20237,7 @@ if (isset($camp_lists))
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1;
-7
View File
@@ -911,13 +911,6 @@ if (strlen($reports_hh) > 1) {
<?}
### Do nothing if admin has no permissions
if($LOGast_admin_access < 1)
{
$ADD='99999999999999999999';
echo "</TABLE></center>\n";
echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε.\n";
}
if (strlen($reports_hh) > 1) {
?>
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php?relogin=YES&VD_lo
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php\"><IMG SRC=\"../a
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
@@ -959,6 +959,7 @@ if ($campaign_allow_inbound > 0)
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
+19 -7
View File
@@ -1644,11 +1644,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.0.5-172';
$build = '90310-2203';
$admin_version = '2.0.5-173';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2850,7 +2851,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Informes de exportación -</B> Este ajuste, si se pone a 1 permitirá un gerente de exportación para acceder a la llamada de los informes sobre la INFORMES pantalla. El valor predeterminado es 0. Pide para el Informe de Exportación, para el siguiente campo se utiliza para las exportaciones: <BR>call_date,phone_number,status,user,full_name,campaign_id/in-group,vendor_lead_code,source_id,list_id,gmt_offset_now,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,length_in_sec,user_group,alt_dial/queue_seconds
<B>Informes de exportación -</B> Este ajuste, si se pone a 1 permitirá un gerente de exportación para acceder a la llamada de los informes sobre la INFORMES pantalla. El valor predeterminado es 0. Pide para el Informe de Exportación, para el siguiente campo se utiliza para las exportaciones: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds
@@ -7891,6 +7892,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8014,6 +8018,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8144,6 +8151,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12410,6 +12420,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -14842,6 +14855,7 @@ if ( ($ADD==34) or ($ADD==31) )
}
}
echo "</TD></TR></TABLE></center>\n";
}
@@ -18771,7 +18785,7 @@ if ($ADD==1300)
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>GRUPOS DE ENTRADA :\n";
echo "<br>Entrantes DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -19864,9 +19878,6 @@ if ($ADD==999999)
}
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
@@ -20208,6 +20219,7 @@ if (isset($camp_lists))
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1;
-7
View File
@@ -911,13 +911,6 @@ if (strlen($reports_hh) > 1) {
<?}
### Do nothing if admin has no permissions
if($LOGast_admin_access < 1)
{
$ADD='99999999999999999999';
echo "</TABLE></center>\n";
echo "Le no autorizan a visión esta página. Vaya por favor detrás.\n";
}
if (strlen($reports_hh) > 1) {
?>
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php?relogin=YES&VD_lo
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php\"><IMG SRC=\"../a
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
@@ -959,6 +959,7 @@ if ($campaign_allow_inbound > 0)
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
+46 -34
View File
@@ -1644,11 +1644,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.0.5-172';
$build = '90310-2203';
$admin_version = '2.0.5-173';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2175,7 +2176,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD
$UGcampaigns = explode(" ", $allowed_campaigns);
$p=0; $RANK_camp_active=0; $CR_disabled = '';
if (eregi('-ALL-CAMPAGNES-',$allowed_campaigns))
if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns))
{$RANK_camp_active++;}
else
{
@@ -2409,23 +2410,23 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD
}
$campaigns_value='';
$campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAGNES-"';
$campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"';
$qc_campaigns_value='';
$qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPAGNES-"';
$qc_campaigns_list='<B><input type="checkbox" name="qc_campaigns[]" value="-ALL-CAMPAIGNS-"';
$qc_groups_value='';
$qc_groups_list='<B><input type="checkbox" name="qc_groups[]" value="-ALL-GROUPS-"';
$p=0;
while ($p<100)
{
if (eregi('ALL-CAMPAGNES',$campaigns[$p]))
if (eregi('ALL-CAMPAIGNS',$campaigns[$p]))
{
$campaigns_list.=" CHECKED";
$campaigns_value .= " -ALL-CAMPAGNES- -";
$campaigns_value .= " -ALL-CAMPAIGNS- -";
}
if (eregi('ALL-CAMPAGNES',$qc_campaigns[$p]))
if (eregi('ALL-CAMPAIGNS',$qc_campaigns[$p]))
{
$qc_campaigns_list.=" CHECKED";
$qc_campaigns_value .= " -ALL-CAMPAGNES- -";
$qc_campaigns_value .= " -ALL-CAMPAIGNS- -";
}
if (eregi('ALL-GROUPS',$qc_groups[$p]))
{
@@ -2434,8 +2435,8 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD
}
$p++;
}
$campaigns_list.="> ALL-CAMPAGNES - LES UTILISATEURS PEUVENT VOIR CHAQUE CAMPAGNE</B><BR>\n";
$qc_campaigns_list.="> ALL-CAMPAGNES - UTILISATEURS CAN QC TOUTE LA CAMPAGNE</B><BR>\n";
$campaigns_list.="> ALL-CAMPAIGNS - LES UTILISATEURS PEUVENT VOIR CHAQUE CAMPAGNE</B><BR>\n";
$qc_campaigns_list.="> ALL-CAMPAIGNS - UTILISATEURS CAN QC TOUTE LA CAMPAGNE</B><BR>\n";
$qc_groups_list.="> ALL-GROUPS - UTILISATEURS CAN QC ENTRANT TOUT GROUP</B><BR>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
@@ -2850,7 +2851,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Rapports d'exportation -</B> Ce paramètre, s'il est à 1 permettra d'accéder à un gestionnaire de l'exportation des rapports sur l'appel RAPPORTS écran. La valeur par défaut est 0. Pour le rapport invite l'exportation, l'ordre suivant est utilisé pour les exportations: <BR>call_date,phone_number,status,user,full_name,campaign_id/in-group,vendor_lead_code,source_id,list_id,gmt_offset_now,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,length_in_sec,user_group,alt_dial/queue_seconds
<B>Rapports d'exportation -</B> Ce paramètre, s'il est à 1 permettra d'accéder à un gestionnaire de l'exportation des rapports sur l'appel RAPPORTS écran. La valeur par défaut est 0. Pour le rapport invite l'exportation, l'ordre suivant est utilisé pour les exportations: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds
@@ -3042,7 +3043,7 @@ if ($SSoutbound_autodial_active > 0)
- 8365 - Will seulement envoyer l'appel à un agent sur le même serveur que l'appel est en
- 8366 - Occasions-1 pour la presse et campagnes de sondage
- 8367 - Le premier à essayer d'envoyer l'appel à un agent sur le serveur local, il se penchera sur d'autres serveurs
- 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on
- 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on
- 8369 - Occasions de Answering Machine de détection après que, même comportement que 8368
- 8373 - Occasions de Answering Machine de détection après cette même comportement que 8366
@@ -6933,7 +6934,7 @@ if ($ADD==21)
$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='CAMPAGNES', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AJOUTER UNE CAMPAGNE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -6988,7 +6989,7 @@ if ($ADD==20)
$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='CAMPAGNES', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='COPY', record_id='$campaign_id', event_code='ADMIN COPY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -7556,7 +7557,7 @@ if ($ADD==211111)
}
else
{
$stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAGNES-');";
$stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>GROUPE D'UTILISATEURS AJOUTE: $user_group</B>\n";
@@ -7891,6 +7892,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8014,6 +8018,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8144,6 +8151,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -9128,7 +9138,7 @@ if ($ADD==41)
$SQL_log = "$stmt|$stmtB|";
$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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -9192,7 +9202,7 @@ if ($ADD==41)
$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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -9201,7 +9211,7 @@ if ($ADD==41)
$SQL_log = "$stmtA|";
$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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -9382,7 +9392,7 @@ if ($ADD==44)
$SQL_log = "$stmt|$stmtB|";
$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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN ACTIVE LISTES', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -9432,7 +9442,7 @@ if ($ADD==44)
$SQL_log = "$stmtA|";
$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='CAMPAGNES', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -9447,7 +9457,7 @@ if ($ADD==44)
$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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN LEAD HOPPER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -11728,7 +11738,7 @@ if ($ADD==61)
$SQL_log = "$stmtA|";
$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='CAMPAGNES', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -11763,7 +11773,7 @@ if ($ADD==62)
$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='CAMPAGNES', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='LOGOUT', record_id='$campaign_id', event_code='ADMIN LOGOUT CAMPAIGN AGENTS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -11806,7 +11816,7 @@ if ($ADD==63)
$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='CAMPAGNES', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$campaign_id', event_code='ADMIN RESET CAMPAIGN JAM', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
@@ -12410,6 +12420,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12982,7 +12995,7 @@ if ($ADD==3)
if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed
if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAGNES",$LOGallowed_campaigns)) ) )
if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==31)
@@ -13768,7 +13781,7 @@ if ($ADD==31)
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Cliquez ici pour voir les rappels réservés de cette campagne</a><BR><BR>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAGNES&stage=$campaign_id\">Cliquez ici pour voir Admin chages à cette campagne</FONT>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Cliquez ici pour voir Admin chages à cette campagne</FONT>\n";
}
echo "</b></center>\n";
}
@@ -14216,7 +14229,7 @@ if ($ADD==31)
# ADD=34 modify campaign info in the system - Basic View
######################
if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAGNES",$LOGallowed_campaigns)) ) )
if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==34)
@@ -14584,7 +14597,7 @@ if ($ADD==34)
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Cliquez ici pour voir les rappels réservés de cette campagne</a><BR><BR>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAGNES&stage=$campaign_id\">Cliquez ici pour voir Admin chages à cette campagne</FONT>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Cliquez ici pour voir Admin chages à cette campagne</FONT>\n";
}
echo "</b></center>\n";
@@ -14637,7 +14650,7 @@ if ($ADD==34)
######################
# ADD=31 or 34 and SUB=29 for list mixes
######################
if ( ( ($ADD==34) or ($ADD==31) ) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAGNES",$LOGallowed_campaigns)) ) )
if ( ( ($ADD==34) or ($ADD==31) ) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ( ($ADD==34) or ($ADD==31) )
@@ -14842,6 +14855,7 @@ if ( ($ADD==34) or ($ADD==31) )
}
}
echo "</TD></TR></TABLE></center>\n";
}
@@ -18771,7 +18785,7 @@ if ($ADD==1300)
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>LISTE DES GROUPES ENTRANTS:\n";
echo "<br>ENTRANT DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -19864,9 +19878,6 @@ if ($ADD==999999)
}
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
@@ -20208,6 +20219,7 @@ if (isset($camp_lists))
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1;
-7
View File
@@ -911,13 +911,6 @@ if (strlen($reports_hh) > 1) {
<?}
### Do nothing if admin has no permissions
if($LOGast_admin_access < 1)
{
$ADD='99999999999999999999';
echo "</TABLE></center>\n";
echo "Vous n'êtes pas autorisé à voir cette page. Veuillez revenir en arrière.\n";
}
if (strlen($reports_hh) > 1) {
?>
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php?relogin=YES&VD_lo
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php\"><IMG SRC=\"../a
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
@@ -959,6 +959,7 @@ if ($campaign_allow_inbound > 0)
$rslt=mysql_query($stmt, $link);
$ccamps_to_print = mysql_num_rows($rslt);
$c=0;
$closer_campaignsSQL='';
while ($ccamps_to_print > $c)
{
$row=mysql_fetch_row($rslt);
+19 -7
View File
@@ -1644,11 +1644,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90308-0956 - Added server statistics
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.0.5-172';
$build = '90310-2203';
$admin_version = '2.0.5-173';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2850,7 +2851,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="vicidial_users-export_reports">
<BR>
<B>Rapporti Export -</B> Questa impostazione, se impostato su 1 consente di accedere a un manager di esportazione chiamata relazioni sulle relazioni schermo. Il valore di default è 0. Per la relazione chiede di esportazione, per il seguente campo è utilizzato per le esportazioni: <BR>call_date,phone_number,status,user,full_name,campaign_id/in-group,vendor_lead_code,source_id,list_id,gmt_offset_now,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,length_in_sec,user_group,alt_dial/queue_seconds
<B>Rapporti Export -</B> Questa impostazione, se impostato su 1 consente di accedere a un manager di esportazione chiamata relazioni sulle relazioni schermo. Il valore di default è 0. Per la relazione chiede di esportazione, per il seguente campo è utilizzato per le esportazioni: <BR>call_date, phone_number, status, user, full_name, campaign_id/in-group, vendor_lead_code, source_id, list_id, gmt_offset_now, 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, length_in_sec, user_group, alt_dial/queue_seconds
@@ -7891,6 +7892,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8014,6 +8018,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8144,6 +8151,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12410,6 +12420,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -14842,6 +14855,7 @@ if ( ($ADD==34) or ($ADD==31) )
}
}
echo "</TD></TR></TABLE></center>\n";
}
@@ -18771,7 +18785,7 @@ if ($ADD==1300)
$rslt=mysql_query($stmt, $link);
$dids_to_print = mysql_num_rows($rslt);
echo "<br>ELENCO GRUPPI INBOUND:\n";
echo "<br>INBOUND DID LISTINGS:\n";
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -19864,9 +19878,6 @@ if ($ADD==999999)
}
echo "</TD></TR></TABLE></center>\n";
echo "</TD></TR></TABLE></center>\n";
@@ -20208,6 +20219,7 @@ if (isset($camp_lists))
$Dsql .= "'$Dstatuses[$o]',";
}
$Dsql = preg_replace("/,$/","",$Dsql);
if (strlen($Dsql) < 2) {$Dsql = "''";}
$stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL";
#$DB=1;
-7
View File
@@ -911,13 +911,6 @@ if (strlen($reports_hh) > 1) {
<?}
### Do nothing if admin has no permissions
if($LOGast_admin_access < 1)
{
$ADD='99999999999999999999';
echo "</TABLE></center>\n";
echo "Le no autorizan a visio`n esta página. Vaya por favor detrás.\n";
}
if (strlen($reports_hh) > 1) {
?>
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php?relogin=YES&VD_lo
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
+4 -1
View File
@@ -2,7 +2,7 @@
# welcome_demo.php - VICIDIAL welcome Demo page
#
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
header ("Content-type: text/html; charset=utf-8");
@@ -47,6 +47,9 @@ echo "<font size=3><b> &nbsp; <a href=\"../agc_pl/vicidial.php\"><IMG SRC=\"../a
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_sk/vicidial.php\"><IMG SRC=\"../agc/images/sk.gif\" border=0> Slovak Agent Login</a>";
echo "</TD></TR>\n";
echo "<TR><TD ALIGN=LEFT >";
echo "<font size=3><b> &nbsp; <a href=\"../agc_ru/vicidial.php\"><IMG SRC=\"../agc/images/ru.gif\" border=0> Russian Agent Login</a>";
echo "</TD></TR></TABLE>\n";
echo "</TD><TD VALIGN=TOP>\n";
Binary file not shown.
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
Õ8z*½PScOȪP,ór)" × ‰¼+àEÓ<7‘Ôøj2ýîÕhØÕÑ#8誙éBØ,ƒ65ŸÂCb (ÔøRºý¡aá.4³ Áµ‘•™âáäWFR2¹Á) ±‰Õ8z.ý¿¤hÜÍK]…º%Mq]¤œ°Í·M]ƒ %tñ•Ôøyî½\ƒ á‘,Yµc:â•SÄÏd<,ióŸ£UäôÔøK:ô»B.e©Z%¢Vn*àóä¡Q´­Eã!tä+DìÔùCWETÁbíÁ´øo‡k]¡Žb­ÉŸ›”cÔøCz´ãÁÕ”ª.”ãÂ4û6±£_ÂM¬è]]¸æDóÔøbv¼]áÅ–)`]¢kéÊœ_uYª®©]ÁUU2FòÔør.½]á·Mt÷…ÃZÇlöd]£C]6¦ø]Y[Ê.jÔøR÷=_a ë­º_ ‚Ü­ÊÜâÁ1©Z…šâÁÌ]…æßÔør2ýÕ¢)6A›]â­É]¢(,Qáœ]™”\gSÕ4Âaõ‹¦&¬Q2cÊ>”¬vø\udI$P`ë®ÚÝu
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
ÕxZ²ýP4e5cU\ #n7#¤¸ŽHVŽêc ØÍŒÉÕxC»=æâ¸Ö¹A`ø‘a肹 ¹µBÁ+3+Õx;ÿ4ÍQ‘ªÓ‡Á¨x‹¸å¡7 TÖÞ_¡ª°’› ÕxJöüÍB<]ÁÚ%]á‡Ð¸
]ât×]"0s Õwb2ý¡"ÙhÏÏ£&ñ 0_CÚ%‚Ø,Ï#ÁdAœÕxZ·=a#^T­I¿XV¥ØÕ¡±s6©IsBt—IrŸÕx%~´¶Â— Žb!aÏ8s‡ËaÓÍ8cFå )“8ëÕxZvý¢E„XÝÌ]#y¥02•¨Ï":#ƒ8tÕxZvü"%Ñ|©ƒ_âÓ,äϢø“YŒè×ÕxJúôåA¥Ú}’·¡¼m¡Ìe·Ñ+6µj_¡Æ-gF|ÕxK>üaâ-
ì®ØwCY Œè—¡J,ƒFsÏÁ­Í®ZÕx<>ô_"q-³£µ )²‹ Ÿ¡*Ƭså ÷ Ps‹Õv‘æµ_åÃc•Ûã„íÓg‹Î²rG$R 埗Yµ
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
Υχ;ϋ=PW1W#X υ[r)ΆdΡ[K±δ%7®
Υψ$ώτ£c±#2¤κ΅+)U…΅BV4FΒ¬£Α›S΄½ΥχC{4[γHnpή¥¤κ•·”£βΨbΒΟƒ`εgΈβΥχC?=εγW n(*ΉΆEΝn,©ΉΒΖ{Qα–εΑαΞ6¦qΥχR·=Ή!ηΖ®\Οb#΅V‰)Ή«°Λ £ΐ…h~ ΥχR»=£ ²΄Ρ“£΅η \%Ά.ΜΠkε‚nΝΜ\–ΥχR»=εΑ—pzΫΟαµr’δ>ά™=£΅$u ΘμΥχR»=ΟG…Ο ΘµjΥ&Οa·ΣyΟΰΧΥχCΏ<ΟΒ·+61γaΝΧΟ£pτK¦σΉΆβιηΥχ;ΎτWCΡlR΅™ƒLΤΙJΧε$Έ=R£Αf¤‡¶Υψ%>³γ##xw…bΆ ΙLMδα“Ω}‰Οbj&‡V¤ΥψϊμΉΰΉκ:3 ¥αΤέk¶Ία+[µ? ΅ΰ®kSΥψ%vσ£A¥bY—ΨΝ•9‹‰λ7©ΰέ‘Ψε
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
Õ8‚®ýPRáW¸é\-Ѹ£¬eŒ•lñìG'„XVÔÔùbúýî¤Õ,‹µbÓ*V èÂÔrK"“bTÕJ¤°Ôú5~³ÕaÈ‹fÅ9áZÚÉTŽÈ¥`Í•ááI”ŒZ^Õ8‚nýYäÃZ2!QÄhzã˜äk¥Ì*Š·‘ƒ›"xSÕ8‚nô“£ªâ漓‚Ƹ®‘ÃÓ*Ž‹"“‚fsŒãÔùSzó‘CdÖƒHÝΡµQTëÎÁºmqÓÂZ•£sÔùbû=iB
ª‘·V“bc« #“meTQ¢ÅJeÔùS;4‘¡Š²ŽUQ¡\ÔÆH'k‚ JéXž»á+ ˜ÊÓÕ8‚2¼U"àê #ÒçÃØ9еkÃÚ:'œQ„ "IÔø‚.ü‘S”Ìc§"7ÊоÏRërŒâ“Á%ÚœÎÄÔúD~óÕV΢Ée’¢ VãÒÁ¸Õqräã!±·EÔùK¾üáÁ¡i}9EiÁšë™UEã¡Lyª¥ê“áXz«9#Õ3âáõ—È­°ržQ¨ Y”ÍsÌq[‘HܘaM­òí2
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
Õxj·=P3cWc•T qFÜš$·DV•ìD%CHÕxS<UÖkoà“Â6±RˆÙU¢t¤.5\U¾”¡Æ+Õxj·=§B¾”ÅÄd§‰`ɼTUÁ 9D§!ÂòR‰YÕwrw=Ï RQÅSÂq9aÖUÂ:²Žšè‘‚cxIÕxS?=UàÇË7!Tá¹mfžÌ‚B¤¥šåaâ²*ÕxK¾óS¡l£¶¸U¡,•jd¹U€‹MÉt¯U“íZfÕxCþ²y"£0•œÓ‘Á›YñLËUÁ#Ùœ;SÁÊr§¸Õx<¾óUÁa\=GÆåáE*U·OUádÞÅhUá>&‡T»ÕxD?4åAáœ9EŒ©Á'Ú¸½UÁÅ2r [SªyÇqÕxb·<©ÂH×maQb ÅZ%ãB#hS¢H;K)Õxbû=mAâ¹K&²«¡µÊÐ^WW¡›CÈjg“¡¦ú’ŠäÕxbû=§¡óUÁ5q^ƒåŠÓ©ÆÝSÂ;L­fŸÕw’.ýåÂÙPÞS¡ Ó¥ÊÜFär6zœA[´»M­
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
уВD;3Pв2FЙXL╓Qе▌EFфFFyДD╛ Аж÷уВ-~╙Ц└╖(я;Em╕3з╣<\ёт╛K≈i╧da1s уЬ5~ЙЕyjX╝W╖Q▄╪Wбб≥┼хлД╒╓ЬV┐уЬ=?4ЕBрЦ2%XW╒j▌fRyUB·]iПМ╔б┴▒пн²уЬD=Еб'╒╣:еWB╔ax╫Г"tМ ≈)Г║╨,Nа уВS<обьжNH9W└ыF┴ХsЦ╓*╚▒еF▐Ц╥(н/уВZШ<Wд+!ИJ²о┌*╠nEфЦ╒c√6BПоаБЭvs3уВb╩=ЕаФэБ:╓mbй]Jя-ЕЙV≈┐╧┌f535aуВZШ=о║Hl╤║зоБbСO╘Е│kJZ╦WбХu.а╒уВS=WcX°ё8j≥ц≥XПлгW╓ЗZ'кcёZ√fж╨уЬ<Ъ=WB╛$jdКД┌S╛X]на▀JяZ√ЦбРo SуЬ.>УЕ║W╓╡XW│ТlK%aЕ║.у▄ТЯ╧бл╘ь╜ж4╧Й╬Ел+MЛv_dх≈к╠.┘кЯ#╣IZAьЪ⌡Y╣
Binary file not shown.
-115
View File
@@ -1,115 +0,0 @@
# $Id: Makefile,v 1.9 2005/10/27 17:53:35 stevek Exp $
#
# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer
#
# Copyright (C) 2002,2003 Junghanns.NET GmbH
#
# Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
#
# This program is free software and may be modified and
# distributed under the terms of the GNU Public License.
#
.EXPORT_ALL_VARIABLES:
#
# app_conference defines which can be passed on the command-line
#
DESTDIR :=
INSTALL_MODULES_DIR := /usr/lib/asterisk/modules
INSTALL_CONFIG_DIR := /etc/asterisk
ASTERISK_INCLUDE_DIR := /usr/include/asterisk
# turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
APP_CONFERENCE_DEBUG := 1
# 0 = OFF 1 = astdsp 2 = speex
SILDET := 2
#
# app_conference objects to build
#
OBJS = app_conference.o conference.o member.o frame.o cli.o
SHAREDOS = app_conference.so
#
# standard compile settings
#
PROC = $(shell uname -m)
INSTALL = install
CC = gcc
# skip asterisk includes if they are in /usr/include/asterisk
ifneq ($(shell dirname $(ASTERISK_INCLUDE_DIR)), /usr/include)
INCLUDE = -I$(ASTERISK_INCLUDE_DIR)
endif
LIBS = -ldl -lpthread -lm
DEBUG := -g
CFLAGS += -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
CFLAGS += -DCRYPTO
ifeq ($(APP_CONFERENCE_DEBUG), 1)
CFLAGS += -DAPP_CONFERENCE_DEBUG
endif
#
# additional flag values for silence detection
#
ifeq ($(SILDET), 2)
OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
CFLAGS += -Ilibspeex -DSILDET=2
endif
ifeq ($(SILDET), 1)
CFLAGS += -DSILDET=1
endif
OSARCH=$(shell uname -s)
ifeq (${OSARCH},Darwin)
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else
SOLINK=-shared -Xlinker -x
endif
#
# targets
#
all: $(SHAREDOS)
clean:
rm -f *.so *.o $(OBJS)
app_conference.so : $(OBJS)
$(CC) -shared -Xlinker -x -o $@ $(OBJS)
vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
$(CC) $(PROFILE) -o $@ $^ -lm
install: all
if [ ! -d ${DESTDIR}${INSTALL_MODULES_DIR} ]; then \
$(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_MODULES_DIR} ; \
fi
for x in $(SHAREDOS); do \
$(INSTALL) -m 755 $$x ${DESTDIR}$(INSTALL_MODULES_DIR) ; \
done
cp -f *.gsm /var/lib/asterisk/sounds
cp -f *.wav /var/lib/asterisk/sounds
#config: all
# if [ ! -d ${DESTDIR}${INSTALL_CONFIG_DIR} ]; then \
# $(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_CONFIG_DIR} ; \
# fi
# $(INSTALL) -m 640 conf.conf ${DESTDIR}${INSTALL_CONFIG_DIR}
-2
View File
@@ -1,2 +0,0 @@
Õ8šê½PRá•=:¢^
àÜr(ÛžfMÑ[àE8‡Á‘Õ8¢®½áƒv†G—(QE!”fÝ…ã ¢­Q[…¢¬O*Ö©Ôúrû<ÓHWSœ€áw“tÖ8ÜÁµDÅÆxí"IGDèÔüLÔ:RŠÄ«ÁUX¹…¢Éj¸£]‚H䋨êÔûL~ü¹âãrœãA fa¡»áÖ®2·…_Á(º®9FÔù‚·<Qñ*1­­‚A$ŽHä_¡Ÿ+ŽUT»¡œ.Š5›Õ8¢n½a#6©y>Ü—ã‰áL]ëRQh_¢¹ÃÓÔø‚²³…7#uG©B.Vƒ³i]‚žM†cj…¢E2•šÅÔù[vª…A¥ÑåDy«œ”Âac]ÂÖloŒÛá‚HtR©FÔùzöô‡—ÃæHy­!ÕЦð«AqŽ8¨ã!Q‡ȤÔûc=á¡á6 áB)SdÞ­U9Æáñ"<55ÅÔûc¿=ÕÁŒÛ‰ømábÛÂSc_žÜ©äëáÂH¬UÉDÔù{7=_!1˜Ö¥•!‰S©Ô왩¸ãn:5P!kuÚëæ
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-341
View File
@@ -1,341 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
-121
View File
@@ -1,121 +0,0 @@
# $Id: Makefile,v 1.9 2005/10/27 17:53:35 stevek Exp $
#
# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer
#
# Copyright (C) 2002,2003 Junghanns.NET GmbH
#
# Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
#
# This program is free software and may be modified and
# distributed under the terms of the GNU Public License.
#
.EXPORT_ALL_VARIABLES:
#
# app_conference defines which can be passed on the command-line
#
INSTALL_PREFIX := /usr
INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/lib/asterisk/modules
ASTERISK_INCLUDE_DIR := $(HOME)/local/asterisk/asterisk/include
# turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
APP_CONFERENCE_DEBUG := 1
# 0 = OFF 1 = astdsp 2 = speex
SILDET := 2
#
# app_conference objects to build
#
OBJS = app_conference.o conference.o member.o frame.o cli.o
SHAREDOS = app_conference.so
#
# standard compile settings
#
PROC = $(shell uname -m)
INSTALL = install
CC = gcc
INCLUDE = -I$(ASTERISK_INCLUDE_DIR)
LIBS = -ldl -lpthread -lm
DEBUG := -g
CFLAGS = -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
#CFLAGS += -O2
#CFLAGS += -O3 -march=pentium3 -msse -mfpmath=sse,387 -ffast-math
# PERF: below is 10% faster than -O2 or -O3 alone.
#CFLAGS += -O3 -ffast-math -funroll-loops
# below is another 5% faster or so.
CFLAGS += -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant
# this is fun for PPC
#CFLAGS += -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic
# this is fun for x86
CFLAGS += -march=pentium3 -msse -mfpmath=sse,387
# adding -msse -mfpmath=sse has little effect.
#CFLAGS += -O3 -msse -mfpmath=sse
#CFLAGS += $(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
CFLAGS += -DCRYPTO
ifeq ($(APP_CONFERENCE_DEBUG), 1)
CFLAGS += -DAPP_CONFERENCE_DEBUG
endif
#
# additional flag values for silence detection
#
ifeq ($(SILDET), 2)
OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
CFLAGS += -Ilibspeex -DSILDET=2
endif
ifeq ($(SILDET), 1)
CFLAGS += -DSILDET=1
endif
OSARCH=$(shell uname -s)
ifeq (${OSARCH},Darwin)
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else
SOLINK=-shared -Xlinker -x
endif
#
# targets
#
all: $(SHAREDOS)
clean:
rm -f *.so *.o $(OBJS)
app_conference.so : $(OBJS)
$(CC) -pg -shared -Xlinker -x -o $@ $(OBJS)
vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
$(CC) $(PROFILE) -o $@ $^ -lm
install: all
for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(INSTALL_MODULES_DIR) ; done
cp -f *.gsm /var/lib/asterisk/sounds
cp -f *.wav /var/lib/asterisk/sounds
# /var/horizon/mojo/lib/horizoncmd restart asterisk
# make sure you restart asterisk after make install
# config: all
# cp conf.conf /etc/asterisk/
-170
View File
@@ -1,170 +0,0 @@
app_conference is a channel-independent conference application.
Design goals
It has several design goals which are different than meetme:
* It does not require a zap channel for timing.
* It is very efficient when used with channels which support DTX (silence
detection/discontinuous transmission).
* It can do VAD on channels which do not support DTX (although this
is more expensive than just mixing them, but less expensive then
encoding; therefore it might still be a win).
* It presents messages on the Monitor interface for determine which
speakers are active.
I believe that people other than myself are using this, but my environment is
pretty rigid, and cases outside of this aren't tested:
* Some callers come from the PSTN via IAX2 from a box with Zaptel cards,
via uLaw.
* Other callers come from iaxclient based softphones using speex
(was GSM) via IAX2 (with DTX).
* Some conferences have a single SIP channel which listens in GSM.
Mixing design
* Minimize encoding/decoding, minimize mixing.
* Minimize generational loss from trancoding.
* Usual cases are handled very efficiently:
o One speaker: That speaker's frame is sent directly to each
participant which uses the same codec. It is trancoded
_once_ for each additional codec type used by participants.
o Two speakers: Each speaker gets the other speaker's frames.
The two speaker's frames are decoded and mixed, and then
encoded _once_ for each codec type used by participants.
License
Naturally, app_conference is GPL. The CVS also includes parts of libspeex,
which is distributed under it's a BSD-style license.
Getting app_conference
app_conference is available from the 'iaxclient' project on sourceforge:
* CVS browse: http://iaxclient.cvs.sourceforge.net/iaxclient/app_conference/
* Project page: http://sourceforge.net/projects/iaxclient/
Compiling app_conference
* just like any other asterisk application.
* Some makefile fiddling may be necessary
Using app_conference
There is no configuration file. Conferences are created on-the-fly.
Dialplan syntax: Conference(ConferenceName|Flags|Priority[|VADSTART|VADCONTINUE])
* ConferenceName: Whatever you want to name the conference
* Flags one of more of the following:
o M: Moderator (presently same as speaker)
o S: Speaker
o L: Listener
o T: "Telephone caller" (just for stats?).
o V: Do VAD on this caller
o D: Use Denoise filter on this caller.
o d: Send manager events when DTMF is received.
o q: Do not play enter or exit sounds.
o i: use inband dtmf broadcast.
o t: use rfc dtmf signal broadcast.
* Priority: Currently ignored; was to be a "speaking priority" so a
higher priority caller could "override" others.
* VADSTART: Optional: "probability" to use to detect start of speech.
* VADCONTINUE: Optional: "probability" to use to detect continuation
of speech.
Features / CLI/Manager Commands
* conference debug <conference_name> [ on | off ]
enable debugging for a conference
* conference show stats show conference stats
* conference play sound <channel-id> <sound-file> [mute]
play a sound to a conference member, optionally muting them.
Manager Events
app_conference generates several detailed manager events so that applications
interfacing with the manager API can monitor conferences:
* ConferenceState: sent as members begin/end speaking.
Channel: The channel
State: "speaking" or "silent"
* ConferenceDTMF: sent when conference members send DTMF to the conference
Channel: The channel
Key: The DTMF key send [0-9*#]
* ConferenceSoundComplete: send when the conference has finished playing
a sound to a user
Channel: The channel
Sound: The first 255 bytes of the file requested in conference play
sound CLI/Mgr command.
Benchmarking
It would be nice to have solid benchmarks to present, but a good size
machine should be able to handle many callers when either (a) they are
using DTX, or (b) they are listen-only. It's used often with hundreds of
simultaneous callers.
Discussion
The iaxclient-devel mailing list is probably as good a place as any to discuss.
---
app_conference is brought to you by the letter q, and the number e
Matt Florell Changes for VD_app_conference tarball version. In order to use this
as seemlessly as possible for VICIDIAL it was necessary to modify the code. This
module can now be used in place of using meetme for VICIDIAL. This is
experimental, please test thoroughly before putting it in production.
CHANGES MADE FOR VICIDIAL:
- Default to member type of S instead of L
- Commented out many repetative NOTICEs and ERRORs
- Added entry and exit sounds except for Local/786 and Local/8500998 (VDsilent and DTMFapp)
- Added conf-onlyperson mesage to first conference participant
- Included enter.gsm and leave.gsm files as well as DTMF wav and gsm sounds
- Removed restart from "make install" and added audio file copying
- If no 'd' option is set and DTMF frames are detected, the DTMF audio will be played to the member
- Added 'q' flag to prevent playing of entry/exit sounds
- Added 'i' flag to enable playing of DTMF sounds inband to all members
- Added 't' flag to enable sending of RFC DTMF signals to all members
- Changed delimiter to pipe | from slash / to be more compliant with meetme standards
NOTE TO 64-BIT LINUX USERS:
If you have problems with 64-bit Linux please use the included 64_Makefile instead of the default one.
COMPILE NOTES:
Some Makefile alterations may be necessary for your system:
From Alek Barkley:
I am running FC4 with latest updates ( 2.6.16 kernel )
My CPU is AMD K6 and GCC 4.0.2.
I edited Makefile in app_conference distribution.
To enter CPU architecture in my case -march=k6
========================================================
PROC = k6
# this is fun for x86
#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387
CFLAGS += -march=k6
===========================================================
VD_app_conference CHANGELOG
- Release 0.4 - First VICIDIAL-centric release
- Release 0.5 - Fixed the dtmf broadcast logic and a star/hash bug
- Added 64-bit makefile thanks to Jon Hood
- Release 0.6 - Added Makefile notes and changed some Makefile flags
-86
View File
@@ -1,86 +0,0 @@
VICIDIAL and app_conference
(1.2 tree) EXPERIMENTAL!!!
app_conference offers the plusses of being able to do conferencing
without any zaptel hardware or timers as well as doing native codec
streaming, meaning no manditory downsampling to slin like meetme.
These two features alone mean a rather significant performance boost
to companies who only use VOIP for agents and trunks as well as not
requiring the cost of zaptel hardware or the nightmare of getting
ztdummy to work on some systems.
As of right now, I have a test system fully up and running using
app_conference with VICIDIAL on Asterisk 1.2.8. I have made several
modifications to the app_conference code to make it more of a drop-in
replacement for meetme so that it does not require any changes to the
VICIDIAL codebase. I have added entry and exit sounds(slightly
different from meetme's) as well as "only one in this conference"
message in addition to changing the default member type to speaker(S).
So far I have tested with IAX and SIP channels only and everything
works just like on meetme but I have not done any capacity testing or
tested it in production yet.
If you want to use app_conference instead of meetme for VICIDIAL then follow these instructions:
cd /usr/src/asterisk
wget http://www.eflo.net/files/VD_app_conference_0.6.zip
unzip VD_app_conference_0.6.zip
cd app_conference
make clean
make
make install
In your extensions.conf file you would replace these lines:
exten => 8600051,1,Meetme,8600051
exten => 8600052,1,Meetme,8600052
...continue through 8600100...
exten => 78600051,1,Meetme,8600051|q
exten => 78600052,1,Meetme,8600052|q
...continue through 78600100...
exten => 68600051,1,Meetme,8600051|mq
exten => 68600052,1,Meetme,8600052|mq
...continue through 68600100...
with these lines:
exten => 8600051,1,Conference(8600051)
exten => 8600052,1,Conference(8600052)
...continue through 8600100...
exten => 78600051,1,Conference(8600051|q)
exten => 78600052,1,Conference(8600052|q)
...continue through 78600100...
exten => 68600051,1,Conference(8600051|Lq)
exten => 68600052,1,Conference(8600052|Lq)
...continue through 68600100...
NOTES:
Here are the possible feature flags for this version of app_conference:
o M: Moderator (presently same as speaker) [default]
o S: Speaker
o L: Listener
o T: "Telephone caller" (just for stats?).
o V: Do VAD on this caller
o D: Use Denoise filter on this caller.
o d: Send manager events when DTMF is received.
o q: Do not play enter or exit sounds.
o i: use inband dtmf broadcast.
o t: use rfc dtmf signal broadcast.
COMPILE NOTES:
Some Makefile alterations may be necessary for your system:
From Alek Barkley:
I am running FC4 with latest updates ( 2.6.16 kernel )
My CPU is AMD K6 and GCC 4.0.2.
I edited Makefile in app_conference distribution.
To enter CPU architecture in my case -march=k6
========================================================
PROC = k6
# this is fun for x86
#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387
CFLAGS += -march=k6
===========================================================
-146
View File
@@ -1,146 +0,0 @@
// $Id: app_conference.c,v 1.22 2005/10/26 21:02:07 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#include "app_conference.h"
#include "common.h"
/*
a conference has n + 1 threads, where n is the number of
members and 1 is a conference thread which sends audio
back to the members.
each member thread reads frames from the channel and
add's them to the member's frame queue.
the conference thread reads frames from each speaking members
queue, mixes them, and then re-queues them for the member thread
to send back to the user.
*/
//
// app_conference text descriptions
//
static char *tdesc = "Channel Independent Conference Application" ;
static char *app = "Conference" ;
static char *synopsis = "Channel Independent Conference" ;
static char *descrip = " Conference(): returns 0\n"
"if the user exits with the '#' key, or -1 if the user hangs up.\n" ;
//
// functions defined in asterisk/module.h
//
STANDARD_LOCAL_USER ;
LOCAL_USER_DECL;
int unload_module( void )
{
ast_log( LOG_NOTICE, "unloading app_conference module\n" ) ;
STANDARD_HANGUP_LOCALUSERS ; // defined in asterisk/module.h
// register conference cli functions
unregister_conference_cli() ;
return ast_unregister_application( app ) ;
}
int load_module( void )
{
ast_log( LOG_NOTICE, "loading app_conference module [ $Revision: 1.22 $ ]\n" ) ;
// intialize conference
init_conference() ;
// register conference cli functions
register_conference_cli() ;
return ast_register_application( app, app_conference_main, synopsis, descrip ) ;
}
char *description( void )
{
return tdesc ;
}
int usecount( void )
{
int res;
STANDARD_USECOUNT( res ) ; // defined in asterisk/module.h
return res;
}
char *key()
{
return ASTERISK_GPL_KEY ;
}
//
// main app_conference function
//
int app_conference_main( struct ast_channel* chan, void* data )
{
int res = 0 ;
struct localuser *u ;
// defined in asterisk/module.h
LOCAL_USER_ADD( u ) ;
// call member thread function
res = member_exec( chan, data ) ;
// defined in asterisk/module.h
LOCAL_USER_REMOVE( u ) ;
return res ;
}
//
// utility functions
//
// now returns milliseconds
long usecdiff( struct timeval* timeA, struct timeval* timeB )
{
long a_secs = timeA->tv_sec - timeB->tv_sec ;
long b_secs = (long)( timeA->tv_usec / 1000 ) - (long)( timeB->tv_usec / 1000 ) ;
long u_secs = ( a_secs * 1000 ) + b_secs ;
return u_secs ;
}
// increment a timeval by ms milliseconds
void add_milliseconds( struct timeval* tv, long ms )
{
// add the microseconds to the microseconds field
tv->tv_usec += ( ms * 1000 ) ;
// calculate the number of seconds to increment
long s = ( tv->tv_usec / 1000000 ) ;
// adjust the microsends field
if ( s > 0 ) tv->tv_usec -= ( s * 1000000 ) ;
// increment the seconds field
tv->tv_sec += s ;
return ;
}
-200
View File
@@ -1,200 +0,0 @@
// $Id: app_conference.h,v 1.11 2005/12/16 22:31:58 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#ifndef _ASTERISK_CONF_H
#define _ASTERISK_CONF_H
#include <stdio.h>
/* asterisk includes */
#include <asterisk/pbx.h>
#include <asterisk/module.h>
#include <asterisk/logger.h>
#include <asterisk/lock.h>
#include <asterisk/frame.h>
#include <asterisk/manager.h>
#include <asterisk/dsp.h>
#include <asterisk/translate.h>
#include <asterisk/channel.h>
#include <asterisk/file.h>
#include <asterisk/cli.h>
/* standard includes */
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <pthread.h>
#if (SILDET == 2)
#include "libspeex/speex_preprocess.h"
#endif
//
// app_conference defines
//
// debug logging level
// LOG_NOTICE for debugging, LOG_DEBUG for production
#ifdef APP_CONFERENCE_DEBUG
#define AST_CONF_DEBUG LOG_NOTICE
#else
#define AST_CONF_DEBUG LOG_DEBUG
#endif
//
// feature defines
//
// number of times the last non-silent frame should be
// repeated after silence starts
//#define AST_CONF_CACHE_LAST_FRAME 1
//
// debug defines
//
#define DEBUG_USE_TIMELOG
#define DEBUG_FRAME_TIMESTAMPS
// #define DEBUG_OUTPUT_PCM
//
// !!! THESE CONSTANTS SHOULD BE CLEANED UP AND CLARIFIED !!!
//
//
// sample information for AST_FORMAT_SLINEAR format
//
#define AST_CONF_SAMPLE_RATE 8000
#define AST_CONF_SAMPLE_SIZE 16
#define AST_CONF_FRAME_INTERVAL 20
//
// so, since we cycle approximately every 20ms,
// we can compute the following values:
//
// 160 samples per 20 ms frame -or-
// ( 8000 samples-per-second * ( 20 ms / 1000 ms-per-second ) ) = 160 samples
//
// 320 bytes ( 2560 bits ) of data 20 ms frame -or-
// ( 160 samples * 16 bits-per-sample / 8 bits-per-byte ) = 320 bytes
//
// 160 samples 16-bit signed linear
#define AST_CONF_BLOCK_SAMPLES 160
// 2 bytes per sample ( i.e. 16-bit )
#define AST_CONF_BYTES_PER_SAMPLE 2
// 320 bytes for each 160 sample frame of 16-bit audio
#define AST_CONF_FRAME_DATA_SIZE 320
// 1000 ms-per-second / 20 ms-per-frame = 50 frames-per-second
#define AST_CONF_FRAMES_PER_SECOND ( 1000 / AST_CONF_FRAME_INTERVAL )
//
// buffer and queue values
//
// account for friendly offset when allocating buffer for frame
#define AST_CONF_BUFFER_SIZE ( AST_CONF_FRAME_DATA_SIZE + AST_FRIENDLY_OFFSET )
// maximum number of frames queued per member
#define AST_CONF_MAX_QUEUE 100
// minimum number of frames queued per member
#define AST_CONF_MIN_QUEUE 0
// number of queued frames before we start dropping
#define AST_CONF_QUEUE_DROP_THRESHOLD 4
// number of milliseconds between frame drops
#define AST_CONF_QUEUE_DROP_TIME_LIMIT 750
//
// timer and sleep values
//
// milliseconds we're willing to wait for a channel
// event before we check for outgoing frames
#define AST_CONF_WAITFOR_LATENCY 40
// milliseconds to sleep before trying to process frames
#define AST_CONF_CONFERENCE_SLEEP 40
// milliseconds to wait between state notification updates
#define AST_CONF_NOTIFICATION_SLEEP 500
//
// warning threshold values
//
// number of frames behind before warning
#define AST_CONF_OUTGOING_FRAMES_WARN 50
// number of milliseconds off AST_CONF_FRAME_INTERVAL before warning
#define AST_CONF_INTERVAL_WARNING 1000
//
// silence detection values
//
// toggle silence detection
#define ENABLE_SILENCE_DETECTION 1
// silence threshold
#define AST_CONF_SILENCE_THRESHOLD 128
// speech tail (delay before dropping silent frames, in ms.
// #define AST_CONF_SPEECH_TAIL 180
// number of frames to ignore speex_preprocess() after speech detected
#define AST_CONF_SKIP_SPEEX_PREPROCESS 20
// our speex probability values
#define AST_CONF_PROB_START 0.05
#define AST_CONF_PROB_CONTINUE 0.02
//
// format translation values
//
// AST_FORMAT_MAX_AUDIO is 1 << 15, so we support 0..15
#define AC_SUPPORTED_FORMATS 16
#define AC_SLINEAR_INDEX 6
//
// app_conference functions
//
// main module function
int app_conference_main( struct ast_channel* chan, void* data ) ;
// utility functions
long usecdiff( struct timeval* timeA, struct timeval* timeB ) ;
void add_milliseconds( struct timeval* tv, long ms ) ;
#endif
-332
View File
@@ -1,332 +0,0 @@
// $Id: cli.c,v 1.6 2005/12/21 21:34:50 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#include "cli.h"
//
// debug functions
//
static char conference_debug_usage[] =
"usage: conference debug <conference_name> [ on | off ]\n"
" enable debugging for a conference\n"
;
static struct ast_cli_entry cli_debug = {
{ "conference", "debug", NULL },
conference_debug,
"enable debugging for a conference",
conference_debug_usage
} ;
int conference_debug( int fd, int argc, char *argv[] )
{
if ( argc < 3 )
return RESULT_SHOWUSAGE ;
// get the conference name
const char* name = argv[2] ;
// get the new state
int state = 0 ;
if ( argc == 3 )
{
// no state specified, so toggle it
state = -1 ;
}
else
{
if ( strncasecmp( name, "YES", 4 ) == 0 )
state = 1 ;
else if ( strncasecmp( name, "NO", 3 ) == 0 )
state = 0 ;
else
return RESULT_SHOWUSAGE ;
}
int new_state = set_conference_debugging( name, state ) ;
if ( new_state == 1 )
{
ast_cli( fd, "enabled conference debugging, name => %s, new_state => %d\n",
name, new_state ) ;
}
else if ( new_state == 0 )
{
ast_cli( fd, "disabled conference debugging, name => %s, new_state => %d\n",
name, new_state ) ;
}
else
{
// error setting state
ast_cli( fd, "\nunable to set debugging state, name => %s\n\n", name ) ;
}
return RESULT_SUCCESS ;
}
//
// stats functions
//
static char conference_show_stats_usage[] =
"usage: conference show stats\n"
" display stats for active conferences.\n"
;
static struct ast_cli_entry cli_show_stats = {
{ "conference", "show", "stats", NULL },
conference_show_stats,
"show conference stats",
conference_show_stats_usage
} ;
int conference_show_stats( int fd, int argc, char *argv[] )
{
if ( argc < 3 )
return RESULT_SHOWUSAGE ;
// get count of active conferences
int count = get_conference_count() ;
ast_cli( fd, "\n\nCONFERENCE STATS, ACTIVE( %d )\n\n", count ) ;
// if zero, go no further
if ( count <= 0 )
return RESULT_SUCCESS ;
//
// get the conference stats
//
// array of stats structs
ast_conference_stats stats[ count ] ;
// get stats structs
count = get_conference_stats( stats, count ) ;
// make sure we were able to fetch some
if ( count <= 0 )
{
ast_cli( fd, "!!! error fetching conference stats, available => %d !!!\n", count ) ;
return RESULT_SUCCESS ;
}
//
// output the conference stats
//
// output header
ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", "Name", "Connection Type", "Member Type" ) ;
ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", "----", "---------------", "-----------" ) ;
ast_conference_stats* s = NULL ;
char ct[64] ;
char mt[64] ;
int i;
for ( i = 0 ; i < count ; ++i )
{
s = &(stats[i]) ;
// format connection type
snprintf( ct, 40, "phone( %d ), iax( %d ), sip( %d )",
s->phone, s->iaxclient, s->sip ) ;
// format memeber type
snprintf( mt, 40, "moderators( %d ), listeners( %d )",
s->moderators, s->listeners ) ;
// output this conferences stats
ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", (char*)( &(s->name) ), ct, mt ) ;
}
ast_cli( fd, "\n" ) ;
//
// drill down to specific stats
//
if ( argc == 4 )
{
// show stats for a particular conference
conference_show_stats_name( fd, argv[3] ) ;
}
return RESULT_SUCCESS ;
}
int conference_show_stats_name( int fd, const char* name )
{
// not implemented yet
return RESULT_SUCCESS ;
}
//
// play sound
//
static char conference_play_sound_usage[] =
"usage: conference play sound <channel-id> <sound-file> [mute]\n"
" play sound <sound-file> to conference member <channel-id>.\n"
" mute the channel if 'mute' is present.\n"
;
static struct ast_cli_entry cli_play_sound = {
{ "conference", "play", "sound", NULL },
conference_play_sound,
"play a sound to a conference member",
conference_play_sound_usage
} ;
int conference_play_sound( int fd, int argc, char *argv[] )
{
char *channel, *file;
int mute = 0;
struct ast_conf_member *member;
struct ast_conf_soundq *newsound;
struct ast_conf_soundq **q;
if ( argc < 5 )
return RESULT_SHOWUSAGE ;
channel = argv[3];
file = argv[4];
if(argc > 5 && !strcmp(argv[5], "mute"))
mute = 1;
member = find_member(channel, 1);
if(!member) {
ast_cli(fd, "Member %s not found\n", channel);
return RESULT_FAILURE;
}
newsound = calloc(1,sizeof(struct ast_conf_soundq));
newsound->stream = ast_openstream(member->chan, file, NULL);
if(!newsound->stream) {
ast_cli(fd, "Sound %s not found\n", file);
free(newsound);
ast_mutex_unlock(&member->lock);
return RESULT_FAILURE;
}
member->chan->stream = NULL;
newsound->muted = mute;
ast_copy_string(newsound->name, file, sizeof(newsound->name));
// append sound to the end of the list.
for(q=&member->soundq; *q; q = &((*q)->next)) ;;
*q = newsound;
ast_mutex_unlock(&member->lock);
ast_cli( fd, "Playing sound %s to member %s %s\n",
file, channel, mute ? "with mute" : "");
return RESULT_SUCCESS ;
}
//
// stop sounds
//
static char conference_stop_sounds_usage[] =
"usage: conference stop sounds <channel-id>\n"
" stop sounds for conference member <channel-id>.\n"
;
static struct ast_cli_entry cli_stop_sounds = {
{ "conference", "stop", "sounds", NULL },
conference_stop_sounds,
"stop sounds for a conference member",
conference_stop_sounds_usage
} ;
int conference_stop_sounds( int fd, int argc, char *argv[] )
{
char *channel;
struct ast_conf_member *member;
struct ast_conf_soundq *sound;
struct ast_conf_soundq *next;
if ( argc < 4 )
return RESULT_SHOWUSAGE ;
channel = argv[3];
member = find_member(channel, 1);
if(!member) {
ast_cli(fd, "Member %s not found\n", channel);
return RESULT_FAILURE;
}
// clear all sounds
sound = member->soundq;
member->soundq = NULL;
while(sound) {
next = sound->next;
ast_closestream(sound->stream);
free(sound);
sound = next;
}
// reset write format, since we're done playing the sound
if ( ast_set_write_format( member->chan, member->write_format ) < 0 )
{
ast_log( LOG_ERROR, "unable to set write format to %d\n",
member->write_format ) ;
}
ast_mutex_unlock(&member->lock);
ast_cli( fd, "Stopped sounds to member %s\n", channel);
return RESULT_SUCCESS ;
}
//
// cli initialization function
//
void register_conference_cli( void )
{
ast_cli_register( &cli_debug ) ;
ast_cli_register( &cli_show_stats ) ;
ast_cli_register( &cli_play_sound ) ;
ast_cli_register( &cli_stop_sounds ) ;
}
void unregister_conference_cli( void )
{
ast_cli_unregister( &cli_debug ) ;
ast_cli_unregister( &cli_show_stats ) ;
ast_cli_unregister( &cli_play_sound ) ;
ast_cli_unregister( &cli_stop_sounds ) ;
}
-47
View File
@@ -1,47 +0,0 @@
// $Id: cli.h,v 1.3 2005/10/26 21:02:07 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#ifndef _APP_CONF_CLI_H
#define _APP_CONF_CLI_H
//
// includes
//
#include "app_conference.h"
#include "common.h"
//
// function declarations
//
int conference_show_stats( int fd, int argc, char *argv[] ) ;
int conference_show_stats_name( int fd, const char* name ) ;
int conference_debug( int fd, int argc, char *argv[] ) ;
int conference_no_debug( int fd, int argc, char *argv[] ) ;
int conference_play_sound( int fd, int argc, char *argv[] ) ;
int conference_stop_sounds( int fd, int argc, char *argv[] ) ;
void register_conference_cli( void ) ;
void unregister_conference_cli( void ) ;
#endif
-50
View File
@@ -1,50 +0,0 @@
// $Id: common.h,v 1.3 2005/10/26 21:02:07 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#ifndef _APP_CONF_COMMON_H
#define _APP_CONF_COMMON_H
// typedef includes
#include "conf_frame.h"
// function includesee
#include "conference.h"
#include "member.h"
#include "frame.h"
#include "cli.h"
/* Utility functions */
/* LOG the time taken to execute a function (like lock acquisition */
#if 1
#define TIMELOG(func,min,message) \
do { \
struct timeval t1, t2; \
int diff; \
gettimeofday(&t1,NULL); \
func; \
gettimeofday(&t2,NULL); \
if((diff = usecdiff(&t2, &t1)) > min) \
ast_log( AST_CONF_DEBUG, "TimeLog: %s: %d ms\n", message, diff); \
} while (0)
#else
#define TIMELOG(func,min,message) func
#endif
#endif
-61
View File
@@ -1,61 +0,0 @@
// $Id: conf_frame.h,v 1.3 2005/10/26 21:02:07 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#ifndef _APP_CONF_STRUCTS_H
#define _APP_CONF_STRUCTS_H
//
// includes
//
#include "app_conference.h"
#include "common.h"
//
// struct declarations
//
typedef struct conf_frame
{
// frame audio data
struct ast_frame* fr ;
// array of converted versions for listeners
struct ast_frame* converted[ AC_SUPPORTED_FORMATS ] ;
// pointer to the frame's owner
struct ast_conf_member* member ; // who sent this frame
// frame meta data
// struct timeval timestamp ;
// unsigned long cycleid ;
// int priority ;
// linked-list pointers
struct conf_frame* next ;
struct conf_frame* prev ;
// should this frame be preserved
short static_frame ;
// pointer to mixing buffer
char* mixed_buffer ;
} conf_frame ;
#endif
File diff suppressed because it is too large Load Diff
-121
View File
@@ -1,121 +0,0 @@
// $Id: conference.h,v 1.6 2005/10/26 21:02:07 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#ifndef _APP_CONF_CONFERENCE_H
#define _APP_CONF_CONFERENCE_H
//
// includes
//
#include "app_conference.h"
#include "common.h"
//
// struct declarations
//
typedef struct ast_conference_stats
{
// conference name ( copied for ease of use )
char name[128] ;
// type of connection
unsigned short phone ;
unsigned short iaxclient ;
unsigned short sip ;
// type of users
unsigned short moderators ;
unsigned short listeners ;
// accounting data
unsigned long frames_in ;
unsigned long frames_out ;
unsigned long frames_mixed ;
struct timeval time_entered ;
} ast_conference_stats ;
struct ast_conference
{
// conference name
char name[128] ;
// single-linked list of members in conference
struct ast_conf_member* memberlist ;
int membercount ;
// conference thread id
pthread_t conference_thread ;
// conference data mutex
ast_mutex_t lock ;
// pointer to next conference in single-linked list
struct ast_conference* next ;
// pointer to translation paths
struct ast_trans_pvt* from_slinear_paths[ AC_SUPPORTED_FORMATS ] ;
// conference stats
ast_conference_stats stats ;
// keep track of current delivery time
struct timeval delivery_time ;
// 1 => on, 0 => off
short debug_flag ;
} ;
//
// function declarations
//
struct ast_conference* start_conference( struct ast_conf_member* member ) ;
void conference_exec( struct ast_conference* conf ) ;
struct ast_conference* find_conf( const char* name ) ;
struct ast_conference* create_conf( char* name, struct ast_conf_member* member ) ;
void remove_conf( struct ast_conference* conf ) ;
// find a particular member, locking if requested.
struct ast_conf_member *find_member ( char *chan, int lock) ;
int queue_frame_for_listener( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ;
int queue_frame_for_speaker( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ;
int queue_silent_frame( struct ast_conference* conf, struct ast_conf_member* member ) ;
void add_member( struct ast_conf_member* member, struct ast_conference* conf ) ;
int remove_member( struct ast_conf_member* member, struct ast_conference* conf ) ;
int count_member( struct ast_conf_member* member, struct ast_conference* conf, short add_member ) ;
// called by app_confernce.c:load_module()
void init_conference( void ) ;
int get_conference_count( void ) ;
int get_conference_stats( ast_conference_stats* stats, int requested ) ;
int get_conference_stats_by_name( ast_conference_stats* stats, const char* name ) ;
int set_conference_debugging( const char* name, int state ) ;
#endif
Binary file not shown.
-614
View File
@@ -1,614 +0,0 @@
// $Id: frame.c,v 1.7 2005/10/27 17:53:35 stevek Exp $
/*
* app_conference
*
* A channel independent conference application for Asterisk
*
* Copyright (C) 2002, 2003 Junghanns.NET GmbH
* Copyright (C) 2003, 2004 HorizonLive.com, Inc.
*
* Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
*
* This program may be modified and distributed under the
* terms of the GNU Public License.
*
*/
#include "frame.h"
conf_frame* mix_frames( conf_frame* frames_in, int speaker_count, int listener_count )
{
if ( frames_in == NULL )
return NULL ;
conf_frame* frames_out = NULL ;
if ( speaker_count > 1 )
{
if ( speaker_count == 2 && listener_count == 0 )
{
// optimize here also?
frames_out = mix_multiple_speakers( frames_in, speaker_count, listener_count ) ;
}
else
{
// mix spoken frames for sending
// ( note: this call also releases us from free'ing spoken_frames )
frames_out = mix_multiple_speakers( frames_in, speaker_count, listener_count ) ;
}
}
else if ( speaker_count == 1 )
{
// pass-through frames
frames_out = mix_single_speaker( frames_in ) ;
}
else
{
// no frames to send, leave frames_out null
}
return frames_out ;
}
conf_frame* mix_single_speaker( conf_frame* frames_in )
{
#ifdef APP_CONFERENCE_DEBUG
// ast_log( AST_CONF_DEBUG, "returning single spoken frame\n" ) ;
//
// check input
//
if ( frames_in == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null frame\n" ) ;
return NULL ;
}
if ( frames_in->fr == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null data\n" ) ;
return NULL ;
}
if ( frames_in->member == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null member\n" ) ;
return NULL ;
}
#endif // APP_CONFERENCE_DEBUG
//
// 'mix' the frame
//
// copy orignal frame to converted array so listeners don't need to re-encode it
frames_in->converted[ frames_in->member->read_format_index ] = ast_frdup( frames_in->fr ) ;
// convert frame to slinear, if we have a path
frames_in->fr = convert_frame_to_slinear(
frames_in->member->to_slinear,
frames_in->fr
) ;
// set the frame's member to null ( i.e. all listeners )
frames_in->member = NULL ;
return frames_in ;
}
// {
//
// a little optimization for testing only:
// when two speakers ( of the same type ) and no listeners
// are in a conference, we just swamp the frame's member pointers
//
/*
if (
listeners == 0
&& speakers == 2
&& cf_spokenFrames->member->read_format == cf_spokenFrames->next->member->write_format
&& cf_spokenFrames->member->write_format == cf_spokenFrames->next->member->read_format
)
{
struct ast_conf_member* m = NULL ;
m = cf_spokenFrames->member ;
cf_spokenFrames->member = cf_spokenFrames->next->member ;
cf_spokenFrames->next->member = m ;
return cf_spokenFrames ;
}
*/
// }
void set_conf_frame_delivery( conf_frame* frame, struct timeval time )
{
for ( ; frame != NULL ; frame = frame->next )
{
if ( frame->fr != NULL )
{
// copy passed timeval to frame's delivery timeval
frame->fr->delivery = time ;
}
}
return ;
}
conf_frame* mix_multiple_speakers(
conf_frame* frames_in,
int speakers,
int listeners
)
{
#ifdef APP_CONFERENCE_DEBUG
//
// check input
//
// no frames to mix
if ( ( frames_in == NULL ) || ( frames_in->fr == NULL ) )
{
ast_log( AST_CONF_DEBUG, "passed spoken frame list was NULL\n" ) ;
return NULL ;
}
// if less than two speakers, then no frames to mix
if ( speakers < 2 )
{
ast_log( AST_CONF_DEBUG, "mix_multiple_speakers() called with less than two speakers\n" ) ;
return NULL ;
}
#endif // APP_CONFERENCE_DEBUG
//
// at this point we know that there is more than one frame,
// and that the frames need to be converted to pcm to be mixed
//
// now, if there are only two frames and two members,
// we can swap them. ( but we'll get to that later. )
//
//
// loop through the spoken frames, making a list of spoken members,
// and converting gsm frames to slinear frames so we can mix them.
//
// pointer to the spoken frames list
conf_frame* cf_spoken = frames_in ;
// pointer to the new list of mixed frames
conf_frame* cf_sendFrames = NULL ;
while ( cf_spoken != NULL )
{
//
// while we're looping through the spoken frames, we'll
// convert the frame to a format suitable for mixing
//
// if the frame fails to convert, drop it and treat
// the speaking member like a listener by not adding
// them to the cf_sendFrames list
//
if ( cf_spoken->member == NULL )
{
ast_log( LOG_WARNING, "unable to determine frame member\n" ) ;
}
else
{
// ast_log( AST_CONF_DEBUG, "converting frame to slinear, channel => %s\n", cf_spoken->member->channel_name ) ;
cf_spoken->fr = convert_frame_to_slinear(
cf_spoken->member->to_slinear,
cf_spoken->fr
) ;
if ( cf_spoken->fr == NULL )
{
ast_log( LOG_WARNING, "unable to convert frame to slinear\n" ) ;
}
else
{
// create new conf frame with last frame as 'next'
cf_sendFrames = create_conf_frame( cf_spoken->member, cf_sendFrames, NULL ) ;
}
}
// point to the next spoken frame
cf_spoken = cf_spoken->next ;
}
// if necessary, add a frame with a null member pointer.
// this frame will hold the audio mixed for all listeners
if ( listeners > 0 )
{
cf_sendFrames = create_conf_frame( NULL, cf_sendFrames, NULL ) ;
}
//
// mix the audio
//
// convenience pointer that skips over the friendly offset
char* cp_listenerData ;
// pointer to the send frames list
conf_frame* cf_send = NULL ;
for ( cf_send = cf_sendFrames ; cf_send != NULL ; cf_send = cf_send->next )
{
// allocate a mix buffer which fill large enough memory to
// hold a frame, and reset it's memory so we don't get noise
char* cp_listenerBuffer = malloc( AST_CONF_BUFFER_SIZE ) ;
memset( cp_listenerBuffer, 0x0, AST_CONF_BUFFER_SIZE ) ;
// point past the friendly offset right to the data
cp_listenerData = cp_listenerBuffer + AST_FRIENDLY_OFFSET ;
// reset the spoken list pointer
cf_spoken = frames_in ;
// really mix the audio
for ( ; cf_spoken != NULL ; cf_spoken = cf_spoken->next )
{
//
// if the members are equal, and they
// are not null, do not mix them.
//
if (
( cf_send->member == cf_spoken->member )
&& ( cf_send->member != NULL )
)
{
// don't mix this frame
}
else if ( cf_spoken->fr == NULL )
{
ast_log( LOG_WARNING, "unable to mix conf_frame with null ast_frame\n" ) ;
}
else
{
// mix the new frame in with the existing buffer
mix_slinear_frames( cp_listenerData, (char*)( cf_spoken->fr->data ), cf_spoken->fr->samples ) ;
}
}
// copy a pointer to the frame data to the conf_frame
cf_send->mixed_buffer = cp_listenerData ;
}
//
// copy the mixed buffer to a new frame
//
// reset the send list pointer
cf_send = cf_sendFrames ;
while ( cf_send != NULL )
{
cf_send->fr = create_slinear_frame( cf_send->mixed_buffer ) ;
cf_send = cf_send->next ;
}
//
// clean up the spoken frames we were passed
// ( caller will only be responsible for free'ing returns frames )
//
// reset the spoken list pointer
cf_spoken = frames_in ;
while ( cf_spoken != NULL )
{
// delete the frame
cf_spoken = delete_conf_frame( cf_spoken ) ;
}
// return the list of frames for sending
return cf_sendFrames ;
}
struct ast_frame* convert_frame_to_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr )
{
// check for null frame
if ( fr == NULL )
{
ast_log( LOG_ERROR, "unable to translate null frame to slinear\n" ) ;
return NULL ;
}
// we don't need to duplicate this frame since
// the normal translation would free it anyway, so
// we'll just pretend we free'd and malloc'd a new one.
if ( fr->subclass == AST_FORMAT_SLINEAR )
return fr ;
// check for null translator ( after we've checked that we need to translate )
if ( trans == NULL )
{
// ast_log( LOG_ERROR, "unable to translate frame with null translation path\n" ) ;
return fr ;
}
// return the converted frame
return convert_frame( trans, fr ) ;
}
struct ast_frame* convert_frame_from_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr )
{
// check for null translator ( after we've checked that we need to translate )
if ( trans == NULL )
{
// ast_log( LOG_ERROR, "unable to translate frame with null translation path\n" ) ;
return fr ;
}
// check for null frame
if ( fr == NULL )
{
ast_log( LOG_ERROR, "unable to translate null slinear frame\n" ) ;
return NULL ;
}
// if the frame is not slinear, return an error
if ( fr->subclass != AST_FORMAT_SLINEAR )
{
ast_log( LOG_ERROR, "unable to translate non-slinear frame\n" ) ;
return NULL ;
}
// return the converted frame
return convert_frame( trans, fr ) ;
}
struct ast_frame* convert_frame( struct ast_trans_pvt* trans, struct ast_frame* fr )
{
if ( trans == NULL )
{
ast_log( LOG_WARNING, "unable to convert frame with null translator\n" ) ;
return NULL ;
}
if ( fr == NULL )
{
ast_log( LOG_WARNING, "unable to convert null frame\n" ) ;
return NULL ;
}
// convert the frame
struct ast_frame* translated_frame = ast_translate( trans, fr, 1 ) ;
// check for errors
if ( translated_frame == NULL )
{
ast_log( LOG_ERROR, "unable to translate frame\n" ) ;
return NULL ;
}
// return the translated frame
return translated_frame ;
}
conf_frame* delete_conf_frame( conf_frame* cf )
{
// check for null frames
if ( cf == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to delete null conf frame\n" ) ;
return NULL ;
}
// check for frame marked as static
if ( cf->static_frame == 1 )
return NULL ;
if ( cf->fr != NULL )
{
ast_frfree( cf->fr ) ;
cf->fr = NULL ;
}
// make sure converted frames are set to null
int c;
for ( c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c )
{
if ( cf->converted[ c ] != NULL )
{
ast_frfree( cf->converted[ c ] ) ;
cf->converted[ c ] = NULL ;
}
}
// get a pointer to the next frame
// in the list so we can return it
conf_frame* nf = cf->next ;
free( cf ) ;
cf = NULL ;
return nf ;
}
conf_frame* create_conf_frame( struct ast_conf_member* member, conf_frame* next, const struct ast_frame* fr )
{
// pointer to list of mixed frames
conf_frame* cf = malloc( sizeof( struct conf_frame ) ) ;
if ( cf == NULL )
{
ast_log( LOG_ERROR, "unable to allocate memory for conf frame\n" ) ;
return NULL ;
}
//
// init with some defaults
//
// make sure converted frames are set to null
// for ( int c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c )
// {
// cf->converted[ c ] = NULL ;
// }
memset( (struct ast_frame*)( cf->converted ), 0x0, ( sizeof( struct ast_frame* ) * AC_SUPPORTED_FORMATS ) ) ;
cf->member = member ;
// cf->priority = 0 ;
cf->prev = NULL ;
cf->next = next ;
cf->static_frame = 0 ;
// establish relationship to 'next'
if ( next != NULL ) next->prev = cf ;
// this holds the ast_frame pointer
cf->fr = ( fr == NULL ) ? NULL : ast_frdup( ( struct ast_frame* )( fr ) ) ;
// this holds the temporu mix buffer
cf->mixed_buffer = NULL ;
return cf ;
}
conf_frame* copy_conf_frame( conf_frame* src )
{
//
// check inputs
//
if ( src == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to copy null conf frame\n" ) ;
return NULL ;
}
//
// copy the frame
//
struct conf_frame *cfr = NULL ;
// create a new conf frame
cfr = create_conf_frame( src->member, NULL, src->fr ) ;
if ( cfr == NULL )
{
ast_log( AST_CONF_DEBUG, "unable to create new conf frame for copy\n" ) ;
return NULL ;
}
return cfr ;
}
//
// slinear frame functions
//
struct ast_frame* create_slinear_frame( char* data )
{
struct ast_frame* f ;
f = calloc( 1, sizeof( struct ast_frame ) ) ;
if ( f == NULL )
{
ast_log( LOG_ERROR, "unable to allocate memory for slinear frame\n" ) ;
return NULL ;
}
f->frametype = AST_FRAME_VOICE ;
f->subclass = AST_FORMAT_SLINEAR ;
f->samples = AST_CONF_BLOCK_SAMPLES ;
f->offset = AST_FRIENDLY_OFFSET ;
f->mallocd = AST_MALLOCD_HDR | AST_MALLOCD_DATA ;
f->datalen = AST_CONF_FRAME_DATA_SIZE ;
f->data = data ;
f->src = NULL ;
return f ;
}
void mix_slinear_frames( char *dst, const char *src, int samples )
{
if ( dst == NULL ) return ;
if ( src == NULL ) return ;
int i, val ;
for ( i = 0 ; i < samples ; ++i )
{
val = ( (short*)dst )[i] + ( (short*)src )[i] ;
if ( val > 0x7fff )
{
( (short*)dst )[i] = 0x7fff - 1 ;
continue ;
}
else if ( val < -0x7fff )
{
( (short*)dst )[i] = -0x7fff + 1 ;
continue ;
}
else
{
( (short*)dst )[i] = val ;
continue ;
}
}
return ;
}
//
// silent frame functions
//
conf_frame* get_silent_frame( void )
{
static conf_frame* static_silent_frame = NULL ;
// we'll let this leak until the application terminates
if ( static_silent_frame == NULL )
{
// ast_log( AST_CONF_DEBUG, "creating cached silent frame\n" ) ;
struct ast_frame* fr = get_silent_slinear_frame() ;
static_silent_frame = create_conf_frame( NULL, NULL, fr ) ;
if ( static_silent_frame == NULL )
{
ast_log( LOG_WARNING, "unable to create cached silent frame\n" ) ;
return NULL ;
}
// init the 'converted' slinear silent frame
static_silent_frame->converted[ AC_SLINEAR_INDEX ] = get_silent_slinear_frame() ;
// mark frame as static so it's not deleted
static_silent_frame->static_frame = 1 ;
}
return static_silent_frame ;
}
struct ast_frame* get_silent_slinear_frame( void )
{
static struct ast_frame* f = NULL ;
// we'll let this leak until the application terminates
if ( f == NULL )
{
char* data = malloc( AST_CONF_BUFFER_SIZE ) ;
memset( data, 0x0, AST_CONF_BUFFER_SIZE ) ;
f = create_slinear_frame( data ) ;
}
return ast_frdup( f ) ;
}

Some files were not shown because too many files have changed in this diff Show More