[Users] test openser behind NAT not work

somsak vattanavakin somsak at infowavenet.com
Sat Dec 2 06:57:46 CET 2006


Dear All


   i will setup openser behind NAT like these



 OPENSER ---> ADSL ROUTER(A) <---> INTERNET  <---> ADSL ROUTER(B)<-- UAC(1)
                                                                 <-- UAC(2)



 for UAC to talk each others in the same network with OPENSER server  and
try to REGISTER AND INVITE IT OK .

 but if i use UACs that located behind ADSL ROUTER(B) for REGISTER it OK
when UAC(1) INVITE UAC(2) it RING and session established can heard sound

but after about 30 second the CALLEE UAC(2) is HANG UP while CALLER  UAC(1)
still show established

i saw some mail said that the problem may occour from ADSL ROUTER ITSELF
(AGL problem)or some say that ACK problem.  if i connect UAC(1) and UAC(2)
through ADSL ROUTER(B) to iptel.org and i use UAC(1) INVITE UAC(2) it work
no problem  for 30 second disconnection . also if i use UAC(1) and UAC(2)
conect to iptel.org through ADSL ROUTER(A) no problem . AT this point
can I CONCLUDE THAT BOTH ADSL ROUTER  NO PROBLEM FOR SIP CONNECTION. is it
TRUE ??


 Next i saw from LOG file it seem no ACK MESSAGE and error like these
--  LOG FILE -------------
ERROR: tcp_blocking_connect: poll error: flags 18
ERROR: tcp_blocking_connect: SO_ERROR (111) Connection refused
ERROR: tcpconn_connect: tcp_blocking_connect failed
ERROR: tcp_send: connect failed
---

 for simply NAT testing i use openser.cfg like these

---------- OPENSER.CFG ---------
  if (!method=="REGISTER")
     record_route();
  if (loose_route()) {
	# mark routing logic in request
	append_hf("P-hint: rr-enforced\r\n");
	route(1);
     };

  if (!uri==myself) {
	# mark routing logic in request
	append_hf("P-hint: outbound\r\n");
	route(1);
	};

	if (uri==myself) {
	if (method=="REGISTER") {

          	if (!www_authorize("infowavenet.com", "subscriber")) {
				www_challenge("infowavenet.com", "0");
				exit;
			};
                        fix_nated_register();
			save("location");
                        exec_msg("cat >> /tmp/test");
			exit;
		};

		lookup("aliases");
		if (!uri==myself) {
			append_hf("P-hint: outbound alias\r\n");
			route(1);
		};

		# native SIP destinations are handled using our USRLOC DB
		if (!lookup("location")) {
			sl_send_reply("404", "Not Found");
			exit;
		};
		append_hf("P-hint: usrloc applied\r\n");
	};
	route(1);
}


route[1] {
	# send it out now; use stateful forwarding as it works reliably
	# even for UDP2TCP
            fix_nated_contact();
        if(method == "INVITE")
          { fix_nated_sdp("3"); }
  	if (!t_relay()) {
       	sl_reply_error();
	} else { exec_msg("cat >> /tmp/test");}
	exit;
}
------------


MY QUESTION:

  1) can openser server is BEHIND NAT ADSL ROUTER and receive Call from
UAC from other NAT ROUTER .

  2) if so what the problem that CALLEE HANGUP every 30 seconds
   ( i use XLITE v.3 for UAC )

  3) if it possible can you fix openser.cfg that work for this situation



Best

Somsak Vattanavakin




More information about the sr-users mailing list