marcelog / PAMI

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
402 stars 281 forks source link

Read timeout in ClientImpl.php on line 422 because of ResponseMessage being considered as a List #182

Open kettenbach-it opened 5 years ago

kettenbach-it commented 5 years ago

If you run:

$response = $pamiClient->send(new CommandAction('database show blacklist', ''));

you'll get a read timeout in ClientImpl.php on line 422.

The reason is that in PAMI\Message\Response\ResponseMessage.php in line 137 the response of asterisk to the "database show ...." contains the string "Message: Command output follows" and there is considered as a list while it's only some raw output. The message is therefore not considered completed and "getRelated()" won't return anything and therefore send() will time out.

This seems to be a bug. I thin it's to greedy to scan the message for the word "follow" since this could be in any kind of message.

alexpts commented 4 years ago

+1 @marcelog can you fix it?

vovizzz commented 4 years ago

+1