hi all, Thanx Klaus. Sorry to ask a question again related to the same problem. I had already tried writing the avp_write after lookup but even that causes a problem. When avp_write is done it writes the private IP address of the callee while the source_ip is the IP address of the NAT. I beleive this IP address is written because of the fix_nated_contact. Again, when avp_check is done, it returns false and again the RTP session gets started. IS there any way out to this problem. Thanx again.. Jayesh
--------------------------------- Start your day with Yahoo! - make it your home page
If oyu use fix_nated_contact for REGISTER messages, than it should work.
If ouy use fix_nated_register, it will not work. We would need a pseudo variable which points to the received-socket. Maybe the core developers can help you on this.
regards klaus
jayesh nambiar wrote:
On 08/18/05 13:24, Klaus Darilion wrote:
There is a pseudo variable $du that points to destination uri (dst_uri filed of sip_msg structure - the address where the sip message will be sent after a loose_route() or lookup() request for callee behind the nat).
So, if the callee is behind the nat, the dst_uri is set to the address and port of the NAT. To check it, copy $du in an avp, use avp_subst() to extract the ip address and and compare it with src_ip.
avp_printf("i:20","$du"); avp_subst("i:20/d","/.*([1-9][0-9]{1,2}.[1-9][0-9]{1,2}.[1-9][0-9]{1,2}.[1-9][0-9]{1,2}).*"/\1/); if(avp_check("i:20","eq/$src_ip")) { # src_ip is the same with destination ip }
Looking at this issue, I am wondering if worth to add the pseudovariables $dh and $dp for destination host and port ... Also I am considering to change a bit the $du reference so when the dst_uri is not set to point to request URI. Would be these changes usefully?
Daniel
Hello,
I just added a pseudovariable to get the ip/host address from dst_uri. Now it should be less complex to do the check.
avp_printf("i:20","$dd"); if(avp_check("i:20","eq/$src_ip")) { # src_ip is the same with destination ip }
Fore more see: http://openser.org/pipermail/users/2005-August/000681.html
Daniel
On 08/18/05 20:53, Daniel-Constantin Mierla wrote: