[Users] fix_nated_contact not rewriting contact?
kjcsb
kjcsb at orcon.net.nz
Wed Sep 13 18:33:30 CEST 2006
I have the following code in openser.cfg
if (client_nat_test("3")) {
#IP address in contact is private IP
#Via is different to address client has contacted us from
#If so then setflag7 to indicate that sender is behind NAT
xlog("client nat test 3 returned true for r-uri <$ru> in
route 3 so will setflag7");
setflag(7);
xlog("contact before update <$ct>");
xlog("via before update <$hdr(via)>");
force_rport();
#Rewrite Contact: header to contain Sip client's public
IP:port
fix_nated_contact();
xlog("contact is now <$ct>");
xlog("via is now <$hdr(via)>");
};
However the value returned by $ct is the same before and after
fix_nated_contact(). Is that because I'm doing something wrong, or because
I've misunderstood fix_nated_contact or because the $ct variable doesn't get
updated by fix_nated_contact? If the latter, how can I find out the result
of fix_nated_contact? The same applies to force_rport and the via details.
Any advice appreciated.
Regards
Cameron
More information about the Users
mailing list