[asterisk-dev] AMI syntax

Matthew Jordan mjordan at digium.com
Sat Sep 28 16:16:43 CDT 2013


On Sat, Sep 28, 2013 at 4:08 PM, Dan Jenkins
<dan.jenkins at holidayextras.com>wrote:

> > On Sep 28, 2013, at 21:57, jg <webaccounts at jgoettgens.de> wrote:
> >
> > Mark!
> >
> >> When it comes to parsing incoming AMI actions, Asterisk will accept:
> >>
> >> <key> ':' <space>+ <value> <CRLF>
> >>
> >> If there is arbitrary space before the key, then Asterisk will not
> properly match on the key as expected. There must be at least one space
> between the colon and the value. If there is trailing space after the
> value, then Asterisk will consider that extra space to be part of the value
> (though this should maybe be changed?).
> > It looks more like
> >
> > <key> ':' <space>+ <value>? <CRLF>
> >
> > because I have found events that have empty values. For example the
> Jabber event might have an empty value for the "Packet" header.
> >
> > jg
> >
> > --
> > _____________________________________________________________________
> > -- 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
>
> Matt Jordan just put up on the asterisk wiki under asterisk 12 the ami
> 1.4 specification, the format is exactly the same, I would definitely
> take a look at it, gives a tonne of great examples
>
>
Thanks! It does need a few tweaks still, which I'm going to try and get
done next week.

As an FYI, we removed the JabberEvent event in Asterisk 12 for two reasons:
(1) It was spammy as all get out, and didn't convey a lot of useful
information: knowing that you received a particular XMPP message over an
AMI connection doesn't let you do anything with it, and if you really want
that information outside of Asterisk, you should just relay the XMPP
message to an XMPP server and deal with it there.
(2) It isn't really AMI's job to convey another protocol over itself. Doing
so sets a rather bad precedent (and yes, it was set for a long time, but
that doesn't mean we shouldn't correct it)

So in 12, at least, the JabberEvent is not a culprit in having keys with no
values.

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130928/eec83c81/attachment.html>


More information about the asterisk-dev mailing list