cleanup of extras
git-svn-id: svn://192.168.202.10@17 3d104415-ff17-0410-8863-d5cf3c621b8a
@@ -0,0 +1,463 @@
|
||||
<?
|
||||
### active_list_refresh.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### 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
|
||||
#
|
||||
|
||||
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"];}
|
||||
|
||||
# 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.7';
|
||||
$build = '60421-1155';
|
||||
$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 "Invalid Username/Password: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Invalid server_ip: |$server_ip| or Invalid 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 "Invalid session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='table')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $build ADD: $ADD server_ip: $server_ip-->\n";
|
||||
echo "<title>List Display: ";
|
||||
if ($ADD==1) {echo "Live Extensions";}
|
||||
if ($ADD==2) {echo "Busy Extensions";}
|
||||
if ($ADD==3) {echo "Outside Lines";}
|
||||
if ($ADD==4) {echo "Local Extensions";}
|
||||
if ($ADD==5) {echo "Conferences";}
|
||||
if ($ADD==99999) {echo "HELP";}
|
||||
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<!-- script runtime: $RUNtime seconds -->";}
|
||||
if ($format=='table') {echo "\n</body>\n</html>\n";}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<?
|
||||
define ('ADAY', (60*60*24));
|
||||
$CdayARY = getdate();
|
||||
$Cmon = $CdayARY['mon'];
|
||||
$Cyear = $CdayARY['year'];
|
||||
$CTODAY = date("Y-m");
|
||||
$CTODAYmday = date("j");
|
||||
$CINC=0;
|
||||
|
||||
$Cmonths = Array('January','February','March','April','May','June',
|
||||
'July','August','September','October','November','December');
|
||||
$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
|
||||
|
||||
|
||||
$CCAL_OUT = '';
|
||||
|
||||
$CCAL_OUT .= "<table border=0 cellpadding=2 cellspacing=2>";
|
||||
|
||||
while ($CINC < 12)
|
||||
{
|
||||
if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) )
|
||||
{$CCAL_OUT .= "<tr>";}
|
||||
|
||||
$CCAL_OUT .= "<td valign=top>";
|
||||
|
||||
$CYyear = $Cyear;
|
||||
$Cmonth= ($Cmon + $CINC);
|
||||
if ($Cmonth > 12)
|
||||
{
|
||||
$Cmonth = ($Cmonth - 12);
|
||||
$CYyear++;
|
||||
}
|
||||
$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear);
|
||||
$CfirstdayARY = getdate($Cstart);
|
||||
#echo "|$Cmon|$Cmonth|$CINC|\n";
|
||||
$CPRNTDAY = date("Y-m", $Cstart);
|
||||
|
||||
$CCAL_OUT .= "<table border=1 cellpadding=1 bordercolor=\"000000\" cellspacing=\"0\">";
|
||||
$CCAL_OUT .= "<tr>";
|
||||
$CCAL_OUT .= "<td colspan=7 bordercolor=\"#ffffff\" bgcolor=\"#FFFFCC\">";
|
||||
$CCAL_OUT .= "<div align=center><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=2>";
|
||||
$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]";
|
||||
$CCAL_OUT .= "</font></b></font></div>";
|
||||
$CCAL_OUT .= "</td>";
|
||||
$CCAL_OUT .= "</tr>";
|
||||
|
||||
foreach($Cdays as $Cday)
|
||||
{
|
||||
$CDCLR="#ffffff";
|
||||
|
||||
$CCAL_OUT .= "<td bordercolor=\"$CDCLR\">";
|
||||
$CCAL_OUT .= "<div align=center><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=1>";
|
||||
$CCAL_OUT .= "$Cday";
|
||||
$CCAL_OUT .= "</font></b></font></div>";
|
||||
$CCAL_OUT .= "</td>";
|
||||
}
|
||||
|
||||
for( $Ccount=0;$Ccount<(6*7);$Ccount++)
|
||||
{
|
||||
$Cdayarray = getdate($Cstart);
|
||||
if((($Ccount) % 7) == 0)
|
||||
{
|
||||
if($Cdayarray['mon'] != $CfirstdayARY['mon'])
|
||||
break;
|
||||
$CCAL_OUT .= "</tr><tr>";
|
||||
}
|
||||
if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth)
|
||||
{
|
||||
$CCAL_OUT .= "<td bordercolor=\"#ffffff\"><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"1\"> </font></b></font></td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
|
||||
{
|
||||
$CPRNTmday = $Cdayarray['mday'];
|
||||
if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
|
||||
$CBL = "<a href=\"#\" onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\">";
|
||||
$CEL = "</a>";
|
||||
|
||||
$CCAL_OUT .= "<td bgcolor=\"#CCFFCC\" bordercolor=\"#CCFFCC\">";
|
||||
$CCAL_OUT .= "<div align=center><font face=\"Arial, Helvetica, sans-serif\" size=1>";
|
||||
$CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
|
||||
$CCAL_OUT .= "</font></div>";
|
||||
$CCAL_OUT .= "</td>";
|
||||
$Cstart += ADAY;
|
||||
}
|
||||
else
|
||||
{
|
||||
$CDCLR="#ffffff";
|
||||
if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
|
||||
{
|
||||
$CDCLR="#CCCCCC";
|
||||
$CBL = '';
|
||||
$CEL = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$CPRNTmday = $Cdayarray['mday'];
|
||||
if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
|
||||
$CBL = "<a href=\"#\" onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\">";
|
||||
$CEL = "</a>";
|
||||
}
|
||||
|
||||
$CCAL_OUT .= "<td bgcolor=\"$CDCLR\" bordercolor=\"#ffffff\">";
|
||||
$CCAL_OUT .= "<div align=center><font face=\"Arial, Helvetica, sans-serif\" size=1>";
|
||||
$CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
|
||||
$CCAL_OUT .= "</font></div>";
|
||||
$CCAL_OUT .= "</td>";
|
||||
$Cstart += ADAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
$CCAL_OUT .= "</tr>";
|
||||
$CCAL_OUT .= "</table>";
|
||||
$CCAL_OUT .= "</td>";
|
||||
|
||||
if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) )
|
||||
{$CCAL_OUT .= "</tr>";}
|
||||
$CINC++;
|
||||
}
|
||||
|
||||
$CCAL_OUT .= "</table>";
|
||||
|
||||
echo "$CCAL_OUT\n";
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
<?
|
||||
### call_log_display.php
|
||||
###
|
||||
### Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
###
|
||||
### 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
|
||||
#
|
||||
|
||||
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"];}
|
||||
|
||||
# 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.7';
|
||||
$build = '60421-1401';
|
||||
$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 "Invalid Username/Password: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Invalid server_ip: |$server_ip| or Invalid 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 "Invalid session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n";
|
||||
echo "<title>Call Log Display";
|
||||
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 is not valid or protocol $protocol is not valid\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<!-- script runtime: $RUNtime seconds -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,258 @@
|
||||
<?
|
||||
# conf_exten_check.php
|
||||
#
|
||||
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
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"];}
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($client)) {$client="agc";}
|
||||
|
||||
$version = '0.0.8';
|
||||
$build = '60421-1405';
|
||||
$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";}
|
||||
$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 "Invalid Username/Password: |$user|$pass|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
|
||||
{
|
||||
echo "Invalid server_ip: |$server_ip| or Invalid 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 "Invalid session_name: |$session_name|$server_ip|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $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 is not valid\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($client == 'vdc')
|
||||
{
|
||||
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 ($campagentstdisp == 'YES')
|
||||
{
|
||||
### grab the status of this agent to display
|
||||
$stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Astatus=$row[0];
|
||||
$Acampaign=$row[1];
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$RingCalls=$row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$Astatus='N';
|
||||
$RingCalls='N';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Astatus='N';
|
||||
$RingCalls='N';
|
||||
}
|
||||
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\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 ($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);
|
||||
$ChannelA[$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 ($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);
|
||||
$ChannelA[$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$ChannelA[$counter] ~";
|
||||
# echo "$ChannelA[$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 is not valid or Exten $exten is not valid\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);
|
||||
}
|
||||
echo "Conference $conf_exten has been registered to $exten\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- script runtime: $RUNtime seconds -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?
|
||||
|
||||
$link=mysql_connect("localhost", "cron", "1234");
|
||||
mysql_select_db("asterisk");
|
||||
|
||||
$local_DEF = 'Local/';
|
||||
$conf_silent_prefix = '7';
|
||||
$local_AMP = '@';
|
||||
$ext_context = 'demo';
|
||||
$recording_exten = '8309';
|
||||
|
||||
$WeBServeRRooT = '/usr/local/apache2/htdocs';
|
||||
$WeBRooTWritablE = '1';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,73 @@
|
||||
--- /usr/src/astguiclient_snapshot_2006-04-10/VICIDIAL_web/admin.php 2006-02-27 15:58:50.000000000 -0800
|
||||
+++ /var/www/html/vicidial/admin.php 2006-04-10 23:12:19.000000000 -0700
|
||||
@@ -3320,15 +3320,38 @@
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
- $rowx=mysql_fetch_row($rsltx);
|
||||
- $leads_in_list = ($leads_in_list + $rowx[2]);
|
||||
+ $rowx=mysql_fetch_row($rsltx);
|
||||
+
|
||||
+ $lead_list['count'] = ($lead_list['count'] + $rowx[2]);
|
||||
+ if ($rowx[1] == 'N')
|
||||
+ {
|
||||
+ $since_reset = 'N';
|
||||
+ $since_resetX = 'Y';
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ $since_reset = 'Y';
|
||||
+ $since_resetX = 'N';
|
||||
+ }
|
||||
+ $lead_list[$since_reset][$rowx[0]] = $rowx[2];
|
||||
+ $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]);
|
||||
+ #If opposite side is not set, it may not in the future so give it a value of zero
|
||||
+ if (!isset($lead_list[$since_resetX][$rowx[0]]))
|
||||
+ {
|
||||
+ $lead_list[$since_resetX][$rowx[0]]=0;
|
||||
+ }
|
||||
+ $o++;
|
||||
+ }
|
||||
|
||||
+ $o=0;
|
||||
+ while (list($dispo,) = each($lead_list[$since_reset]))
|
||||
+ {
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
- if ($rowx[0] == 'CBHOLD')
|
||||
+ if ($dispo == 'CBHOLD')
|
||||
{
|
||||
$CLB="<a href=\"$PHP_SELF?ADD=811&list_id=$list_id\">";
|
||||
$CLE="</a>";
|
||||
@@ -3338,24 +3361,12 @@
|
||||
$CLB='';
|
||||
$CLE='';
|
||||
}
|
||||
-
|
||||
- if ($rowx[1] == 'N')
|
||||
- {
|
||||
- $leads_in_list_N = ($leads_in_list_N + $rowx[2]);
|
||||
- echo "<tr $bgcolor><td><font size=1>$CLB$rowx[0]$CLE</td><td><font size=1> </td><td><font size=1>$rowx[2]</td></tr>\n";
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- $leads_in_list_Y = ($leads_in_list_Y + $rowx[2]);
|
||||
- echo "<tr $bgcolor><td><font size=1>$CLB$rowx[0]$CLE</td><td><font size=1>$rowx[2]</td><td><font size=1> </td></tr>\n";
|
||||
-
|
||||
- }
|
||||
-
|
||||
- $o++;
|
||||
+ echo "<tr $bgcolor><td><font size=1>$CLB$dispo$CLE</td><td><font size=1>".$lead_list['Y'][$dispo]."</td><td><font size=1>".$lead_list['N'][$dispo]." </td></tr>\n";
|
||||
+ $o++;
|
||||
}
|
||||
|
||||
-echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$leads_in_list_Y</td><td><font size=1>$leads_in_list_N</td></tr>\n";
|
||||
-echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=2 align=center><font size=1>$leads_in_list</td></tr>\n";
|
||||
+echo "<tr><td><font size=1>SUBTOTALS</td><td><font size=1>$lead_list[Y_count]</td><td><font size=1>$lead_list[N_count]</td></tr>\n";
|
||||
+echo "<tr bgcolor=\"#9BB9FB\"><td><font size=1>TOTAL</td><td colspan=2 align=center><font size=1>$lead_list[count]</td></tr>\n";
|
||||
|
||||
echo "</table></center><br>\n";
|
||||
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 780 B |
|
After Width: | Height: | Size: 780 B |
|
After Width: | Height: | Size: 886 B |
|
After Width: | Height: | Size: 919 B |
|
After Width: | Height: | Size: 785 B |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 919 B |
|
After Width: | Height: | Size: 781 B |
|
After Width: | Height: | Size: 881 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 459 B |
|
After Width: | Height: | Size: 793 B |
|
After Width: | Height: | Size: 871 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 886 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 928 B |
|
After Width: | Height: | Size: 718 B |
|
After Width: | Height: | Size: 718 B |
|
After Width: | Height: | Size: 596 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 162 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 322 B |
|
After Width: | Height: | Size: 222 B |
|
After Width: | Height: | Size: 217 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 176 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 831 B |
|
After Width: | Height: | Size: 827 B |
|
After Width: | Height: | Size: 914 B |
|
After Width: | Height: | Size: 961 B |
|
After Width: | Height: | Size: 914 B |
|
After Width: | Height: | Size: 965 B |
|
After Width: | Height: | Size: 804 B |
|
After Width: | Height: | Size: 802 B |
|
After Width: | Height: | Size: 827 B |
|
After Width: | Height: | Size: 981 B |
|
After Width: | Height: | Size: 826 B |
|
After Width: | Height: | Size: 985 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 693 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 697 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 601 B |
|
After Width: | Height: | Size: 607 B |
|
After Width: | Height: | Size: 644 B |
|
After Width: | Height: | Size: 830 B |
|
After Width: | Height: | Size: 646 B |
|
After Width: | Height: | Size: 858 B |
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 989 B |
|
After Width: | Height: | Size: 535 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 416 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 394 B |
|
After Width: | Height: | Size: 567 B |
|
After Width: | Height: | Size: 563 B |
|
After Width: | Height: | Size: 563 B |
|
After Width: | Height: | Size: 563 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 90 B |
|
After Width: | Height: | Size: 778 B |
|
After Width: | Height: | Size: 778 B |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 783 B |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 784 B |
|
After Width: | Height: | Size: 758 B |
|
After Width: | Height: | Size: 757 B |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 778 B |
|
After Width: | Height: | Size: 699 B |