[Serusers] [Fwd: nathelper with force_rtp_proxy and a working mysql]

Jan Janak jan at iptel.org
Mon Oct 27 10:01:18 CET 2003


Hello,

I see. Sorry, but we can't keep the unstable branch always working since
it is our development playground.

I started to commit the db changes on 24th, so you can try to check out
version from 23rd.

  Jan.

On 27-10 00:53, Jac Barben wrote:
> 
> 
> -------- Original Message --------
> Subject: nathelper with force_rtp_proxy and a working mysql
> Date: Mon, 27 Oct 2003 00:45:38 -0700
> From: Jac Barben <jbarben at claritytel.com>
> To: Jan Janak <jan at iptel.org>
> 
> 
> 
> Jan:
> 
> Thanks for your last reply... I hope you didn't spend to much time on my 
> last message... I since found that issue on my own.
> 
> Jan, I've been playing with the published  0.8.11 per your suggestion 
> and found that force_rtp_proxy is not part of the release.
> 
> I've been monkeying all weekend with the latest developments from the 
> CVS... but have been unable to get it all to work together.
> 
> Right now I'm stuck on an apparent database issue:
> 
> Oct 27 00:22:19 sip2 /usr/local/sbin/ser[31731]: INFO: signal 15 received
> Oct 27 00:23:08 sip2 /usr/local/sbin/ser[31738]: mod_init(): Can't bind 
> database module
> Oct 27 00:23:08 sip2 /usr/local/sbin/ser[31738]: init_mod(): Error while 
> initializing module usrloc
> Oct 27 00:34:26 sip2 /usr/local/sbin/ser[31772]: mod_init(): Can't bind 
> database module
> Oct 27 00:34:26 sip2 /usr/local/sbin/ser[31772]: init_mod(): Error while 
> initializing module usrloc
> "/var/log/messages" 88L, 7929C
> 
> Any suggestions on a version of the code I could try with all elements 
> working?  I saw on the web some reference to a developer who'd used a 
> "diff" file against the nathelper.c for the released version of 
> 0.8.11... but I was unable to find it.  I'd really like to try it all. 
> What should I do next?
> 
> J
> 
> 
> 
> 
> 
> 

> #
> # $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
> #
> # simple quick-start config script
> #
> 
> # ----------- global configuration parameters ------------------------
> 
> #debug=3         # debug level (cmd line: -dddddddddd)
> #fork=yes
> #log_stderror=no	# (cmd line: -E)
> 
> /* Uncomment these lines to enter debugging mode 
> debug=7
> fork=no
> log_stderror=yes
> */
> 
> check_via=no	# (cmd. line: -v)
> dns=no           # (cmd. line: -r)
> rev_dns=no      # (cmd. line: -R)
> #port=5060
> #children=4
> fifo="/tmp/ser_fifo"
> alias="claritycolorado.com"
> 
> # ------------------ module loading ----------------------------------
> 
> loadmodule "/usr/local/lib/ser/modules/mysql.so"
> loadmodule "/usr/local/lib/ser/modules/usrloc.so"
> loadmodule "/usr/local/lib/ser/modules/nathelper.so"
> loadmodule "/usr/local/lib/ser/modules/textops.so"
> loadmodule "/usr/local/lib/ser/modules/tm.so"
> loadmodule "/usr/local/lib/ser/modules/rr.so"
> loadmodule "/usr/local/lib/ser/modules/registrar.so"
> loadmodule "/usr/local/lib/ser/modules/sl.so"
> 
> loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
> 
> loadmodule "/usr/local/lib/ser/modules/auth.so"
> loadmodule "/usr/local/lib/ser/modules/auth_db.so"
> 
> # ----------------- setting module-specific parameters ---------------
> 
> # -- usrloc params --
> 
> modparam("usrloc", "db_mode", 2)
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
> modparam("rr", "enable_full_lr", 1)
> modparam("nathelper", "natping_interval", 10)
> 
> # -------------------------  request routing logic -------------------
> 
> # main routing logic
> 
> route{
> 	# initial sanity checks -- messages with
> 	# max_forwards==0, or excessively long requests
> 	if (!mf_process_maxfwd_header("10")) {
> 		sl_send_reply("483","Too Many Hops");
> 		break;
> 	};
> 	if (msg:len >= max_len ) {
> 		sl_send_reply("513", "Message too big");
> 		break;
> 	};
> 
> 	# Enable some NAT traversal help
> 	if (search("@192.*")) {
> 		setflag(1);
> 		force_rport();
> 		fix_nated_contact();
> 	};
> 
> 	# we record-route all messages -- to make sure that
> 	# subsequent messages will go through our proxy; that's
> 	# particularly good if upstream and downstream entities
> 	# use different transport protocol
> 	record_route();	
> 	# loose-route processing
> 	if (loose_route()) {
> 		t_relay();
> 		break;
> 	};
> 
> 	if (method == "INVITE") {
> 		if (isflagset(1)) {
> 			fix_nated_sdp("3");
> 			force_rtp_proxy();
> 		};
> 		t_on_reply("1");
> 	};
> 
> 	# if the request is for other domain use UsrLoc
> 	# (in case, it does not work, use the following command
> 	# with proper names and addresses in it)
> 	if (uri==myself) {
> 		if (method=="REGISTER") {
> 			if (!www_authorize("claritycolorado.com", 
> 				"subscriber")) {
> 				www_challenge("claritycolorado.com", "0");
> 				break;
> 			};
> 
> 			save("location");
> 			break;
> 		};
> 
> 		# These would be destinations dialed from the 
> 		# ATA devices bound for the Vega
> 		if (uri=~"^sip:303" || uri=~"^sip:720" || 
> 			uri=~"^sip:213417" || uri=~"^sip:86") 
> 		{
> 			t_relay_to_udp("64.140.77.59", "5060");
> 			break; 
> 		};
> 		if (uri=~"^sip:1")
> 		{
> 			t_relay_to_udp("64.140.77.59", "5060");
> 			break; 
> 		};
> 
> 
> 		# Force routes to Cisco
> 		# These would be numbers dialed from the Vega
> 		# or another ATA device
> 		if (uri=~"^sip:011") {
> 			if (uri=~"^sip:011") {
> 				strip(3);
> 			};
> 			prefix("2826");
> 			t_relay_to_udp("209.170.94.124", "5060");
> 			break; 
> 		};
> 		if (uri=~"^sip:9011") {
> 			strip(4);
> 			prefix("2826");
> 			t_relay_to_udp("209.170.94.124", "5060");
> 			break; 
> 		};
> 		if (uri=~"^sip:91") {
> 			strip(1);
> 			prefix("2826");
> 			t_relay_to_udp("209.170.94.124", "5060");
> 			break; 
> 		};
> 
> 		if (uri=~"^sip:81") {
> 			strip(1);
> 			t_relay_to_udp("198.79.3.246", "5060");
> 			break;
> 		};
> 
> 		# These would be our IPBX numbers dialed from the Vega
> 		# or another ATA device
> 		if (uri=~"^sip:4729") {
> 			strip(4);
> 		};
> 		if (uri=~"^sip:4728") {
> 			strip(4);
> 		};
> 
> 		# native SIP destinations are handled using our USRLOC DB
> 		if (!lookup("location")) {
> 			sl_send_reply("404", "Not Found");
> 			break;
> 		};
> 	};
> 	# forward to current uri now; use stateful forwarding; that
> 	# works reliably even if we forward from TCP to UDP
> 	if (!t_relay()) {
> 		sl_reply_error();
> 	};
> }
> 
> onreply_route[1] {
>         if (status=~"2[0-9][0-9]" && search("@192.*")) {
>                 fix_nated_contact();
>                 fix_nated_sdp("3");
> 		force_rtp_proxy();
>         };
> }
> 

> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list