<p>I found the code <code>reply_received</code> in tm synchronizing the execution of <code>onreply_route</code>.</p>
<p>I think we should merge this first small iteration and I can proceed with another MR to add another xavp_copy function taking 4 params after, in order to proceed with small iterations, let me know if you think otherwise.</p>
<p>I already have the code for <code>xavc_copy("source_name", "source_index", "destination_name", "destination_index")</code><br>
This will let the user copy to a specific posistion in the stack (replacing its value).<br>
This would bring coherent behaviour compared to assign to a specific index vs appendind.</p>
<p>Example : swapping xavp in and existing stack:<br>
(second and third elements)</p>
<pre><code>$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";
$xavp(a=>x) = "a-2-x";
$xavp(a[0]=>y) = "a-2-y";

# INFO: <script>: NEW $xavp(a[0]) = [a-2-x][a-2-y]
# INFO: <script>: NEW $xavp(a[1]) = [a-1-x][a-1-y]
# INFO: <script>: NEW $xavp(a[2]) = [a-0-x][a-0-y]

xavp_copy("a", "1", "c");
xavp_copy("a", "2", "a", "1");
xavp_copy("c", "0", "a", "2");

# INFO: <script>: AFTER $xavp(a[0]) = [a-2-x][a-2-y]
# INFO: <script>: AFTER $xavp(a[1]) = [a-0-x][a-0-y]
# INFO: <script>: AFTER $xavp(a[2]) = [a-1-x][a-1-y]
</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/pull/2070?email_source=notifications&email_token=ABO7UZJEQNR5LVQF6DJX3OLQMMZMPA5CNFSM4IY4CYAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAA62WQ#issuecomment-536997210">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZKY2RCJEQWBCUPXZ7DQMMZMPANCNFSM4IY4CYAA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZN3CNEJI4NPQFQ34LLQMMZMPA5CNFSM4IY4CYAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAA62WQ.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=ABO7UZJEQNR5LVQF6DJX3OLQMMZMPA5CNFSM4IY4CYAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAA62WQ#issuecomment-536997210",
"url": "https://github.com/kamailio/kamailio/pull/2070?email_source=notifications\u0026email_token=ABO7UZJEQNR5LVQF6DJX3OLQMMZMPA5CNFSM4IY4CYAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAA62WQ#issuecomment-536997210",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>