[Users] function client_nat_test problem

unplug maillisting at gmail.com
Tue Apr 11 03:58:51 CEST 2006


below is the configuration

Internet --- openser (mediaproxy) ---- PSTN
                      + public IP (203.13.14.210)
                      + Internal IP (10.0.0.30)
openser will list on both internal and external IP

User can make/receive call without problem.
user device --- NAT -------------------------------------- openser ---- PSTN
(10.0.0.60)            (202.130.10.200)               (203.13.14.210)


user device ------------------------------------------------  openser ---- PSTN
(10.0.0.60)                                                     (10.0.0.30)
User can receive call without problem.
However, when user makes outgoing calls, problem will occur.
1. called party will ring but calling party without ring.
2. After pick up the phone, both parties can't hear any sound.

>From the past experience, the problem should be caused by the NAT issue.
In my dial plan, I use a module function client_nat_test("3").

        if (method=="INVITE" && client_nat_test("3")) {
                # INSERT YOUR IP ADDRESS HERE
                record_route_preset("203.13.14.210:5060;nat=yes");
        } else if (method!="REGISTER") {
                record_route();
        };

>From the function description
http://openser.org/docs/modules/devel/mediaproxy.html#AEN113, it will
test if the client is behind NAT or not.  However, in the result of
ngrep, I can still find the header with the following.
Record-Route: <sip:203.13.14.210:5060;nat=yes;ftag=nQvg2qq2fzNg24d1;lr=on>
That's mean function client_nat_test always return true (from the case
above) no matter client is behind NAT.

It is what I find up to now.  I would like to ask whether there is any
other configuration variables needed for the NAT detection.  How the
mediaproxy module (based on what) to detect the device is behind NAT
or not?  Any clue is welcome.




More information about the sr-users mailing list