<h3>Description</h3>
<p>A patch was pushed to master branch to enable use of trace_type in the ki_sip_trace_dst_cid_flag(), following the latest additions to the module. It seemed that the trace type was used only for kamailio.cfg functions, because inside ki_sip_trace_dst_cid_flag() the trace_type was parsed and stored in local variable, but it was not used further.</p>
<p>I open this issue for review, to be sure something was not overlooked, the commit is:</p>
<ul>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/e8d765610c6926cc6cb4dfa490595214a3680f97/hovercard" href="https://github.com/kamailio/kamailio/commit/e8d765610c6926cc6cb4dfa490595214a3680f97"><tt>e8d7656</tt></a></li>
</ul>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=47789025" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ionutionita92">@ionutionita92</a> - can you have a look and eventually do some tests to be sure it still works as expected for kamailio.cfg functions?</p>
<p>There is one more aspect to clarify. The trace info structure is alocated in shared memory, but some of its fields (duplicate uri and correlation id) were set to addresses of function parameters/local variables. The code was relocated and now is at the following lines:</p>
<ul>
<li><a href="https://github.com/kamailio/kamailio/blob/master/src/modules/siptrace/siptrace.c#L867-L875">https://github.com/kamailio/kamailio/blob/master/src/modules/siptrace/siptrace.c#L867-L875</a></li>
</ul>
<p>Is it safe to do it like this? Are the fields used in this case only in current process and the callbacks use the variant stored in AVP?</p>
<p>Speaking of serializing to a string stored in AVP, it might be better to just have a structure compacted with all content in shared memory and stored in an XAVP -- the xavp can store a pointer and also have in its structure the callback to free the pointer.</p>

<h3>Troubleshooting</h3>
<h4>Reproduction</h4>

<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<pre><code>(paste your log messages here)
</code></pre>
<h4>SIP Traffic</h4>

<pre><code>(paste your sip traffic here)
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>Git Master Branch
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>(paste your output here)
</code></pre>

<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/issues/1955?email_source=notifications&email_token=ABO7UZIFPOLZVR6HAISRF6LPVPW2RA5CNFSM4HNCIWF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4XMLQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNRNUPFPW5XHBRZA7LPVPW2RANCNFSM4HNCIWFQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZOEWSAQJPUWHVZPFCLPVPW2RA5CNFSM4HNCIWF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4XMLQ.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/issues/1955?email_source=notifications\u0026email_token=ABO7UZIFPOLZVR6HAISRF6LPVPW2RA5CNFSM4HNCIWF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4XMLQ",
"url": "https://github.com/kamailio/kamailio/issues/1955?email_source=notifications\u0026email_token=ABO7UZIFPOLZVR6HAISRF6LPVPW2RA5CNFSM4HNCIWF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4XMLQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>