diff --git a/docs/conf_examples/extensions.conf.sample-1.4 b/docs/conf_examples/extensions.conf.sample-1.4 index 84a8fe96..9a78e4f0 100644 --- a/docs/conf_examples/extensions.conf.sample-1.4 +++ b/docs/conf_examples/extensions.conf.sample-1.4 @@ -15,6 +15,7 @@ SIPtrunk=SIP/1234:PASSWORD@sip.provider.net ; SIP trunk [trunkinbound] ; DID call routing process +; exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):1}) ; removes first leading character from inbound callerid exten => _X.,1,AGI(agi-DID_route.agi) ; FastAGI for VICIDIAL/astGUIclient call logging diff --git a/www/vicidial/AST_VICIDIAL_ingrouplist.php b/www/vicidial/AST_VICIDIAL_ingrouplist.php index 328add27..8ba9630d 100644 --- a/www/vicidial/AST_VICIDIAL_ingrouplist.php +++ b/www/vicidial/AST_VICIDIAL_ingrouplist.php @@ -128,8 +128,8 @@ else ############################## - ######### AGENT STATS - + ######### LIVE AGENT STATS + $user_list='|'; echo "\n"; echo "---------- LIVE AGENTS IN IN-GROUP\n"; echo "+------+--------------------------------+----------------------+--------+---------------------+\n"; @@ -153,11 +153,55 @@ else $campaign_id = sprintf("%-8s", $row[2]); $status = sprintf("%-6s", $row[3]); $time = sprintf("%-19s", $row[4]); + $user_list .= "$row[0]---$row[3]|"; echo "| $FMT_i | $user | $campaign_id Real-Time | $status | $time |\n"; } echo "+------+--------------------------------+----------------------+--------+---------------------+\n"; + + + if ($DB) {echo "\n$user_list\n";} + + ############################## + ######### ALL AGENT STATS + + echo "\n"; + echo "---------- DEFAULT AGENTS IN IN-GROUP\n"; + echo "+------+--------------------------------+-----------+\n"; + echo "| # | USER | LOGGED IN |\n"; + echo "+------+--------------------------------+-----------+\n"; + + $stmt="select vu.user,vu.full_name from vicidial_users vu where vu.closer_campaigns LIKE\"% " . mysql_real_escape_string($group) . " %\" order by vu.user limit 2000;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $Xusers_to_print = mysql_num_rows($rslt); + $i=0; + while ($i < $Xusers_to_print) + { + $row=mysql_fetch_row($rslt); + + $i++; + + $FMT_i = sprintf("%-4s", $i); + $user = sprintf("%-30s", "$row[0] - $row[1]"); + while(strlen($user)>30) {$user = substr("$user", 0, -1);} + if (preg_match("/\|$row[0]---/",$user_list)) + { + $userstatusARY = explode("|$row[0]---",$user_list); + $userstatus = explode('|',$userstatusARY[1]); + $status_line = sprintf("%-9s", $userstatus[0]); + + if ($DB) {echo "\n$user_list |$row[0]--- $userstatusARY[1] $userstatus[0]\n";} + } + else + {$status_line = ' ';} + + echo "| $FMT_i | $user | $status_line |\n"; + } + + echo "+------+--------------------------------+-----------+\n"; + } diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index 1adc47b0..5cba1b9e 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -1166,10 +1166,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; diff --git a/www/vicidial/callcard_admin.php b/www/vicidial/callcard_admin.php index 9d961db7..cf74d20d 100644 --- a/www/vicidial/callcard_admin.php +++ b/www/vicidial/callcard_admin.php @@ -35,6 +35,10 @@ if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];} elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["total"])) {$total=$_GET["total"];} + elseif (isset($_POST["total"])) {$total=$_POST["total"];} +if (isset($_GET["comment"])) {$comment=$_GET["comment"];} + elseif (isset($_POST["comment"])) {$comment=$_POST["comment"];} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} @@ -535,6 +539,135 @@ if ($action == "CALLCARD_BATCHES") +### BEGIN generate results +if ($action == "GENERATE_RESULTS") + { + if ( (strlen($sequence) < 1) or (strlen($batch) < 1) or (strlen($run) < 1) or (strlen($total) < 1) ) + { + echo "you must enter in all fields

\n"; + $action = 'GENERATE'; + } + else + { + echo "
\n"; + echo ""; + echo "
CallCard GENERATE:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $i=0; + $Gbatch=1; + $Gbatch_count=0; + $Gsequence=0; + while ($i < $total) + { + $Gbatch_count++; + $Gsequence++; + if ($Gbatch_count > $batch) + { + $Gbatch_count = 0; + $Gbatch++; + } + + $Pbatch = sprintf("%05s", $Gbatch); + $Psequence = sprintf("%05s", $Gsequence); + $Pcard_id = "$run-$Pbatch-$Psequence"; + + $stmt = "SELECT count(*) FROM callcard_accounts_details where card_id='$Pcard_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vt_ct = mysql_num_rows($rslt); + if ($vt_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_count = $row[0]; + if ($duplicate_count < 1) + { + $duplicate_pin=1; + $pin_give_up=0; + while ( ($duplicate_pin > 0) and ($pin_give_up < 100000) ) + { + $Ppin = rand(10000000, 99999999); + $stmt = "SELECT count(*) FROM callcard_accounts where pin='$Ppin';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $pin_ct = mysql_num_rows($rslt); + if ($pin_ct > 0) + { + $row=mysql_fetch_row($rslt); + $duplicate_pin = $row[0]; + } + else + { + echo "ERROR - cannot query system
\n"; + } + $pin_give_up++; + } + + ### insert card_id and pin into tables + $stmt="INSERT INTO callcard_accounts SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE';"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',pin='$Ppin',status='GENERATE';"; + $rslt=mysql_query($stmt, $link); + + if (eregi("1$|3$|5$|7$|9$", $i)) + {$bgcolor='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#B9CBFD"';} + echo "\n"; + echo ""; + echo ""; + echo "\n"; + } + else + { + echo "ERROR - card_id already exists: $Pcard_id
\n"; + } + } + else + { + echo "ERROR - cannot query system
\n"; + } + $i++; + } + echo "
CARD IDPIN
$Pcard_id $Ppin


\n"; + + echo "\n"; + echo "
\n"; + } + } +### END generate results + + + +### GENERATE search +if ($action == "GENERATE") + { + echo "
\n"; + echo ""; + + echo "
CallCard Generate IDs
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Generate Comment:
Run:
Batch:
Sequence:
Total:
\n"; + echo "\n"; + echo "\n"; + } +### GENERATE search + + + ### BEGIN search results if ($action == "SEARCH_RESULTS") { @@ -629,6 +762,7 @@ if ($action == "SEARCH_RESULTS") ### END search results + ### BEGIN search if ($action == "SEARCH") {