My packagist profile is here.
opiy-org / asterisk-ari-php Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
My packagist profile is here.
No rights to commit
interface StasisApplicationInterface
{
public const APPLICATION_NAME = null;
}
public function onConnectionHandlerLogic(): void
{
$myAppAsReflectionObject = new ReflectionObject($this->stasisApplication);
$myAppPublicClassMethodNames =
$this->extractPublicMethodNames($myAppAsReflectionObject);
// Only use methods, that are named after a valid Asterisk event type
$allowedEvents =
$this->extractHandledAsteriskEvents($myAppPublicClassMethodNames);
$applicationName = $this->stasisApplication::APPLICATION_NAME ?? $myAppAsReflectionObject->getShortName();
/**
* Tell Asterisk to only send events that are actually handled by the
* given StasisApplicationInterface. This boosts the performance a lot.
* @see https://blogs.asterisk.org/2019/02/27/filtering-event-types-ari/
*/
$this->ariApplicationsClient->filter($applicationName, $allowedEvents);
if ($this->isInDebugMode) {
$this->logger->debug(
'Successfully set event filter for app in Asterisk',
[__FUNCTION__]
);
}
$infoMessage = sprintf(
"Your Stasis app '%s' listens for the following events: '%s'",
$applicationName,
print_r($allowedEvents, true)
);
$this->logger->info($infoMessage);
}
When running command:
composer require opiy-org/asterisk-ari-client
It is throwing error:
Could not find a matching version of package opiy-org/asterisk-ari-client. Check the package spelling, your version
constraint and that the package is available in a stability which matches your minimum-stability (dev).
I got error while install in PHP 8.0
./composer.json has been created
Running composer update opiy-org/asterisk-ari-php
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires opiy-org/asterisk-ari-php 2 -> satisfiable by opiy-org/asterisk-ari-php[2.0].
- opiy-org/asterisk-ari-php 2.0 requires cuyz/valinor dev-master -> found cuyz/valinor[dev-master] but it does not match your minimum-stability.
Installation failed, deleting ./composer.json.
After launching example I got error
# php -f .\vendor\opiy-org\asterisk-ari-php\example\my_example_stasis_app_worker.php
[2023-02-02T09:57:29.816661+03:00] OpiyOrg\AriClient\Client\WebSocket\Ratchet\WebSocketClient.ERROR: ARI Connection error | Code -> '10061' | Event -> 'Connection to tcp://127.0.0.1:8088 failed: No connection could be made because the target machine actively refused it (ECONNREFUSED)' ["OpiyOrg\\AriClient\\Client\\WebSocket\\Ratchet\\{closure}"] []
My asterisk is running on my-domain.com. I suppose websocket client trying to connect to localhost by default.
How to change ARI host ?
Hi, this is the error that pops up
OpiyOrg\AriClient\Client\WebSocket\Ratchet\WebSocketClient.ERROR: Error while handling 'Mapping incoming JSON from ARI web socket server onto object 'OpiyOrg\AriClient\Model\Message\Event\ChannelDialplan' failed | Error message: 'Undefined property: OpiyOrg\AriClient\Client\WebSocket\Ratchet\WebSocketClient::$dataMappingService'' -------> 'Undefined property: OpiyOrg\AriClient\Client\WebSocket\Ratchet\WebSocketClient::$dataMappingService'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.