PHP library for handling Adescom system API using SOAP protocol.
composer require xsme/php-api-adescom
The library supports three different SOAP endpoints:
- Frontend - for managing clients and numbers
- Platform - for platform operations and billing
- Userpanel - for user panel operations
use xsme\Adescom\AdecomApi;
$api = new AdecomApi();
// Frontend configuration
$api->setFrontend($wsdl, $location, $login, $password);
// Platform configuration
$api->setPlatform($wsdl, $location, $login, $password);
// Userpanel configuration
$api->setUserpanel($wsdl, $location, $login, $password);
Returns the PBX version.
$version = $api->getVersion();
Returns a list of all numbers.
$clids = $api->getClids();
Returns information about a specific callerID number.
$clid = $api->getClid('123456789');
Returns the status of a callerID number.
$status = $api->getClidStatus('123456789');
Returns statuses for multiple callerID numbers.
$statuses = $api->getClidsStatus(['123456789', '987654321']);
Deletes a callerID number with optional date and time after which the number returns to the free numbers pool.
// Delete with default grace period
$result = $api->deleteClid('123456789');
// Delete with specific grace period
$dateTime = new DateTime('2025-12-31 23:59:59');
$result = $api->deleteClid('123456789', $dateTime);
Returns a list of available number pools for the reseller.
$pools = $api->getPools();
Returns a list of number pools.
$numberPools = $api->getNumberPools();
Returns information about a specific number pool.
$pool = $api->getNumberPool(1);
Returns a list of free numbers from the pool.
$freeNumbers = $api->getFreeNumbersFromPool(1);
Returns the first free number from the pool.
$firstFree = $api->getFirstFreeNumberFromPool(1);
Returns a list of phones.
$phones = $api->getPhones();
Returns information about a specific phone.
$phone = $api->getPhone(1);
Returns a list of all clients.
$clients = $api->getClients();
Returns information about a specific client.
$client = $api->getClient(1);
Returns a client by external ID.
$client = $api->getClientByExternalId('EXT123');
Returns a list of numbers for a specific client.
$clids = $api->getClidsForClient(1);
Returns a list of numbers for a client by external ID.
$clids = $api->getClidsForClientByExternalId('EXT123');
getBillingByCallerID(DateTime $fromDate, DateTime $toDate, string $callerId, bool $includeZeroDuration = false, $typeSet = 1, int $directionSet = 1): stdClass
Returns billing records for the specified callerID number in the given time period.
Parameters:
$fromDate
- start date$toDate
- end date$callerId
- callerID number$includeZeroDuration
- whether to include calls with zero duration$typeSet
- set type (default 1)$directionSet
- call direction (1 or 2)
$fromDate = new DateTime('2025-01-01 00:00:00');
$toDate = new DateTime('2025-01-31 23:59:59');
$billing = $api->getBillingByCallerID($fromDate, $toDate, '123456789', true, 1, 1);
getBillingSummaryByCallerID(DateTime $fromDate, DateTime $toDate, string $calledId, bool $includeZeroDuration = false, $typeSet = 1, int $directionSet = 1): stdClass
Returns a summary of billing records for the specified callerID number in the given time period.
Parameters identical to getBillingByCallerID
$fromDate = new DateTime('2025-01-01 00:00:00');
$toDate = new DateTime('2025-01-31 23:59:59');
$summary = $api->getBillingSummaryByCallerID($fromDate, $toDate, '123456789', true, 1, 1);
<?php
require_once 'vendor/autoload.php';
use xsme\Adescom\AdecomApi;
use DateTime;
$api = new AdecomApi();
// Connection configuration
$api->setFrontend('https://example.com/frontend.wsdl', 'https://example.com/frontend', 'login', 'password');
$api->setPlatform('https://example.com/platform.wsdl', 'https://example.com/platform', 'login', 'password');
// Get system version
$version = $api->getVersion();
echo "System version: " . $version . "\n";
// Get list of numbers
$clids = $api->getClids();
print_r($clids);
// Get billing for a number
$fromDate = new DateTime('2025-01-01');
$toDate = new DateTime('2025-01-31');
$billing = $api->getBillingByCallerID($fromDate, $toDate, '123456789');
print_r($billing);
- PHP 7.4 or higher
- SOAP extension
- OpenSSL extension (for HTTPS connections)
MIT License