Juha Heinanen writes:
- when request comes in, script always calls alias_contact() on it. alias_contact() checks if request has contact header and if not, does nothing. if request has contact header, alias_contact() adds ;alias=ip:port param to contact uri containing received ip:port if contact ip:port does not match received ip:port. otherwise it does nothing.
turns out that there already exists a nathelper function very close to what i propose above: add_rcv_param(). the difference is that it does not check if there is a need to add any. also, nat_uac_test() does not have that kind of test (contact ip:port matches received ip:port).
-- juha