orkhanahmadov/sipgate
Composer 安装命令:
composer require orkhanahmadov/sipgate
包简介
PHP library for integrating with sipgate
README 文档
README
Requirements
PHP 7.1 or higher and json extension.
Installation
composer require innoscripta/sipgate
Usage
Initialize Sipgate class:
$sipgate = \Orkhanahmadov\Sipgate\Sipgate();
Basic authentication
You can pass basic authentication username and password when initializing class:
$sipgate = \Orkhanahmadov\Sipgate\Sipgate('example@example.com', 'secret');
Or you can set basic authentication with setBasicAuthCredentials() method:
$sipgate = \Orkhanahmadov\Sipgate\Sipgate(); $sipgate->setBasicAuthCredentials('example@example.com', 'secret');
Account information:
$sipgate->account();
Returns array of account details.
Get users:
$sipgate->users();
Returns array of users registered under account. Each item in array is instance of Orkhanahmadov\Sipgate\Resources\User and has following properties:
$user->id; // string $user->firstname; // string $user->lastname; // string $user->email; // string $user->defaultDevice; // string $user->busyOnBusy; // bool $user->addressId; // string $user->directDialIds; // array $user->admin; // bool
Get user devices:
To get user's devices use devices() method and pass a user instance or user ID.
$sipgate->devices($user); // or $sipgate->devices('ABC-123');
Returns array of devices registered for given user. Each item in array is instance of Orkhanahmadov\Sipgate\Resources\Device and has following properties:
$device->id; // string $device->alias; // string $device->type; // string $device->online; // bool $device->dnd; // bool $device->activePhonelines; // array $device->activeGroups; // array $device->credentials; // array $device->registered; // array $device->emergencyAddressId; // string $device->addressUrl; // string
Active calls:
Use calls() method to get list of currently established calls.
$sipgate->calls();
Returns array of currently established calls. Each item in array is instance of Orkhanahmadov\Sipgate\Resources\Call and has following properties:
$call->id; // string $call->firstname; // string $call->lastname; // string $call->email; // string $call->defaultDevice; // string $call->busyOnBusy; // bool $call->addressId; // string $call->directDialIds; // array $call->admin; // bool
Initiate new call:
Use call() method to initiate a new call. Method accepts 3 parameters:
$device- Accepts instance of device or device ID. This defines which device you want to use to make a call.$callee- Phone number you want to call.$callerId(optional) - Set this parameter if you want to show different number to callee other. When skipped$devicenumber will be used.
$sipgate->call($device, $callee, $callerId);
Returns call's session ID.
Hangup ongoing call:
Use hangup() method to hangup ongoing call. Method accepts call ID as parameter:
$sipgate->hangup('ABC-123');
Record ongoing call:
Use record() method to record ongoing call. Method accepts 3 parameters:
$callId- Unique call ID.$value-trueorfalse, defines start or stop of recording.$announcement-trueorfalse, defines if you want to play announcement about call being recorded.
$sipgate->record($callId, $value, $announcement);
Call history:
Use history() method to get call history. Method accepts array of options:
connectionIds-array, defines list of extensionstypes-array, defines list of types you want to receive in history, might contain one of many of following values: "CALL", "VOICEMAIL", "SMS", "FAX"directions-array, defines list of call directions you want to receive in history, might contain one of many of following values: "INCOMING", "OUTGOING", "MISSED_INCOMING", "MISSED_OUTGOING"archived-bool, settrueif you want to receive only archived history itemsstarred- Defines if you want to receive on starred of unstarred history items, one of these: "STARRED", "UNSTARRED"from- Defines start date of history. Must be in ISO8601 formatto- Defines end date of history. Must be in ISO8601 formatphonenumber- Defines phone number to search in historylimit- Defines "per page" value for history itemsoffset- Defines "offset" value for history items
$sipgate->history(['from' => '2019-07-10T19:32:18Z', 'to' => '2019-07-22T19:32:18Z']);
Returns array of history items. Each item in array is instance of Orkhanahmadov\Sipgate\Resources\History and has following properties:
$history->id; // string $history->source; // string $history->target; // string $history->sourceAlias; // string $history->targetAlias; // string $history->type; // string $history->created; // string $history->lastModified; // string $history->direction; // string $history->incoming; // bool $history->status; // string $history->connectionIds; // array $history->read; // bool $history->archived; // bool $history->note; // string $history->endpoints; // array $history->starred; // bool $history->labels; // array $history->callId; // string $history->recordingUrl; // string $history->recordings; // array $history->duration; // int $history->responder; // string $history->responderAlias; // string
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ahmadov90@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
orkhanahmadov/sipgate 适用场景与选型建议
orkhanahmadov/sipgate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.43k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sip」 「sipgate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 orkhanahmadov/sipgate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 orkhanahmadov/sipgate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 orkhanahmadov/sipgate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP class for Novofon API
Description of project kazoo-php-sdk.
The Civic Secure Identity Platform (SIP) API client.
A library for phone verification via Laravel notification channels. Any notification channel can be used as a sender, and Redis or MongoDB can be used as a storage.
Laravel notifications driver for sipgate.de
Symfony Sipgate Notifier Bridge
统计信息
- 总下载量: 7.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-22