Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8926205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:54:44+00:00 2026-06-15T07:54:44+00:00

I’m using PHP to GET availability data about 80 Users from a CallCenter. I

  • 0

I’m using PHP to GET availability data about 80 Users from a CallCenter. I hope to query the CallCenter for the status/availability of each user every 5 seconds and display the results on a Dashboard.

The CallCenter can only be queried via URL for one user at a time and the username is in the url (so the url is not constant). The answer from the CallCenter is in an XML page. I have been using fopen() to read the content of the url / XML as this is always a random generated XML name and thus the query url is pointed to a directory, not the exact xml url.

I have everything working with a foreach loop, where a unique url is used for USER001 and the content of the XML page is read and a variable is updated. Demo code:

User array:

$users = array( 
        "username" => array("fullname" => "Full Name",
                            "status" => ""  
                            ),
        "username" => array("fullname" => "Full Name",
                            "status" => "")
                );

Foreach Loop:

foreach($users as $username => $userstatus) {
$url = 'http://'.$username.':PasswordForUser@serveraddress.com:80/callcenter/'.$username.'/services/callcenter/';
$get = fopen($url, "r");
    if ($get) {
        while (!feof($get)) {
            $status = fgets($get, 4096);
        }
        fclose($get);
    }
if(strpos($status, 'Available')) { $users[$username]["status"] = "Available"; } else { $users[$username]["status"] = "Offline"; }

}

The issue:
I have a jquery script that refreshes the dashboard every 5 seconds and thus every 5 seconds the CallCenter server is queried of all the Users.

This works, BUT the query actually takes over 1 minute to finish the loop and return all the results to the Dashboard page. It is vital that the CallCenter users can see how many users / agents are available at the given time so they know if enough agents are available to handle the CallCenter load.

Possible solution:
What would be the best solution for my case?

What I have thought of is to create a PHP page for each USER. Have a CRONJOB that runs the pages every x hours (to refresh) and a script on the page that loops through the XML query to the CallCenter every 5 seconds. In the end of each loop (every 5 seconds) the user status is sent to and updates a collector page. Every user page sends the results to the collector page and then the Dashboard page fetshes the data to the collector page every 5 seconds.

Is this a “smart” solution? What would you recommend and how would you code it?
(I´m a PHP begginer)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:54:46+00:00Added an answer on June 15, 2026 at 7:54 am

    Just wanted to thank all users that replied. I don´t think there is good solution for my questions with this approach, so I ended with going for as I suggested in the initial post. I created multiple pages that run every 1 minute with a cronjob and collect data. Then other pages fetch the data every x seconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.