Hello Daniel,

Thanks for feedbacks.


im using $hfl($var(hname)) with $var(hname) being "Record-Route"? and it produces wrong results like explained.

and indeed with static name like  $hflc(Record-Route) and $hfl(Record-Route) the results are correct. i did not test first with static name because i tought the results were the same.

i already opened an issue on github https://github.com/kamailio/kamailio/issues/3194



De : Daniel-Constantin Mierla <miconda@gmail.com>
Envoyé : jeudi 21 juillet 2022 15:43
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; Patrick Karton <patrickarton@hotmail.com>
Objet : Re: [SR-Users] incomplete values and Wrong Counting for $hfl and $hflc
 

Are you using it exactly like $hfl(Record-Route) or is it like $hfl($var(hname)) with $var(hname) being "Record-Route"?


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.


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.


Cheers,
Daniel


On 21.07.22 15:00, Patrick Karton wrote:
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.

in kamalio 5.6.1

with 

i get $hflc(Record-Route) == 2 instead of 3 

and $(hfl(Record-Route)[0]) == 1.1.1.1
       $(hfl(Record-Route)[1]) == 2.2.2.2

 $(hfl(Record-Route)[3]) does not exists.







__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda