[asterisk-bugs] [JIRA] (ASTERISK-27307) AMI Action 'Command' only returns the last line

Joshua Colp (JIRA) noreply at issues.asterisk.org
Tue Oct 3 22:16:38 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=238983#comment-238983 ] 

Joshua Colp commented on ASTERISK-27307:
----------------------------------------

I just did this against 15.0.0 over telnet:

{noformat}
Action: Command
Command: pjsip show endpoints

Response: Success
Message: Command output follows
Output: 
Output:  Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
Output:     I/OAuth:  <AuthId/UserName...........................................................>
Output:         Aor:  <Aor............................................>  <MaxContact>
Output:       Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Output:   Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
Output:    Identify:  <Identify/Endpoint.........................................................>
Output:         Match:  <criteria.........................>
Output:     Channel:  <ChannelId......................................>  <State.....>  <Time.....>
Output:         Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
Output: ==========================================================================================
Output: 
Output:  Endpoint:  anonymous                                            Unavailable   0 of 1
Output: 
Output:  Endpoint:  doorbell                                             Unavailable   0 of 1
Output:         Aor:  doorbell                                          10
Output: 
Output:  Endpoint:  doorbell2                                            Unavailable   0 of 1
Output:         Aor:  doorbell2                                         10
Output: 
Output:  Endpoint:  doorbell3                                            Unavailable   0 of 1
Output:         Aor:  doorbell3                                         10
Output: 
Output:  Endpoint:  josh                                                 Unavailable   0 of 1
Output:         Aor:  josh                                              10
Output: 
Output:  Endpoint:  webrtc                                               Unavailable   0 of 1
Output: 
Output: 
Output: Objects found: 6
Output: 
{noformat}

And it worked as expected. I'd suggest eliminating your application for the moment and doing the same. This will narrow down the scope to either Asterisk or how the application is handling things.

> AMI Action 'Command' only returns the last line
> -----------------------------------------------
>
>                 Key: ASTERISK-27307
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27307
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/ManagerInterface
>    Affects Versions: 14.0.0, 15.0.0-rc1
>         Environment: CentOS 6.8 
>            Reporter: Ramon Peek
>            Assignee: Unassigned
>            Severity: Minor
>         Attachments: AMI-command-action-patch_v14.diff
>
>
> The AMI Action 'Command' only returns the last line from the output of a CLI command.
> This is the case since the launch of Asterisk 14, which is described on the Asterisk Wiki as;
> "The Command action now sends the output from the CLI command as a series of Output headers for each line instead of as a block of text with the --END COMMAND-- delimiter to match the output from other actions."
> https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+14
> As a result we are no longer getting a useful response if the CLI command executed contains multiple lines, like 'core show channels' or 'sip show channels'
> In these cases only the last line of the CLI Command is then reported on the "Output header" 
> The WiKi mentions; "a series of Output headers for each line"
> But clearly that doesn't happen, we only get a single "output header".
> I've written a simple patch that reverts this change.
> Even though this works for me at the moment, reverting the change is a step backwards and likely not the correct way to continue.
> I'd like to write a correct solution to the problem, but this requires me to know more about the reasons behind the original change.
> However, I could not find the actual change anywhere in the ChangeLog or here on Jira. 
> Some assistance is appreciated.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list