Hello Benoit, $hdr(Via)[i} don't work for you? Combine with the available transformations to get e.g. specific parts of the header.
Cheers, Henning -- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.com > -----Original Message----- > From: Benoit Panizzon via sr-users <[email protected]> > Sent: Montag, 23. Dezember 2024 14:38 > To: [email protected] > Cc: Benoit Panizzon <[email protected]> > Subject: [SR-Users] How to use @via[idx] ? > > Hi > > https://www.kamailio.org/wikidocs/cookbooks/5.7.x/pseudovariables/#selname > -selects > https://www.kamailio.org/wikidocs/cookbooks/5.7.x/selects/#viaihost > > I'm trying to list all via hosts: > > $var(dooh) = @via[1].host; > xlog("L_INFO","******** VIA HOST 1: $var(dooh) \n"); > > This above works as expected I get the 2nd entry. > > $var(i) = 0; > while ($var(i) < $hflc(Via)) { > $var(dooh) = @via[$var(i)].host; > xlog("L_INFO","******** VIA HOST: $var(dooh) \n"); > $var(i) = $var(i) + 1; > } > > This fails with syntax error. > > How do I specify the index of the via header I want to extract the host from? > > I also attempted $sel(via[$var(i)].host) or via[$var(i)] or > $sel(hfl(via[$var(i)])).host > but I found no variant not throwing an error. > > PS: Is there maybe another nice function to figure out if we have already seen > (and how many times we have) this same message? > > Mit freundlichen Grüssen > > -Benoît Panizzon- > -- > I m p r o W a r e A G - Leiter Commerce Kunden > ______________________________________________________ > > Zurlindenstrasse 29 Tel +41 61 826 93 00 > CH-4133 Pratteln Fax +41 61 826 93 01 > Schweiz Web http://www.imp.ch > ______________________________________________________ > __________________________________________________________ > Kamailio - Users Mailing List - Non Commercial Discussions -- sr- > [email protected] To unsubscribe send an email to sr-users- > [email protected] > Important: keep the mailing list in the recipients, do not reply only to the > sender! __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
