A simple Object Oriented wrapper for Sipwise Server API, written with PHP.
Tested with Sipwise version mr6.4.1, and for testing you can use vagrant file include in the repo. For more information about sipwise server you can go to http://sipwise.com.
- PHP >= 5.6
- A HTTP client
- A PSR-7 implementation
- A Guzzle http client for custom http client
- (optional) PHPUnit to run tests.
Via Composer:
$ composer require nophaa/php-sipwise-api php-http/guzzle6-adapter
Why php-http/guzzle6-adapter
? We are decoupled from any HTTP messaging client with help by HTTPlug. Read about clients in our docs.
<?php
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';
$client = new \Sipwise\Client();
$adapter = Http\Adapter\Guzzle6\Client::createWithConfig(['verify'=>false]);
$apiClient = Sipwise\Client::createWithHttpClient($adapter);
$apiClient->authenticate('username','password');
$apiClient->setUrl('https://127.0.0.1:1443');
$apiClient->api('subscriber')->all(['username' => xxx]);
From $apiClient
object, you can access sipwise api.
using Vagrant file you can run sipwise server
$ vagrant up
to remote the server
vagrant ssh
shutdown sipwise vagrant server
vagrant halt
sipwise api by default run in port 1443
php-sipwise-api
is licensed under the MIT License - see the LICENSE file for details