<p style="white-space: pre-wrap; word-wrap: break-word;">Instead of having this leak out to res_pjsip_session for the purpose of keeping the pointer present - why doesn't res_pjsip_t38 just not use session->media in that scenario at all?</p><p style="white-space: pre-wrap; word-wrap: break-word;">It currently maintains a datastore on the channel to store data, this could also store a pointer (with reference) to the T.38 UDPTL session_media that is guaranteed to be valid - and would result in no looking up in session->media or needing to drop the channel lock or messing with its reference. This would be done when the session_media is allocated in this same module. Usage would require getting the datastore, which would have the session_media on it. When the datastore is destroyed it can then unreference the session_media and it will be destroyed as normal.</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10601">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10601">change 10601</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/10601"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ia92e2389b8d804bf205473e92ec06217e87ce237 </div>
<div style="display:none"> Gerrit-Change-Number: 10601 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Paulo Vicentini <paulo.vicentini@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 12 Nov 2018 11:52:31 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>