<p style="white-space: pre-wrap; word-wrap: break-word;">This vastly changes the ownership and lifecycle of the session media for T.38. Is there a specific reason you opted to change things so much?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Would the following work:</p><p style="white-space: pre-wrap; word-wrap: break-word;">In t38_initialize_session create the datastore and save the given session_media with a reference.<br>The datastore free would just call ao2_cleanup on it when the datastore went away.<br>In the places where the session_media is located using ao2_find get it using the datastore instead.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This would maintain simplify the implementation, not have to expose things, and not have to handle allocation and such (as that belongs to res_pjsip_session).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Was this originally tried and did not work?</p><p>Patch set 5:<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: 5 </div>
<div style="display:none"> Gerrit-Owner: Paulo Vicentini <paulo.vicentini@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Paulo Vicentini <paulo.vicentini@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 11 Jan 2019 14:17:28 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>