[asterisk-app-dev] Event naming conventions

Paul Belanger paul.belanger at polybeacon.com
Mon Oct 28 19:49:24 CDT 2013


On Tue, Oct 22, 2013 at 12:03 PM, Matthew Jordan <mjordan at digium.com> wrote:
>
> On Mon, Oct 21, 2013 at 3:23 PM, Michael L. Young <myoung at acsacc.com> wrote:
>>
>> ----- Original Message -----
>>
>> > From: "Daniel Jenkins" <dan.jenkins88 at gmail.com>
>> > To: "Asterisk Application Development discussion"
>> > <asterisk-app-dev at lists.digium.com>
>> > Sent: Monday, October 21, 2013 3:59:58 PM
>> > Subject: Re: [asterisk-app-dev] Event naming conventions
>> >
>> >
>> > > So, I guess the first question is do we want to keep the AMI / ARI
>> >
>> > > naming of events is _somewhat_ similar? AMI tends to be now,
>> >
>> > > DTMFBegin and ARI the past, PlaybackStarted.
>> >
>> > I'm sorry I even mentioned the AMI... I'd much rather keep it past
>> > tense...
>>
>> I too would lean more towards using the past tense.  It seems more natural
>> to see a message saying that "something has occurred".
>>
>
> Some thoughts here:
>
> When the event standardization for AMI occurred, we focused on two things:
>     (1) Making the events contain the same subsets of information
>     (2) Making the event types follow a "begin"/"end" nomenclature, without
> the need for a subtype field or further event field inspection
>
> Beyond that, there wasn't much thought given to whether or not event pairing
> should be "Started/Finished"; "Begin/End", "Created/Destroyed", etc. Maybe
> we should have been concerned about it, but our focus was more on the
> previous two points and not on whether or not Started is better than Begin.
>
To keep this thread going, I'm going to start work on a patch and I'll
be using past tense for the events. Here are some examples of the
syntax we use, what do people prefer:

Started / Stopped
- StasisStarted / StasisStopped
- PlaybackStarted / PlaybackStopped

Started / Ended
- StasisStarted / StasisEnded
- PlaybackStarted / PlaybackEnded

Started / Finished
- StasisStarted / StasisFinished
- PlaybackStarted / PlaybackFinished

Created / Destroyed
- BridgeCreated / BridgeDestroyed
- ChannelCreated / ChannelDestroyed

Feedback welcome

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger



More information about the asterisk-app-dev mailing list