-
Notifications
You must be signed in to change notification settings - Fork 282
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
verifies $response type #61
verifies $response type #61
Conversation
@@ -282,7 +282,11 @@ public function process() | |||
$bMsg .= 'ActionId: ' . $this->_lastActionId . "\r\n" . $aMsg; | |||
$event = $this->_messageToEvent($bMsg); | |||
$response = $this->findResponse($event); | |||
$response->addEvent($event); | |||
if ($response === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi :) Could you give a use case? When/Why is this happening? What event(s) and asterisk version(s)? Could you paste the raw events (and actions) that cause this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi - Honestly I would need some time to collect more details, but I've just noticed that an application I've built that uses your library throws this error by time to time
E_ERROR: Call to a member function addEvent() on a non-object
this is a portion of the stack trace
…ses/20150331120320/vendor/marcelog/pami/src/mg/PAMI/Client/Impl/ClientImpl.php (285)
…ses/20150331120320/vendor/marcelog/pami/src/mg/PAMI/Client/Impl/ClientImpl.php (410)
…150331120320/src/Facile/Ws/BunnyBundle/Controller/Utils/AsteriskController.php (110)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok, take your time. I'm interested in knowing if this is just a bug in pami, or a strange asterisk behavior, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there anything in particular that I can check for you? I'm not very familiar with your library and asterisk protocol, I've just noticed few errors here and there and I decided to contribute back with this fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly what I mentioned earlier, which basically reduces to how to reproduce this behavior, including the asterisk version, action(s) sent (if any), and events/responses that produce this behavior.
I will comment on this and say I encountered the same issue; reproducible sending QueuesAction on asterisk 11. This PR does address the exception as the function The comments above do say:
so I'm not sure what the proper way to handle this scenario |
Hi @StrikeForceZero, Could you confirm this is the issue you're experiencing? https://issues.asterisk.org/jira/browse/ASTERISK-23821 |
ah... yup that would be it Testing Queues Action
Testing Reload Action
Testing QueueStatus
|
Thanks for the confirmation.. Unfortunately it seems we should wait until Digium fixes it. Going to close this one, but please feel free to come back and report any progress! |
In the meantime maybe the best route would be to tweak @bits4breakfast PR to throw an Exception that the user can optionally catch? That would allow the user to determine what to do instead of being fatal. @marcelog your thoughts? |
mmm This line here https://github.com/marcelog/PAMI/blob/master/src/mg/PAMI/Client/Impl/ClientImpl.php#L283 should "automagically" add the action id and the response should exists.. Could you do a few tests? For example dumping |
By the way, note how the response does not match the AMI protocol:
This is a similar issue to #88 so I don't see a right way of handling it, the response is just not respecting the AMI format for the event and response.
|
dumping action id: null
action id: 1444139694.8284
[All the queues...]
So yes, it appears its adding the ActionID |
you are right as far as QueueStatus being the way to go. Maybe it wouldn't be bad to deprecate Queue Action and suggest QueueStatus for more consistent/reliable behavior across different versions of Asterisk. |
ensures that response from ClientImpl::findResponse() is PAMI\Message\Response or false before calling PAMI\Message\Response::addEvent()