<h4>Pre-Submission Checklist</h4>



<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commit message has the format required by CONTRIBUTING guide</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Each component has a single commit (if not, squash them into one commit)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> No commits to README files for modules (changes must be done to docbook files<br>
in <code>doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4>Type Of Change</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> New feature (non-breaking change which adds new functionality)</li>
</ul>
<h4>Checklist:</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Tested changes locally</li>
</ul>
<h4>Description</h4>
<p>proposal for <code>xavp_copy()</code><br>
param1: source xavp name<br>
param2: source xavp index<br>
param3: destination xavp name</p>
<p>The command will copy only one specific xavp from the stack.<br>
If the destination xavp stack exist it will append else it will create a new one, it seems to be more or less compatible to what we do with XAVP in general.</p>
<p>We can not reorder xavp stack like in the following example :</p>
<pre><code>route[TEST] {
        $xavp(a=>x) = "a-0-x";
        $xavp(a[0]=>y) = "a-0-y";
        $xavp(a=>x) = "a-1-x";
        $xavp(a[0]=>y) = "a-1-y";
        xinfo("$$xavp(a[0]) = [$xavp(a[0]=>x)][$xavp(a[0]=>y)]\n");
        xinfo("$$xavp(a[1]) = [$xavp(a[1]=>x)][$xavp(a[1]=>y)]\n");

        $var(src_idx) = 1;
        $var(v) = "b";
        xavp_copy("a", "$var(src_idx)", "$var(v)");
        $var(src_idx) = 0;
        xavp_copy("a", "$var(src_idx)", "$var(v)");
        xinfo("$$xavp(b[0]) = [$xavp(b[0]=>x)][$xavp(b[0]=>y)]\n");
        xinfo("$$xavp(b[1]) = [$xavp(b[1]=>x)][$xavp(b[1]=>y)]\n");
}
</code></pre>
<pre><code> 2(137) INFO: <script>: $xavp(a[0]) = [a-1-x][a-1-y]
 2(137) INFO: <script>: $xavp(a[1]) = [a-0-x][a-0-y]
 2(137) INFO: pv [pv.c:827]: w_xavp_copy(): xavp_copy(new): $xavp(a[1]) >> $xavp(b)
 2(137) INFO: pv [pv.c:833]: w_xavp_copy(): xavp_copy(append): $xavp(a[0]) >> $xavp(b)
 2(137) INFO: <script>: $xavp(b[0]) = [a-0-x][a-0-y]
 2(137) INFO: <script>: $xavp(b[1]) = [a-1-x][a-1-y]
</code></pre>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/2070'>https://github.com/kamailio/kamailio/pull/2070</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>core: adding xavp_clone_level_nodata_with_new_name</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2070/files#diff-0">src/core/xavp.c</a>
    (126)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2070/files#diff-1">src/core/xavp.h</a>
    (14)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/2070.patch'>https://github.com/kamailio/kamailio/pull/2070.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/2070.diff'>https://github.com/kamailio/kamailio/pull/2070.diff</a></li>
</ul>

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