<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11126">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/res_stasis: Fixed wrong StasisEnd timestamp<br><br>Because StasisEnd's timestamp created it's own timestamp, it makes<br>wrong timestamp, compare to other channel event(ChannelDestroyed).<br>Fixed to getting a timestamp from the Channel's timestamp.<br><br>ASTERISK-28333<br><br>Change-Id: I5eb8380fc472f1100535a6bc4983c64767026116<br>---<br>M res/res_stasis.c<br>1 file changed, 9 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/11126/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_stasis.c b/res/res_stasis.c</span><br><span>index 4b7c3ed..c79ed06 100644</span><br><span>--- a/res/res_stasis.c</span><br><span>+++ b/res/res_stasis.c</span><br><span>@@ -116,16 +116,23 @@</span><br><span> const struct stasis_message_sanitizer *sanitize)</span><br><span> {</span><br><span> struct ast_channel_blob *payload = stasis_message_data(message);</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_json *msg;</span><br><span> </span><br><span> if (sanitize && sanitize->channel_snapshot &&</span><br><span> sanitize->channel_snapshot(payload->snapshot)) {</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- return ast_json_pack("{s: s, s: o, s: o}",</span><br><span style="color: hsl(120, 100%, 40%);">+ msg = ast_json_pack("{s: s, s: O, s: o}",</span><br><span> "type", "StasisEnd",</span><br><span style="color: hsl(0, 100%, 40%);">- "timestamp", ast_json_timeval(ast_tvnow(), NULL),</span><br><span style="color: hsl(120, 100%, 40%);">+ "timestamp", ast_json_object_get(payload->blob, "timestamp"),</span><br><span> "channel", ast_channel_snapshot_to_json(payload->snapshot, sanitize));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!msg) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR, "Failed to pack JSON for StasisEnd message\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return msg;</span><br><span> }</span><br><span> </span><br><span> STASIS_MESSAGE_TYPE_DEFN_LOCAL(end_message_type,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11126">change 11126</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/+/11126"/><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: I5eb8380fc472f1100535a6bc4983c64767026116 </div>
<div style="display:none"> Gerrit-Change-Number: 11126 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>