<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2248/">https://reviewboard.asterisk.org/r/2248/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On December 18th, 2012, 1:09 p.m., <b>Russell Bryant</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm sure this was considered, but I'm curious why main/event.c, include/asterisk/event.h isn't sufficient.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Unfortunately there's not a public JIRA issue to point you to, but let let me try to address this.
The goal here is to make it so that AMI events are raised not with a big string as currently done but rather with a series of key/value pairs. This is the first step in that process, which is just to define a key/value pair system and create a means of turning a set of these into an AMI event. Subsequent related reviews you are likely to see will involve converting existing AMI events to use this system. You'll also see this tie into a general effort for Asterisk 12 to improve APIs.
The event system is fantastic, but as far as making a general mechanism for converting AMI events into key/value pairs, it's not a feasible method. I can tell you from experience that I once attempted to convert all the manager events in app_queue into ast_events, and it was pretty brutal. The problem with the event system as-is is its binary nature. A key/value pair object is simpler and more generic, so it lends itself easier to converting AMI events.
I'd expect that as this process continues, you'll see some chunks of code either get factored away altogether or merged in with currently-existing APIs. So for instance, this key/value pair object may end up being defined as a type the event system will understand, or this may get rolled entirely into the event system, or something similar.</pre>
<br />
<p>- Mark</p>
<br />
<p>On December 18th, 2012, 12:28 p.m., Brent Eagles wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Brent Eagles.</div>
<p style="color: grey;"><i>Updated Dec. 18, 2012, 12:28 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch includes an initial crack at a mechanism for creating events through collections of named/value pairs. It also contains some non-heavily-tested code for publishing the name/value pairs as an AMI event. </pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Unit test in test_nvevent.c</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/tests/test_nvevent.c <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/include/asterisk/nvevent.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/main/nvevent.c <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2248/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>