Hi Takeshi, First of all, you want to do the detection for the initial requests or for sequential requests only?
But going to the bottom, you should do the fixing only if the contact show "signs" of NAT presence (network level or private ips) - so you should not rely on the position of your proxy in the chain, but on the actual information from the messages. Regards, Bogdan mayamatakeshi wrote: > > On Fri, Oct 30, 2009 at 7:54 PM, mayamatakeshi > <[email protected] <mailto:[email protected]>> wrote: > > Hello, > is there an easy way to check if my opensips instance is the last > proxy before the UAS? > I need this to avoid calling nat_uac_test/fix_nated_contact in my > onreply_route in case I'm receiving a response relayed by another > proxy. > I was thinking I could test if i'm in the top-most Record-Route in > the reply, but I was unable to figure out how to do it. > > > Reading the page about transformations, I think something like this > would work: > > if ( $(hdr(Record-Route)[0]{uri.host}) == myself ) { > .... > } > > However, I think to implement a generic way to handle this would > become very convoluted: I was thinking that I should do this > considering the possibility of dealing with redirection and downstream > proxies that would do not record_route or would do it conditionally. > So I would have to check this, set some parameter in Record-Route, > take care in case of branching and checking the Route header etc, etc. > But I think this is a lot of trouble and will not actually happen in > our network. > So I will write my cfg just testing: > > if ( !from_gw() ) { > fix_nated_contact(); > } > > because I just need to fix the contact of the registered users. > -- Bogdan-Andrei Iancu www.voice-system.ro _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
