[Serusers] nathelper and rtpproxy for IPv4/IPv6

Curro curro_dominguez at terra.es
Thu May 27 17:35:53 CEST 2004


Hello everybody

I want to use nathelper/rtpproxy to IPv4/IPv6 interworking, but I'm
having some problems.

I use ser 0.8.13-dev-29 (latest from cvs) and latest rtpproxy (20040107)

Ser config file is the same than nathelper example 4to6.cfg

Ser starts ok, UA's registers ok. INVITE, 100 Trying, 180 Ringing are
ok. 
Nathelper rewrites SDP bodies ok. When UA2 answer, it sends 200 ok, UA1
receives 200 OK and sends ACK. This ACK is my problem, because SER drops
it, and never gets UA2.

I suppose that's a problem from my config file, but I can't figure out
what. Could you help me, please?

Thank you very much. 
-------------- next part --------------
#
# $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 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=4
#fork=no
#log_stderror=yes



check_via=no	# (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port= 5060      # Descomentado por mi
#children=4      # Descomentado por mi
#listen=212.166.192.132     # Anadido por mi Era esto, ya funciona
fifo="/tmp/ser_fifo"
fifo_mode=438

listen=2001:618:400::d4a6:c082 10.100.100.130


# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
#loadmodule "/usr/local/lib/ser/modules/mysql.so"

loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
#loadmodule "/usr/local/lib/ser/modules/auth.so"
#loadmodule "/usr/local/lib/ser/modules/auth_db.so"

# Anado modulo para permitir syslog
loadmodule "/usr/local/lib/ser/modules/acc.so"

# Anado modulo que permite presencia
#loadmodule "/usr/local/lib/ser/modules/pa.so"
# Add module nathelper
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
#loadmodule "/usr/local/lib/ser/modules/textops.so"
# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

#modparam("usrloc", "db_mode",   0)

# Uncomment this if you want to use SQL database 
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config), 
# uncomment also the following parameter)
#
#modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
#modparam("rr", "enable_full_lr", 1)

# Anado modulo para permitir log
#modparam("acc","log_level",1)
#modparam("acc","log_flag",1)

# Este modulo seria el que gestiona la presencia
#modparam("pa","default_expires",3600)
#modparam("usrloc","use_domain",1)
#modparam("registrar","use_domain",1)
modparam("nathelper", "natping_interval",15)



# -------------------------  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;
	};

	# 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 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=~"cdshuesca.es") {
	if (method == "REGISTER") {
		if (af == inet) { save ("location-inet4");}
		else if (af == inet6) { save("location-inet6");}
		else {sl_send_reply("403", "Call cannot be served");};
		break;
	};

	if (method == "INVITE") {
		if (lookup("location-inet4")) {
			# Comment out three lines below if you want
			# RTP for IPv4->IPv4 calls to go directly
			# between UAs
			log("            INVITE:esta en IPv4\n");
			if (af == inet)
				if (force_rtp_proxy("FAII"))
					t_on_reply("1");
			if (af == inet6)
				if (force_rtp_proxy("FAEI"))
					t_on_reply("1");
		} else if (lookup("location-inet6")) {
			log("            INVITE:esta en IPv6\n");
			if (af == inet)
				if (force_rtp_proxy("FAIE"))
					t_on_reply("1");
			# Comment out three lines below if you want
			# between UAs
			if (af == inet6)
				if (force_rtp_proxy("FAEE"))
					t_on_reply("1");
		} else {
			sl_send_reply("403", "Call cannot be served here");
			break;
		};
	}
	
	if (method == "BYE" || method == "CANCEL"){
		log("           BYE or CANCEL: han llegado\n");
		unforce_rtp_proxy();
		}

	# Do strict routing if pre-loaded route headers present
	if (loose_route()) {
		t_relay();
		break;
	};
	if (method == "INVITE")
		record_route();
	        if (!t_relay())
	        	sl_reply_error();
}
onreply_route[1] {
	if (!(status=~"183" || status=~"200"))
			
			break;
			
			force_rtp_proxy("FA");
				}
	
	
	



More information about the sr-users mailing list