<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi all,</p>
<p><br>
</p>
<p>In the end I was successfull using param.value transformations for the parameters in the header and tobody.uri to get the URI. Thank you for your your help!</p>
<p><br>
</p>
<p>Ionut<br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Daniel-Constantin Mierla <miconda@gmail.com><br>
<b>Sent:</b> Tuesday, July 30, 2019 5:25 PM<br>
<b>To:</b> Kamailio (SER) - Development Mailing List; Ionut Razvan Ionita<br>
<b>Subject:</b> Re: [sr-dev] Parsing list of headers</font>
<div> </div>
</div>
<div>
<p>Hello,<br>
</p>
<div class="moz-cite-prefix">On 25.07.19 17:44, Ionut Razvan Ionita wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<p>Hello all,</p>
<p><br>
</p>
<p>I am trying to implement RFC 7544 in kamailio.cfg, more specifically to transform Diversion header into History-Info. To do this I need to iterate over all Diversion headers and be able to get all the parameters from it. At first I discovered $di core variable,
 but I can access only the first header with it. I discovered kamailio selectors but I can't index them with a variable. I came to the point where I want to implement variable indexing to selectors but after I saw this API is quite complex I thought to ask
 here if there's any other solution to do this?!</p>
</blockquote>
<p>if you refer to $sel(...) and they do not support variables for index, you can try:</p>
<p>  - double evaluation using pv_evalx() - <a href="https://www.kamailio.org/docs/modules/devel/modules/pv.html#pv.f.pv_evalx">
https://www.kamailio.org/docs/modules/devel/modules/pv.html#pv.f.pv_evalx</a></p>
<p>  - use an embedded script with inline execution -- eg app_jsdt doesn't have external dependencies and you can run a small javascript script where you can use local variables for index and construct the $sel() as you need, then pass that to KSR.pv.get(...).</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
</div>
</div>
</body>
</html>