<DIV>Thanks Greger, </DIV>
<DIV>I will give it a try but I just bump in to problem on one way voice that I want to deal with first. I wll let you know how it turns out, Thanks again..</DIV>
<DIV> </DIV>
<DIV>Thanks<BR><BR><B><I>"Greger V. Teigre" <greger@teigre.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
<DIV>You could move the test on INVITE and call to use_media_proxy(); until you have reached the sections routing to and from the gateway. Of course, calls from the gw could be tested using if (src_ip == ip_address_of_gw). </DIV>
<DIV>Anyway, the idea would be to wait with the call to use_media_proxy until you are sure that these calls are from/to the gateway.</DIV>
<DIV> </DIV>
<DIV>Please remember that all incoming calls to UAs behind symmetric NAT and some combinations with UAs behind port-restricted NAT need to be proxied. If you only proxy gw calls, some ip-to-ip calls will fail.</DIV>
<DIV>g-)</DIV>
<DIV> </DIV>
<DIV>---- Original Message ----<BR>From: Mohamed Omar<BR>To: serusers@lists.iptel.org<BR>Sent: Monday, December 20, 2004 02:41 AM<BR>Subject: [Serusers] NAT & Madia Proxy.<BR><BR>> I'm currently run ser with media proxy and it working fine if I force<BR>> all calls throught the the media proxy... <BR>> <BR>> I want only calls destine to PSTN gateway to go through the media<BR>> proxy for billing purpose and all other calls, I just want to fix the<BR>> NAT and setup the call. I dont want the media to go throught my<BR>> server if it not destine to PSTN network. <BR>> <BR>> Let me know how my config should be...Am new with SER and am stuck on<BR>> this. below is my configure for NAT. <BR>> <BR>> Thanks in Advance.<BR>> <BR>> # -- nat ping --<BR>> modparam("mediaproxy", "natping_interval", 10)<BR>> modparam("mediaproxy", "mediaproxy_socket",<BR>> "/var/run/mediaproxy.sock") <BR>> <BR>> #
------------------------- request routing logic -------------------<BR>> <BR>> # main routing logic<BR>> <BR>> record_route();<BR>> # loose-route processing<BR>> <BR>> if (loose_route()) {<BR>> t_relay();<BR>> break;<BR>> };<BR>> <BR>> # -- nat code --<BR>> if (method == "BYE" || method == "CANCEL") {<BR>>
end_media_session();<BR>> };<BR>> <BR>> if (client_nat_test("3")) {<BR>> if (method == "REGISTER" || !<BR>> search("^Record-Route:")) { <BR>> fix_contact();<BR>>
force_rport();<BR>> };<BR>> };<BR>> <BR>> if (method=="INVITE") {<BR>> use_media_proxy();<BR>> t_on_reply("1");<BR>> setflag(6);<BR>> };<BR>> <BR>> <BR>>
<BR>> # if the request is for other domain use UsrLoc<BR>> # (in case, it does not work, use the following command<BR>> # with proper names and addresses in it)<BR>> if (uri==myself) {<BR>> <BR>> if (method=="REGISTER") {<BR>> <BR>> save("location");<BR>> break;<BR>> };<BR>>
<BR>> # setflag(1);<BR>> <BR>> # native SIP destinations are handled using our<BR>> USRLOC DB <BR>> if (!lookup("location")) {<BR>> log (1, "********************** Rewriting the host:port<BR>> ***********************************"); <BR>> <BR>> rewritehostport ("PSTN Gateway Ip:5060");<BR>> };<BR>> <BR>>
};<BR>> if (method == "INVITE"){<BR>> t_relay();<BR>> sl_send_reply ("180", "Ringing");<BR>> break;<BR>> }<BR>> if (!t_relay()) {<BR>> sl_send_reply("404", "Not Found");<BR>> break;<BR>> };<BR>> <BR>> # -- nat code ----<BR>> }<BR>> <BR>> <BR>> onreply_route[1]
{<BR>> if (status=~"(183)|2[0-9][0-9]") {<BR>> if (client_nat_test("1")) {<BR>> fix_contact();<BR>> };<BR>> use_media_proxy();<BR>> };<BR>> if (status=~"[3-4]0[0-9]") {<BR>> end_media_session();<BR>> break;<BR>> };<BR>> }<BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> Post your free ad now! Yahoo! Canada Personals<BR>> <BR>> <BR>> <BR>> <BR>> _______________________________________________<BR>> Serusers mailing list<BR>> serusers@lists.iptel.org<BR>>
http://lists.iptel.org/mailman/listinfo/serusers</DIV>_______________________________________________<BR>Serusers mailing list<BR>serusers@lists.iptel.org<BR>http://lists.iptel.org/mailman/listinfo/serusers<BR></BLOCKQUOTE><p><br><hr size=1>Post your free ad now! <a href="http://ca.personals.yahoo.com/"><b>Yahoo! Canada Personals</b></a><br>