[SR-Users] incomplete values and Wrong Counting for $hfl and $hflc

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 21 16:43:48 CEST 2022

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.


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 
> Record-Route: <sip:;lr=on;nat=yes>
> Record-Route:
> <sip:;lr;transport=udp>,<sip:;lr;transport=udp>
> i get $hflc(Record-Route) == 2 instead of 3 
> and $(hfl(Record-Route)[0]) ==
>        $(hfl(Record-Route)[1]) ==
>  $(hfl(Record-Route)[3]) does not exists.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220721/a5974264/attachment.htm>

More information about the sr-users mailing list