chan-sccp / PAMI

Fork of PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
http://marcelog.github.com/PAMI
Apache License 2.0
27 stars 21 forks source link

Error Reading #23

Open VijeshDatt opened 2 years ago

VijeshDatt commented 2 years ago

Not really sure what is causing this issue:

` PAMI\Client\Exception\ClientException

Error reading

at C:\xampp\htdocs\source\vendor\chan-sccp\pami\src\PAMI\Client\Impl\ClientImpl.php:292 288▕ // Read something. 289▕ //$read = @fread($this->socket, 65535); 290▕ $read = @fread($this->socket, 8192); 291▕ if ($read === false || (empty($read) && @feof($this->socket))) { ➜ 292▕ throw new ClientException('Error reading'); 293▕ } 294▕ $this->currentProcessingMessage .= $read; 295▕ // If we have a complete message, then return it. Save the rest for 296▕ // later.

1 C:\xampp\htdocs\source\vendor\chan-sccp\pami\src\PAMI\Client\Impl\ClientImpl.php:316 PAMI\Client\Impl\ClientImpl::getMessages()

2 C:\xampp\htdocs\source\app\Console\Commands\SyncAsteriskNSW.php:129 PAMI\Client\Impl\ClientImpl::process()`

I don't know if this is because of a PHP update? Previous version was PHP 7.4 which worked fine. Now that I'm on PHP 8.1.2 with Laravel 9, keep getting this error when trying to connect.

Please help

dkgroot commented 2 years ago

I will have to run a couple of tests to see what is going on there.

VijeshDatt commented 2 years ago

Hey @dkgroot, Just to give you a small heads up. Using this package over the base PAMI has one more bug, it's slower at reading/writing.

To give some context, I am running the PAMI listeners against 3 Ast servers, each server gives me a message every 10 milliseconds. The base PAMI package works flawlessly with this setup but when using your package, the messages are delayed, as though a function is taking forever to load, however I tried debugging and couldn't figure out which method/function it was, maybe you can verify?

colinwebdev commented 2 months ago

Was there ever a resolution to this? I am running into the same issue and cannot find a means around it.