PHP code example of peoplefone / provisioning-rpc

1. Go to this page and download the library: Download peoplefone/provisioning-rpc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

peoplefone / provisioning-rpc example snippets



use \Peoplefone\ProvisioningRPC;
use \Peoplefone\ProvisioningRPCResult;

$rpc = ProvisioningRPC::connect('manufacturer', ['username','password']);

$result = $rpc->checkPhone("123456ABCDEF");
$result = $rpc->addPhone("123456ABCDEF", "https://provisioningserver.domain.com", true);
$result = $rpc->removePhone("123456ABCDEF");

Peoplefone\ProvisioningRPCResult Object
(
    [mac] => string
    [result] => bool
    [code] => int
    [message] => string
)

checkPhone(string $mac) : ProvisioningRPCResult

addPhone(string $mac, string $url, bool $overwrite) : ProvisioningRPCResult

removePhone(string $mac) : ProvisioningRPCResult

$login_data = ['username','password'];

$rpc = ProvisioningRPC::connect('auerswald', $login_data);

$result = $rpc->checkPhone("123456ABCDEF");
$result = $rpc->addPhone("123456ABCDEF", "https://provisioningserver.domain.com/<MACADR>/", true);
$result = $rpc->removePhone("123456ABCDEF");

$login_data = ['username','password'];

$rpc = ProvisioningRPC::connect('gigaset', $login_data);
$rpc->setProfileName('profile_name'); // default = peoplefone

$result = $rpc->checkPhone("123456ABCDEF-1234");
$result = $rpc->addPhone("123456ABCDEF-1234", "https://provisioningserver.domain.com/%MACD/%DVID/", true);
$result = $rpc->removePhone("123456ABCDEF-1234");

$login_data = ['username','password'];

$rpc = ProvisioningRPC::connect('panasonic', $login_data);

$result = $rpc->checkPhone("123456ABCDEF");
$result = $rpc->addPhone("123456ABCDEF", "https://provisioningserver.domain.com/{MAC}/", true);
$result = $rpc->removePhone("123456ABCDEF");

$login_data = ['username','password'];

$rpc = ProvisioningRPC::connect('snom', $login_data);

$result = $rpc->checkPhone("123456ABCDEF");
$result = $rpc->addPhone("123456ABCDEF", "https://provisioningserver.domain.com/{mac}/", true);
$result = $rpc->removePhone("123456ABCDEF");

$login_data = ['username','password'];

$rpc = ProvisioningRPC::connect('yealink', $login_data);

$result = $rpc->checkPhone("123456ABCDEF");
$result = $rpc->addPhone("123456ABCDEF", "configured_server_name", true);
$result = $rpc->removePhone("123456ABCDEF");