Hi there,
The function doesn't appear to accept vars.
For example, set_advertised_address("$var(someaddress)") results in a VIA
of string $var(someaddress), instead of var's value.
https://www.kamailio.org/wiki/cookbooks/5.3.x/core#set_advertised_address
kamailio 5.3.2 (x86_64/linux) 0bed10
Cheers.
--Sergiu