<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 28, 2013 at 8:16 PM, Paul Belanger <span dir="ltr"><<a href="mailto:paul.belanger@polybeacon.com" target="_blank">paul.belanger@polybeacon.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Oct 28, 2013 at 8:49 PM, Paul Belanger<br>
<<a href="mailto:paul.belanger@polybeacon.com">paul.belanger@polybeacon.com</a>> wrote:<br>
> On Tue, Oct 22, 2013 at 12:03 PM, Matthew Jordan <<a href="mailto:mjordan@digium.com">mjordan@digium.com</a>> wrote:<br>
>><br>
>> On Mon, Oct 21, 2013 at 3:23 PM, Michael L. Young <<a href="mailto:myoung@acsacc.com">myoung@acsacc.com</a>> wrote:<br>
>>><br>
>>> ----- Original Message -----<br>
>>><br>
>>> > From: "Daniel Jenkins" <<a href="mailto:dan.jenkins88@gmail.com">dan.jenkins88@gmail.com</a>><br>
>>> > To: "Asterisk Application Development discussion"<br>
>>> > <<a href="mailto:asterisk-app-dev@lists.digium.com">asterisk-app-dev@lists.digium.com</a>><br>
>>> > Sent: Monday, October 21, 2013 3:59:58 PM<br>
>>> > Subject: Re: [asterisk-app-dev] Event naming conventions<br>
>>> ><br>
>>> ><br>
>>> > > So, I guess the first question is do we want to keep the AMI / ARI<br>
>>> ><br>
>>> > > naming of events is _somewhat_ similar? AMI tends to be now,<br>
>>> ><br>
>>> > > DTMFBegin and ARI the past, PlaybackStarted.<br>
>>> ><br>
>>> > I'm sorry I even mentioned the AMI... I'd much rather keep it past<br>
>>> > tense...<br>
>>><br>
>>> I too would lean more towards using the past tense.  It seems more natural<br>
>>> to see a message saying that "something has occurred".<br>
>>><br>
>><br>
>> Some thoughts here:<br>
>><br>
>> When the event standardization for AMI occurred, we focused on two things:<br>
>>     (1) Making the events contain the same subsets of information<br>
>>     (2) Making the event types follow a "begin"/"end" nomenclature, without<br>
>> the need for a subtype field or further event field inspection<br>
>><br>
>> Beyond that, there wasn't much thought given to whether or not event pairing<br>
>> should be "Started/Finished"; "Begin/End", "Created/Destroyed", etc. Maybe<br>
>> we should have been concerned about it, but our focus was more on the<br>
>> previous two points and not on whether or not Started is better than Begin.<br>
>><br>
> To keep this thread going, I'm going to start work on a patch and I'll<br>
> be using past tense for the events. Here are some examples of the<br>
> syntax we use, what do people prefer:<br>
><br>
> Started / Stopped<br>
> - StasisStarted / StasisStopped<br>
> - PlaybackStarted / PlaybackStopped<br>
><br>
> Started / Ended<br>
> - StasisStarted / StasisEnded<br>
> - PlaybackStarted / PlaybackEnded<br>
><br>
> Started / Finished<br>
> - StasisStarted / StasisFinished<br>
> - PlaybackStarted / PlaybackFinished<br>
><br>
> Created / Destroyed<br>
> - BridgeCreated / BridgeDestroyed<br>
> - ChannelCreated / ChannelDestroyed<br>
><br>
> Feedback welcome<br>
><br>
</div></div>Digging deeper into events, we also have the following:<br>
<br>
ChannelEnteredBridge / ChannelLeftBridge<br>
<br>
Seems like a mouthful, what about something along the lines of<br>
<br>
BridgeAdded / BridgeRemoved<br>
BridgeEntered / BridgedExited<br>
<br>
or event<br>
<br>
BridgeChannelAdded / BridgeChannelRemoved (mouthful)<br>
<br>
This is for /bridges/:id/addChannel / removeChannel function<br>
<br>
This will help keep all the bridge events in the same namespace:<br>
<br>
BridgeCreated<br>
BridgeDestroyed<br>
BridgeMerged<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div style>Two things:</div><div style><br></div><div style>(1) Sacrificing a few bytes is rarely worth it, even in the most strict of real time systems. The amount of electrons perturbed by 7 characters is worth the sacrifice it if it conveys meaning to the consumer of the API.</div>
<div style><br></div><div style>(2) The event conveys what happened: A channel entered a bridge, or a channel left a bridge. Consider your alternatives:</div><div style>* BridgeChannelAdded - somewhat acceptable, but now we've inverted the order of the nouns in the event so it is somewhat less clear as to what occurred. Is the object that was affected a bridge, a channel, or a bridgechannel? (And yes, in Asterisk, a BridgeChannel is a thing. Just not something an ARI consumer should ever be aware of.)</div>
<div style>* BridgeAdded - what was added? A channel? Another bridge? (This is not so absurd as you might think)</div><div style>* BridgeEntered - again - what entered?</div><div style><br></div><div style>Again: ChannelEnteredBridge conveys exactly what just happened, a channel entered a bridge. I don't even need to look at documentation to know what that event implies.</div>
<div style><br></div><div style>How is that not better? </div></div><div><br></div>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div>
<div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div>