PHPackages                             xsme/php-api-adescom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xsme/php-api-adescom

ActiveLibrary[API Development](/categories/api)

xsme/php-api-adescom
====================

PHP library for communication with Adescom PBX system via SOAP API

v1.1(10mo ago)02MITPHPPHP &gt;=7.4

Since Jun 30Pushed 10mo agoCompare

[ Source](https://github.com/xsme/php-api-adescom)[ Packagist](https://packagist.org/packages/xsme/php-api-adescom)[ Docs](https://github.com/xsme/php-api-adescom)[ RSS](/packages/xsme-php-api-adescom/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

PHP API Adescom
===============

[](#php-api-adescom)

PHP library for handling Adescom system API using SOAP protocol.

Installation
------------

[](#installation)

```
composer require xsme/php-api-adescom
```

Configuration
-------------

[](#configuration)

The library supports three different SOAP endpoints:

- **Frontend** - for managing clients and numbers
- **Platform** - for platform operations and billing
- **Userpanel** - for user panel operations

### Initialization

[](#initialization)

```
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);
```

Available methods
-----------------

[](#available-methods)

### System information

[](#system-information)

#### `getVersion(): string`

[](#getversion-string)

Returns the PBX version.

```
$version = $api->getVersion();
```

### Number management (CLID)

[](#number-management-clid)

#### `getClids(): stdClass`

[](#getclids-stdclass)

Returns a list of all numbers.

```
$clids = $api->getClids();
```

#### `getClid(string $callerId): stdClass`

[](#getclidstring-callerid-stdclass)

Returns information about a specific callerID number.

```
$clid = $api->getClid('123456789');
```

#### `getClidStatus(string $callerId): stdClass`

[](#getclidstatusstring-callerid-stdclass)

Returns the status of a callerID number.

```
$status = $api->getClidStatus('123456789');
```

#### `getClidsStatus(array $callerIds): stdClass`

[](#getclidsstatusarray-callerids-stdclass)

Returns statuses for multiple callerID numbers.

```
$statuses = $api->getClidsStatus(['123456789', '987654321']);
```

#### `deleteClid(string $callerId, ?DateTime $dateTime = null): stdClass`

[](#deleteclidstring-callerid-datetime-datetime--null-stdclass)

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);
```

### Number pool management

[](#number-pool-management)

#### `getPools(): stdClass`

[](#getpools-stdclass)

Returns a list of available number pools for the reseller.

```
$pools = $api->getPools();
```

#### `getNumberPools(): stdClass`

[](#getnumberpools-stdclass)

Returns a list of number pools.

```
$numberPools = $api->getNumberPools();
```

#### `getNumberPool(int $id): stdClass`

[](#getnumberpoolint-id-stdclass)

Returns information about a specific number pool.

```
$pool = $api->getNumberPool(1);
```

#### `getFreeNumbersFromPool(int $id): stdClass`

[](#getfreenumbersfrompoolint-id-stdclass)

Returns a list of free numbers from the pool.

```
$freeNumbers = $api->getFreeNumbersFromPool(1);
```

#### `getFirstFreeNumberFromPool(int $id): stdClass`

[](#getfirstfreenumberfrompoolint-id-stdclass)

Returns the first free number from the pool.

```
$firstFree = $api->getFirstFreeNumberFromPool(1);
```

### Phone management

[](#phone-management)

#### `getPhones(): stdClass`

[](#getphones-stdclass)

Returns a list of phones.

```
$phones = $api->getPhones();
```

#### `getPhone(int $id): stdClass`

[](#getphoneint-id-stdclass)

Returns information about a specific phone.

```
$phone = $api->getPhone(1);
```

### Client management

[](#client-management)

#### `getClients(): stdClass`

[](#getclients-stdclass)

Returns a list of all clients.

```
$clients = $api->getClients();
```

#### `getClient(int $id): stdClass`

[](#getclientint-id-stdclass)

Returns information about a specific client.

```
$client = $api->getClient(1);
```

#### `getClientByExternalId(string $externalID): stdClass`

[](#getclientbyexternalidstring-externalid-stdclass)

Returns a client by external ID.

```
$client = $api->getClientByExternalId('EXT123');
```

#### `getClidsForClient(int $clientId): stdClass`

[](#getclidsforclientint-clientid-stdclass)

Returns a list of numbers for a specific client.

```
$clids = $api->getClidsForClient(1);
```

#### `getClidsForClientByExternalId(string $externalID): stdClass`

[](#getclidsforclientbyexternalidstring-externalid-stdclass)

Returns a list of numbers for a client by external ID.

```
$clids = $api->getClidsForClientByExternalId('EXT123');
```

### Billing and reports

[](#billing-and-reports)

#### `getBillingByCallerID(DateTime $fromDate, DateTime $toDate, string $callerId, bool $includeZeroDuration = false, $typeSet = 1, int $directionSet = 1): stdClass`

[](#getbillingbycalleriddatetime-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`

[](#getbillingsummarybycalleriddatetime-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);
```

Usage example
-------------

[](#usage-example)

```
