nophaa / php-sipwise-api
Sipwise API client
1.0.4
2018-10-28 15:11 UTC
Requires
- php: ^5.6 || ^7.0
- ext-xml: *
- php-http/cache-plugin: ^1.4
- php-http/client-common: ^1.6
- php-http/discovery: ^1.4
- php-http/guzzle6-adapter: ^1.1
- php-http/httplug: ^1.1
- php-http/multipart-stream-builder: ^1.0
- psr/cache: ^1.0
- symfony/options-resolver: ^2.6 || ^3.0
Requires (Dev)
- donatj/mock-webserver: ^2.0
- guzzlehttp/psr7: ^1.4
- php-http/guzzle6-adapter: ^1.1
- php-http/mock-client: ^1.0
- phpunit/php-invoker: ^1.1
- phpunit/phpunit: ^6.0
README
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.
Requirements
- PHP >= 5.6
- A HTTP client
- A PSR-7 implementation
- A Guzzle http client for custom http client
- (optional) PHPUnit to run tests.
Install
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.
Basic usage of php-sipwise-api
client
<?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 Sipwise Vagrant
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
License
php-sipwise-api
is licensed under the MIT License - see the LICENSE file for details