<p></p>
<p><b>@miconda</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/kamailio/kamailio/pull/2397#discussion_r454163348">src/modules/websocket/ws_conn.c</a>:</p>
<pre style='color:#555'>> @@ -261,6 +262,24 @@ int wsconn_add(struct receive_info *rcv, unsigned int sub_protocol)
        return 0;
 }
 
+static void wsconn_run_close_callback(ws_connection_t *wsc)
+{
+       sip_msg_t *fmsg;
+       sr_event_param_t evp = {0};
+       if(faked_msg_init() < 0) {
+               LM_ERR("faked_msg_init() failed\n");
+               return;
+       }
+       fmsg = faked_msg_next();
+       wsc->rcv.proto_reserved1 = wsc->id;
+       fmsg->rcv = wsc->rcv;
+
</pre>
<p>Changes to fmsg content should be avoided, because the structure content is reused for following execution cycles, and that can also happen in another module.</p>
<p>There is evp.rcv field for the purpose of passing the received info via callback, any reason not using it?</p>
<p>The alternative is to backup fmsg->rcv to a local variable and restore after the sr_event_exec.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2397#pullrequestreview-447861724">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLBV4OBXISO5QFSRODR3QDOXANCNFSM4OYOSBPA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZJNNIWHK5GUA7IZB2LR3QDOXA5CNFSM4OYOSBPKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODKY5HXA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2397#pullrequestreview-447861724",
"url": "https://github.com/kamailio/kamailio/pull/2397#pullrequestreview-447861724",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>