<HTML>
<HEAD>
<TITLE>Fix_nated_sdp</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi All,<BR>
<BR>
I’ve got a problem with fix_nated_sdp, whenever I call the method in the request route it doesn’t seems to take effect. My INVITE c= & o= list the proxy IP instead of the IP which I’ve set in the method 2nd argument. The weird thing, fix_nated_sdp in my reply route seems to work just fine. Below are part of my scripts:<BR>
<BR>
Route[4] {<BR>
if(to_uri=~"^sip:([A-Z][a-z])([A-Z][a-z]).+@*") <BR>
{<BR>
xlog("L_INFO", "DBG: P2P Call [$fu] -> [$tu]");<BR>
<BR>
if(!lookup("location")) <BR>
{<BR>
xlog("L_INFO", "DBG: P2P Peer not found [$tu] from [$fu]($si)");<BR>
sl_send_reply("404", "User Offline");<BR>
exit;<BR>
}<BR>
<BR>
if(isbflagset(6)) <BR>
{<BR>
xlog("L_INFO", "DBG: NATed P2P Call [$fu] -> [$tu], force RTP");<BR>
fix_nated_sdp(“10”, “$si”);<BR>
}<BR>
}<BR>
}<BR>
<BR>
onreply_route[1]<BR>
{<BR>
if(client_nat_test("7"))<BR>
{<BR>
fix_contact();<BR>
setbflag(6);<BR>
}<BR>
<BR>
if(status=~"(180)|(183)|2[0-9][0-9]")<BR>
{<BR>
if(search("^Content-Type:[ ]*application/sdp"))<BR>
{<BR>
if(isbflagset(6) && (!to_uri=~"sip:[+][0-9][0-9][0-9].+@*"))<BR>
{<BR>
xlog("L_INFO", "DBG: Reply - S=$rs D=$rr F=$fu T=$tu [$rm], force RTP");<BR>
fix_nated_sdp(“10”, “$si”);<BR>
exit;<BR>
}<BR>
} <BR>
}<BR>
<BR>
xlog("L_INFO", "DBG: Reply - S=$rs D=$rr F=$fu T=$tu [$rm]");<BR>
}<BR>
<BR>
E.g:<BR>
INVITE<BR>
y.y.y.y 202.202.202.202 x.x.x.x(external IP)<BR>
A ------------------> Proxy ------------------> B<BR>
c=192.168.1.2 c=202.202.202.202<BR>
o=192.168.1.2 o=202.202.202.202<BR>
<BR>
200 response<BR>
x.x.x.x 202.202.202.202 y.y.y.y (external IP)<BR>
B ------------------> Proxy ------------------> A<BR>
c=192.168.0.2 c=x.x.x.x<BR>
o=192.168.0.2 o=x.x.x.x<BR>
<BR>
Hope there is some gurus out there able to shade some lights.<BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'><BR>
-------------------------------------------------------------------<BR>
Regards,<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>Lawrence Na Chong Guan<BR>
</B></SPAN></FONT><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'>-------------------------------------------------------------------</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>