PHP code example of kamrankhosa / laravel-voipnow

1. Go to this page and download the library: Download kamrankhosa/laravel-voipnow 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/ */

    

kamrankhosa / laravel-voipnow example snippets


use VoipNow;

// GET /api/v5/organizations
VoipNow::get('organizations');
VoipNow::get('organizations', ['limit' => 10, 'offset' => 0]);

// POST /api/v5/organizations
VoipNow::post('organizations', ['name' => 'Acme Corp', 'email' => '[email protected]']);

// PUT /api/v5/organizations/42
VoipNow::put('organizations/42', ['name' => 'Acme Corp Updated']);

// PATCH /api/v5/extensions/101
VoipNow::patch('extensions/101', ['display_name' => 'Reception']);

// DELETE /api/v5/organizations/42
VoipNow::delete('organizations/42');

// Paginate: page 2, 25 records per page
VoipNow::paginate('users', page: 2, perPage: 25);

// Fetch single resource by ID
VoipNow::find('organizations', 42);
VoipNow::find('extensions', '101');

VoipNow::GetServiceProviders();
VoipNow::GetOrganizations(['limit' => 50]);
VoipNow::GetOrganizationDetails(['ID' => 42]);
VoipNow::GetOrganizationDetails(['identifier' => 'acme']);
VoipNow::GetUsers();
VoipNow::GetExtensions(['organization_id' => 5]);
VoipNow::GetUserGroups();
VoipNow::GetChargingPlans();
VoipNow::GetPhoneNumbers();
VoipNow::GetCallQueues();
VoipNow::GetIVRs();
VoipNow::GetSounds();
VoipNow::GetCallHistory(['from' => '2024-01-01', 'to' => '2024-01-31']);
VoipNow::GetSystemInfo();

VoipNow::GetFaxes();               // GET  /api/v5/faxes
VoipNow::AddExtensions([...]);     // POST /api/v5/extensions
VoipNow::UpdateUsers([...]);       // PUT  /api/v5/users
VoipNow::RemoveExtensions([...]);  // DELETE /api/v5/extensions

use VoipNowSoap;

// Service Providers
VoipNowSoap::GetServiceProviders();
VoipNowSoap::AddServiceProvider(['name' => 'My SP', 'email' => '[email protected]']);
VoipNowSoap::GetServiceProviderDetails(['identifier' => 'my-sp']);

// Organizations
VoipNowSoap::GetOrganizations();
VoipNowSoap::AddOrganization(['name' => 'Acme', 'serviceProviderIdentifier' => 'my-sp']);
VoipNowSoap::GetOrganizationDetails(['identifier' => 'acme']);
VoipNowSoap::RemoveOrganization(['identifier' => 'acme']);

// Extensions
VoipNowSoap::GetExtensions(['organizationIdentifier' => 'acme']);
VoipNowSoap::AddExtension(['number' => '100', 'name' => 'Reception']);
VoipNowSoap::GetExtensionDetails(['identifier' => '100']);
VoipNowSoap::SetExtensionVoicemail(['identifier' => '100', 'active' => true]);

// Users
VoipNowSoap::GetUsers();
VoipNowSoap::AddUser(['login' => 'john', 'password' => 'secret']);
VoipNowSoap::GetUserDetails(['identifier' => 'john']);

// Billing
VoipNowSoap::GetChargingPlans();
VoipNowSoap::AddChargingPlan(['name' => 'Basic Plan']);
VoipNowSoap::GetCallingCards();

// PBX
VoipNowSoap::GetQueues(['organizationIdentifier' => 'acme']);
VoipNowSoap::GetIVRs(['organizationIdentifier' => 'acme']);
VoipNowSoap::GetConferences();

// Reports
VoipNowSoap::GetCallReport(['from' => '2024-01-01', 'to' => '2024-01-31']);
VoipNowSoap::GetSIPReport();

// Global
VoipNowSoap::GetTimezones();
VoipNowSoap::GetLanguages();

use VoipNow;

VoipNow::soap()->GetOrganizations();
VoipNow::soap()->AddExtension(['number' => '200', 'name' => 'Sales']);
VoipNow::soap()->call('GetExtensionDetails', ['identifier' => '200']);

$soapClient = app('voipnow.soap');
$soapClient->GetServiceProviders();
bash
php artisan vendor:publish --provider="HyderKamran\VoipNow\VoipNowServiceProvider"
bash
php artisan migrate