[OpenSIPS-Users] Question about NAT

Johan De Clercq johan at democon.be
Mon Mar 14 18:01:03 CET 2016


Hello Travis,

I miss rtpproxy and I miss Nat handling.

see if this helps :
http://opensips.org/pipermail/users/2011-January/016130.html

BR

2016-03-14 17:36 GMT+01:00 Travis Manson-Drake <travism at simplybits.com>:

> Hello Everyone!
>
>
>
> Quick question, it seems the proxy is trying to forward request’s to my
> Host’s private IP addresses versus the IP of the router their behind. Is
> there something I have to add to my routing logic to have it route to the
> host’s public IP versus private? I was thinking of a rewrite host port but
> don’t know how I would do that dynamically per transaction.
>
>
>
> Any suggestions would be incredibly appreciated!
>
>
>
> Also for reference here’s my routing logic.
>
>
>
>
>
> #default routing logic
>
>
>
> route
>
> {
>
>
>
>
>
>         if (!mf_process_maxfwd_header("10"))
>
>
>
>                 {
>
>                         sl_send_reply("483","Too Many Hops");
>
>                         exit;
>
>                 }
>
>
>
>         if (cache_fetch("local",'$fU',$avp(PBX)))
>
>                 {
>
>                         $rd = $avp(PBX);
>
>                         xlog("this is the Value of the Cache_local r-uri
> domain: $avp(PBX) for $fU");
>
>                 }
>
>         else
>
>                 {
>
>                         avp_db_query("select Servers.ipaddress from
> Servers where Servers.ID in (select phone.ServerID from phone where
> phone.mac in (select MAC FROM `phone_registrations` where auth_userid =
> '$(fU{s.escape.common})'))", "$avp(PBX)");
>
>                         cache_store("local",'$fU',"$avp(PBX)");
>
>
>
>                         xlog("this is the Value of the AVP_DB_Querry r-uri
> domain: $rd for $fU");
>
>                         xlog("this is the Value of the AVP_DB_Querry
> pseudo variable: $avp(PBX) for $fU");
>
>                 }
>
>
>
>         if ($ct.fields(expires) == '0')
>
>                 {
>
>                 cache_remove("local",'$fU');
>
>                 exit;
>
>                 }
>
>
>
>                 if (is_method("OPTIONS"))
>
>                         {
>
>                         record_route();
>
>                         t_relay();
>
>                         }
>
>
>
>                 if (is_method("REGISTER"))
>
>                         {
>
>                         record_route();
>
>                         route(register);
>
>                         }
>
>
>
>                 if (is_method("INVITE")) && ($rd=="67.212.192.82")
>
>                        {
>
>                         record_route();
>
>                         route(inbound);
>
>                         }
>
>
>
>                 if (is_method("INVITE")) && (!$rd=="67.212.192.82")
>
>                         {
>
>                         record_route();
>
>                         route(outbound);
>
>                         }
>
>
>
>                 if (is_method("CANCLE"))
>
>                         {
>
>                         if (t_check_trans())
>
>                         t_relay();
>
>                         exit;
>
>                         }
>
>
>
>                 if (is_method("TRANSFER"))
>
>                         {
>
>                         record_route();
>
>                         route(xfer);
>
>                         }
>
>
>
>
>
>
>
> }
>
>
>
> #ROutes Below
>
>
>
> route[register]
>
>         {
>
>                 $rU = $fU;
>
>                 $rd = $avp(PBX);
>
>                 t_relay();
>
>                 xlog("this is what were sending as our R-URI to the PBX
> for REGISTER: $ru  ");
>
>         }
>
>
>
> route[inbound]
>
>         {
>
>                 #$rU = $fU;
>
>                 #$rd =$avp(PBX);
>
>                 t_relay();
>
>         }
>
> route[outbound]
>
>         {
>
>                 #$rU = $fU;
>
>                 #$rd =$avp(PBX);
>
>                 t_relay();
>
>         }
>
>
>
> route[xfer]
>
>         {
>
>                 $rU = $fU;
>
>                 $rd = $avp(PBX);
>
>                 t_relay();
>
>         }
>
>
>
>
>
>
>
> Travis Manson-Drake
> Voice Systems Analyst
>
>
>
> Simply Bits, LLC
> T: 520.545.0311  F: 520.545.7252
> E: travism at simplybits.com
> 5225 N. Sabino Canyon Road
> Tucson, AZ 85750
> Support Hotline: 520.545.0333
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160314/46d684ec/attachment.htm>


More information about the Users mailing list