Hi
https://www.kamailio.org/wikidocs/cookbooks/5.7.x/pseudovariables/#selname-…
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
______________________________________________________