<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;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hello Daniel,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for feedbacks.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
im using <span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:15px;background-color:rgb(255, 255, 255);display:inline !important">$hfl($var(hname))
 with $var(hname) being "Record-Route"? and it produces wrong results like explained.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:15px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="" class="elementToProof"><font color="#201f1e"><span style="font-size: 15px;">and indeed with static name like <span style="background-color:rgb(255, 255, 255);display:inline !important"> </span><span style="margin:0px;background-color:rgb(255, 255, 255);display:inline !important">$hflc(Record-Route)
 and </span><span style="background-color:rgb(255, 255, 255);display:inline !important">$hfl(Record-Route) the results are correct. i did not test first with static name because i tought the results were the same.</span></span></font></div>
<div style="" class="elementToProof"><br>
</div>
<div style="" class="elementToProof">i already opened an issue on github <a href="https://github.com/kamailio/kamailio/issues/3194" id="LPlnkOWALinkPreview">https://github.com/kamailio/kamailio/issues/3194</a></div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2thbWFpbGlvL2thbWFpbGlvL2lzc3Vlcy8zMTk0" class="LPBorder834149" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer834149" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer834149" style="position: relative; margin-right: 12px; height: 120px; overflow: hidden; width: 240px;">
<a target="_blank" id="LPImageAnchor834149" href="https://github.com/kamailio/kamailio/issues/3194"><img id="LPThumbnailImageId834149" alt="" height="120" style="display: block;" width="240" src="https://opengraph.githubassets.com/df419938d8c8caea7d003e117bb64b318aef7b31a1d8e09e0c970649db55c3d7/kamailio/kamailio/issues/3194"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle834149" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor834149" href="https://github.com/kamailio/kamailio/issues/3194" style="text-decoration: none; color: var(--themePrimary);">incomplete values and Wrong Counting for $hfl and $hflc · Issue #3194 · kamailio/kamailio</a></div>
<div id="LPDescription834149" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Description the counting and values provides by $hfl and $hflc are wrong and imcomplete Troubleshooting Reproduction Debugging Data route { $var(hname) = &quot;Record-Route&quot;; if (is_present_hf...</div>
<div id="LPMetadata834149" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
github.com</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div style="" class="elementToProof"><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> Daniel-Constantin Mierla <miconda@gmail.com><br>
<b>Envoyé :</b> jeudi 21 juillet 2022 15:43<br>
<b>À :</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; Patrick Karton <patrickarton@hotmail.com><br>
<b>Objet :</b> Re: [SR-Users] incomplete values and Wrong Counting for $hfl and $hflc</font>
<div> </div>
</div>
<div>
<p>Are you using it exactly like $hfl(Record-Route) or is it like $hfl($var(hname)) with $var(hname) being "Record-Route"?</p>
<p><br>
</p>
<p>The first variant is the one covered by $hfl()/$hflc(), parsing of the name being optimized at startup. On the second variant, the name is dynamic at runtime, based on the $var() value and simply compares the generic header names in the list, without any
 specific optimization for "Record-Route" case.</p>
<p><br>
</p>
<p>I noticed an issue opened on bug tracker and there was the second variant, while in this message seems to be the first variant. If the first variant fails, then it is a bug there. If it is the second that doesn't provide, it's because the feature is not
 there yet.</p>
<p><br>
</p>
<p>Cheers,<br>
Daniel</p>
<p><br>
</p>
<div class="x_moz-cite-prefix">On 21.07.22 15:00, Patrick Karton wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">the counting and values provided by $hfl and $hflc are wrong and incomplete from my understanding. looking at the source code these pseudo vars count the body values of Via, Record-Route and Route headers.</span><br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">in kamalio 5.6.1</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">with </span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">Record-Route: <a class="x_moz-txt-link-rfc2396E" href="sip:1.1.1.1;lr=on;nat=yes">
<sip:1.1.1.1;lr=on;nat=yes></a><br>
Record-Route: <a class="x_moz-txt-link-rfc2396E" href="sip:2.2.2.2:5060;lr;transport=udp">
<sip:2.2.2.2:5060;lr;transport=udp></a>,<a class="x_moz-txt-link-rfc2396E" href="sip:3.3.3.3:22506;lr;transport=udp"><sip:3.3.3.3:22506;lr;transport=udp></a><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">i get $hflc(Record-Route) == 2 instead of 3 </span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">and $(hfl(<span style="background-color:rgb(255,255,255); display:inline!important">Record-Route</span>)[0]) == <span style="background-color:rgb(255,255,255); display:inline!important">1.1.1.1</span></span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style="">       <span style="background-color:rgb(255,255,255); display:inline!important">$(hfl(</span><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important">Record-Route</span><span style="background-color:rgb(255,255,255); display:inline!important">)[1])</span> ==
 2.2.2.2</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><span style="background-color:rgb(255,255,255); display:inline!important"> </span><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important">$(hfl(</span><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important">Record-Route</span><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important">)[3])
 does not exists.</span><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important"><br>
</span></span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important"><br>
</span></span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><span style="margin:0px; background-color:rgb(255,255,255); display:inline!important"><br>
</span></span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="x_elementToProof" style=""><br>
</span></div>
<br>
<fieldset class="x_moz-mime-attachment-header"></fieldset>
<pre class="x_moz-quote-pre">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="x_moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="x_moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="x_moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="x_moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="x_moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="x_moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
</div>
</body>
</html>