[asterisk-dev] Formatting options for CLI output
Dan Jenkins
dan.jenkins at holidayextras.com
Fri Nov 9 03:46:01 CST 2012
Because langs already have encoders/parsers for JSON :)
Would be good to be able to set the format by the format you login with; if
this ever happened that is.
So you'd login with a JSON string and therefore subsequent replies would
come through as JSON
In terms of there being "a few" AMI commands, surely they all follow a data
structure and the data gets encoded into \n\n before being sent out? And
therefore changes would be in the encoder and decoder part of the AMI?
Dan Jenkins
--
Dan Jenkins - Senior Web Developer
email: dan.jenkins at holidayextras.com
twitter: dan_jenkins <http://twitter.com/dan_jenkins>
linkedin: jenkinsdaniel <http://www.linkedin.com/in/jenkinsdaniel>
skype: d-jenkins
blog: www.dan-jenkins.co.uk
about.me: about.me/dan_jenkins
On 9 November 2012 09:28, Saúl Ibarra Corretgé <saghul at gmail.com> wrote:
> Hi,
>
> +1 for Olle's suggestion. On to the format...
>
>
> Nir Simionovich wrote:
>
>> 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?
>>
>>
> Why? You'll get text so you'll need to JSON-decode it anyway, so what's
> wrong about \n\n ?
>
> If we go that route someone may want XML as well so then we should have a
> way to tell AMI to give you the result of a given query in text, JSON or
> XML format. Or maybe set the format for a given AMI session/connection.
> Doesn't sound like a bad idea, but there are "a few" AMI commands out there
> ;-)
>
>
> Regards,
>
> --
> Saúl Ibarra Corretgé
> http://saghul.net/blog | http://about.me/saghul
>
>
> --
> ______________________________**______________________________**_________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/**mailman/listinfo/asterisk-dev<http://lists.digium.com/mailman/listinfo/asterisk-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121109/064d8d3b/attachment.htm>
More information about the asterisk-dev
mailing list