[asterisk-dev] Formatting options for CLI output

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat Nov 10 13:36:49 CST 2012


On Fri, Nov 09, 2012 at 08:29:08AM +0100, Johan Wilfer wrote:
> 2012-11-09 03:26, Nir Simionovich skrev:
> >Ok, that’s a +1 by me as well. But, if we go that route, I think we
> >should be able to format the output of that
> >action. It would be very useful. Honestly, while on the subject, and I
> >do admit that what I’m about to say will
> >be totally out there – it would be really nice if the input to AMI can
> >be a single JSON array, instead of doing the
> >ever annoying  \n\n in manager – no?
> >
> >I’d love to get cracking on this one as I need it – if someone can throw
> >me some pointers as to how the manager
> >actually works in that respect.
> >
> >Nir S
> >
> 
> Would it be possible to add someting that let you run AMI commands
> from the CLI, and format that in different ways?
> 
> That way you can use this if you can run something like "asterisk
> -rx ami json sippeers" and a formatter could turn the \n\n into a
> JSON array, that you could parse later on?

See astcli in the contribs, which is actually the other way around (get
CLI commands through the manager in a CLI interface).

The CLI interface is widely used even though it is discourged, because
it does not require setting up users in manager.conf.

I wonder what it would take to also have the manager interface listen on
/var/run/asterisk/manager.ctl and pre-authenticate depending on the
usual conventions for asterisk.ctl .

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list