<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 2:</p><p style="white-space: pre-wrap; word-wrap: break-word;">Found 1 more ARI event has no timestamp item. - ApplicationReplaced</p><p style="white-space: pre-wrap; word-wrap: break-word;">Btw, instead of writing the timestamp from the message creating function, how about add the timestamp item at the void app_send(struct stasis_app *app, struct ast_json *message) for the future events?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Like this way.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">void app_send(struct stasis_app *app, struct ast_json *message)<br>{<br>   stasis_app_cb handler;<br>        char eid[20];<br> void *data;<br>   struct ast_json *j_timestamp;</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_json_object_set(message, "asterisk_id", ast_json_string_create(<br>                     ast_eid_to_str(eid, sizeof(eid), &ast_eid_default)))) {<br>           ast_log(AST_LOG_WARNING, "Failed to append EID to outgoing event %s\n",<br>                     ast_json_string_get(ast_json_object_get(message, "type")));<br> }</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">     /* set the timestamp if it doesn't exist */<br>       j_timestamp = ast_json_object_create();<br>       if (j_timestamp) {<br>            ast_json_object_set(j_timestamp, "timestamp", ast_json_timeval(ast_tvnow(), NULL));<br>         ast_json_object_update_missing(message, j_timestamp);<br> }</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">     /* Copy off mutable state with lock held */<br>   ao2_lock(app);<br>        handler = app->handler;<br>    data = ao2_bump(app->data);<br>        ao2_unlock(app);<br>      /* Name is immutable; no need to copy */<br>...</pre></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I can see some of events are required having a same timestamp with original messages. But as long as add the timestamp when it's missing, I think it's not bad. :)</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11100">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11100">change 11100</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11100"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I382c2fef58f5fe107e1074869a6d05310accb41f </div>
<div style="display:none"> Gerrit-Change-Number: 11100 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 07 Mar 2019 21:02:49 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>