Number of queued calls

You can find out the number of queued calls by sending following parameters within a POST request to https://voice.africastalking.com/queueStatus:

Parameter Description
username
String
Required
Your Africa's Talking application username.
phoneNumbers
String
Required
A comma separated list of one or more numbers mapped to your Africa's Talking account.

API Response

The API will respond with a JSON object like the one below.

{
    "status": "Success",
    "entries": [
        {
            "phoneNumber": "+254XXXYYYZZZ",
            "queueName": "",
            "numCalls": 1
        },
        {
            "phoneNumber": "+254XXXYYYZZZ",
            "queueName": "support",
            "numCalls": 3
        },
        {
            "phoneNumber": "+234XXXYYYZZZZ",
            "queueName": "sales",
            "numCalls": 1
        }
    ],
    "errorMessage": "None"
}

Fetch queued calls sample code

The PHP code snippet below shows how you can get the number of queued calls on your Africa's Talking phone number.

The code uses our PHP SDK.

<?php
require 'vendor/autoload.php';
use AfricasTalking\SDK\AfricasTalking;

// Set your app credentials
$username = "MyAppUsername";
$apikey   = "MyAppAPIKey";

// Initialize the SDK
$AT       = new AfricasTalking($username, $apiKey);

// Get the voice service
$voice    = $AT->voice();

// Set your Africa's Talking phone number in international format
$phoneNumber = "+254711082XXX";

try {
    // Fetch the queue
    $results = $voice->fetchQueuedCalls([
        "phoneNumber" => $phoneNumber
    ]);

    print_r($results);
} catch (Exception $e) {
    echo "Error: ".$e->getMessage();
}