Actually is possible to set the address and port in Via added by Kamailio using variables for quite some time, see the example at:
- https://www.kamailio.org/docs/modules/stable/modules/corex.html#corex.f.via_...
That should offer the same functionality as set_advertised_address()/set_advertised_port(). If anyone wants to enhance the two functions as well, just make a PR.