Setting Via IP inside script logic

Nick Jones via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CALxx1oHgs_tQ_-pYYrgRuTbpqnHzUudAJc8_76scPOo9zwiuNA@mail.gmail.com>
G'day all,

I'm working on a scenario with a Kamailio box with a private IP, with a
public IP 1:1 NATed to it (but the VM does not see the public IP on the
NICs).

When forwarding requests to some hosts I want to set the Via address to be
the public IP, but when forwarding requests to other hosts I want to leave
the Via address to the internal IP address.

If I set the `Advertise` parameter in the bind config, this sets the Via to
the advertised IP, but I'm seeing that address used even when communicating
with hosts on the private IP.

Of course if the IP was on the VM itself I could use $fs or
force_send_socket, but that only works if I've got the public IP bound,
which I can't do.

Is there a simple way to set / override what IP gets baked into the Via
header?

Cheers,
Nick

__________________________________________________________
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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.