-
Notifications
You must be signed in to change notification settings - Fork 281
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
Incorrect CommandAction response #88
Comments
I think, that CommandAction response should have a special parser, which would return just plain text with "--END COMMAND--" stripped off from the end. Applying standard parsers may lead to unexpected results till response format may vary significantly. |
Hello, thanks for the report! Mmm it seems that respones actually violates the ami protocol (there's an empty new line after the ActionId key and that marks the end of the message, although that wouldn't be the first inconsistency found so far :P).. What asterisk version is that? @dkgroot How would your new patch handle this case? Looks like a good test case! :) |
Asterisk 11 |
@marcelog: The/your core message parser is still the same (Did not change anything there, as far as i can remember). "--END COMMAND--" does not follow the normal asterisk API for returning multiple values. The problem is that CLI and AMI commands don't use one and the same source/api. That's what we tried to fix in chan-sccp-b (using a whole slew of macro's ;-(). It would have made sense if they would have created a dictionary to assemble the output and then have a generic generator which is able to convert that dictionary to and arbitrairy number of outputs like AMI/CLI (or JSON/XML/Whatever). Alas that's not the case. The have started doing it more like that in asterisk-13. But it would have been better if there was a core design change in both modules. Maybe step one should be to send a patch to make the 'Command' AMI message behave a little better.
I would be able to do just that, by providing a CommandResponse.php parse you would be able to catch this response and parse it seperately. The problem with the commandresponse is that the content is completely unstructured (namely cli output which can come in any number of formats), so i am not sure how much use it will be. In my opinion the Command AMI Message should never have been included in AMI, which would have prevented developers from depending on it, causing them to create specific AMI Commands to get the Data out in a structured way. BTW: For this 'command' you could/should have used ExtensionStateList and DeviceStateList, instead. |
These commands are not available in Asterisk 11 - https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Actions. As far as I know (i am new to Asterisk) - I could only use SIPpeers action, but it depends on "sip reload", which makes it inaccurate in some cases.
May be in latest Asterisk it os not so use usefull and really makes so mess, but in older versions it is not, as there are much less actions available. |
Hi Dmitry, On 19-09-15 04:19, Dmitry wrote:
BTW: You do have ExtensionState and PresenceState in Asterisk-11, Does that not contain the information you need, or is it only the list you are after ?
|
Thanks for your feedback guys. Unfortunately, I don't see a nice way to implement this in the short term, sorry. Closing this one for now. |
Update Tests to Reflect new CommandResponse Handling references (marcelog#182) references (marcelog#88)
PAMI incorrectly parses Command core show hints response:
As you can see - some part of the response body wa put into key name...
Using latest PAMI release
The text was updated successfully, but these errors were encountered: