<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13106">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Joshua Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ari_events: Add module reference when a WebSocket is open.<br><br>This change ensures that the module isn't unloaded when a<br>WebSocket is open. Previously it was possible to unload the<br>module manually or during shutdown which could cause a crash<br>when any active WebSockets were terminated.<br><br>ASTERISK-28585<br><br>Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c<br>---<br>M res/res_ari_events.c<br>M rest-api-templates/res_ari_resource.c.mustache<br>2 files changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_ari_events.c b/res/res_ari_events.c</span><br><span>index c8f28f9..1c4655f 100644</span><br><span>--- a/res/res_ari_events.c</span><br><span>+++ b/res/res_ari_events.c</span><br><span>@@ -150,6 +150,8 @@</span><br><span> RAII_VAR(struct ast_websocket *, s, ws_session, ast_websocket_unref);</span><br><span> RAII_VAR(struct ast_ari_websocket_session *, session, NULL, ao2_cleanup);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ SCOPED_MODULE_USE(ast_module_info->self);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> response = ast_calloc(1, sizeof(*response));</span><br><span> if (!response) {</span><br><span> ast_log(LOG_ERROR, "Failed to create response.\n");</span><br><span>diff --git a/rest-api-templates/res_ari_resource.c.mustache b/rest-api-templates/res_ari_resource.c.mustache</span><br><span>index 85948fb..e320f19 100644</span><br><span>--- a/rest-api-templates/res_ari_resource.c.mustache</span><br><span>+++ b/rest-api-templates/res_ari_resource.c.mustache</span><br><span>@@ -211,6 +211,8 @@</span><br><span> struct ast_variable *path_vars = NULL;</span><br><span> {{/has_path_parameters}}</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ SCOPED_MODULE_USE(ast_module_info->self);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> {{#has_parameters}}</span><br><span> response = ast_calloc(1, sizeof(*response));</span><br><span> if (!response) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13106">change 13106</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/+/13106"/><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: I85c71ab112f99875b586419a34c08c8b34c14c5c </div>
<div style="display:none"> Gerrit-Change-Number: 13106 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>