[sr-dev] [kamailio/kamailio] pv: adding xavp_copy (#2070)

Julien Chavanton notifications at github.com
Tue Oct 1 13:40:55 CEST 2019


I found the code `reply_received` in tm synchronizing the execution of `onreply_route`.

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. 

I already have the code for `xavc_copy("source_name", "source_index", "destination_name", "destination_index")` 
This will let the user copy to a specific posistion in the stack (replacing its value).
This would bring coherent behaviour compared to assign to a specific index vs appendind.

Example : swapping xavp in and existing stack:
(second and third elements)
```
$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]
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2070#issuecomment-536997210
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191001/67b21ea8/attachment.html>


More information about the sr-dev mailing list