[asterisk-dev] Formatting options for CLI output

Nir Simionovich nir.simionovich at gmail.com
Thu Nov 8 18:33:13 CST 2012


Well,

 

  In general, most of the information can be obtained via AMI, either
directly or via the command action.

However, the overheads involved in obtaining the information via the AMI are
just too great. Be it connecting
to the TCP socket, issuing out the Action command then parsing the
information back - for something that
can be obtained directly from the CLI - it simply makes no sense to do it
from AMI.

 

  Let's take the "sip show peers" CLI command. It's equivalent in the AMI
world will be the "sippeers" action. 

Compare the output of the two, when all you require is the summary line - it
just doesn't make sense to use
AMI. Same applies to CoreShowChannels action. 

 

  So, you would most probably say something like: "in that case, go with
AJAM and write a page that connects
to AJAM and returns back the JSON that you require - well, true that can be
done too. But when working with
small footprint machines, such as embedded devices, this kind of heavy/light
lifting can become a hassle.

 

  In other words, gathering information in a resource economical, code
economical, simply accessible manner 
is something that is required by every PBX/Application developer - the
question is - how to go about and do it.

 

Nir S

 

From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Russell Bryant
Sent: Friday, November 09, 2012 1:49 AM
To: Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] Formatting options for CLI output

 

On Thu, Nov 8, 2012 at 6:26 PM, Nir Simionovich <nir.simionovich at gmail.com>
wrote:

Hi All,

 

  Well, per Michael's response on JIRA, I'm moving this discussion to the
mailing list. 

 

  Here's the thing - almost anyone who's built a large scale Asterisk
platform had used either
Nagios or Icinga (or other) to monitor it. Normally, what you would to
monitor Asterisk would 
be to either use the shell to issue 'asterisk -rx' commands and parse the
output. Or connect
to the manager, issue a similar command and parse the output again. 

 

 

What information can you not get using the AMI today that requires you to
parse CLI output?

 

I'd rather see work go into adding manager commands with responses as
needed.  If you ever have to parse CLI output, that just means something is
missing from the AMI (or you didn't know it was there).

 

-- 

Russell Bryant

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121109/9d479f4e/attachment.htm>


More information about the asterisk-dev mailing list