Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logoff action #35

Closed
yegortokmakov opened this issue Aug 18, 2012 · 4 comments
Closed

Logoff action #35

yegortokmakov opened this issue Aug 18, 2012 · 4 comments

Comments

@yegortokmakov
Copy link

Logoff action causes exception "Error reading" from file PAMI/Client/Impl/ClientImpl.php in function getMessages.
It is because in

            if ($read === false || feof($this->_socket)) {
                throw new ClientException('Error reading');
            }

feof() is true.
last message from AMI is:

string(83) "Response: Goodbye
ActionID: 1345305085.9158
Message: Thanks for all the fish.

"

please, help me with tha issue.

now I have to do

            try{
                $pamiClient->close();  
            }catch (Exception $e) {}
@marcelog
Copy link
Owner

Hello Yegor, thanks for the feedback!

Are you sure you are not somehow calling $pamiClient->process() after closing? Because that's the only way that I can reproduce this (i.e: If I dont call process() after close(), I dont get the exception)

@yegortokmakov
Copy link
Author

Hello, Marcelo!
Thank you for your development.
No, close() is he last action I do. Tomorrow I will send you peace of my
code so we can look throw it.

2012/8/18 Marcelo Gornstein notifications@github.com

Hello Yegor, thanks for the feedback!

Are you sure you are not somehow calling $pamiClient->process() _after_closing? Because that's the only way that I can reproduce this (i.e: If I
dont call process() after close(), I dont get the exception)


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-7846642.

@clinttepe
Copy link

I am also having this issue with recently installed PAMI, Asterisk 1.8.10.1, and PHP 5.3.10-1ubuntu3.18 (yes I read the README and applied the fix for the issue described). The generated error comes from ClientImpl.php:236

First part of my stack trace:

object(PAMI\Message\Event\FullyBootedEvent)#6 (5) { ["rawContent":protected]=> string(63) "Event: FullyBooted Privilege: system,all Status: Fully Booted" ["lines":protected]=> array(0) { } ["variables":protected]=> array(0) { } ["keys":protected]=> array(3) { ["event"]=> string(11) "FullyBooted" ["privilege"]=> string(10) "system,all" ["status"]=> string(12) "Fully Booted" } ["createdDate":protected]=> int(1434031315) } object(PAMI\Message\Event\PeerStatusEvent)#5 (5) { ["rawContent":protected]=> string(126) "Event: PeerStatus Privilege: system,all ChannelType: SIP Peer: SIP/205 PeerStatus: Registered Address:

@clinttepe
Copy link

Tried another server (PHP 5.5.12 and Asterisk 11.11.0) and got similar results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants