[OpenSER-Users-ES] Llamadas OpenSER a Asterisk

Mariam M. T. mariam_mt_05 at hotmail.com
Tue Feb 12 01:09:01 CET 2008


como estan. Ayuda por favor. Espero alguien me pueda ayudar donde esta mi error de configuracion.  He intentado hacer llamadas de usuario de Openser a Usuarios de Asterisk y lo unico que consigo es "Not Found" . Las llamadas entre los usuarios de Openser me funciona normal

Mis usuarios de OPenSER tienen la extension de 2000 a 2999 y
Mis usuarios de Asterisk tienen la extension de 1000 a 1999

Openser y asterisk estan en la misma PC con una IP publica, y tambien RTPProxy.

les adjunto mi config de OpenSER. Muchas Gracias de Antemano.



# ----------- global configuration parameters ------------------------

debug=7            # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=yes # (cmd line: -E)
listen=200.28.82.6

/* Uncomment these lines to enter debugging mode 
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

# --- module loading

mpath="//lib/openser/modules/"

loadmodule "mysql.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "nathelper.so"
loadmodule "acc.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "mi_fifo.so"
loadmodule "xlog.so"
loadmodule "presence.so"

# --- setting module parameters

# -- mi_fifo params --
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")

modparam("usrloc|auth_db","db_url","mysql://openser:openserrw@localhost/openser")

# -- usrloc params --
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "nat_bflag", 6)

# -- registrar params --
modparam("registrar|nathelper", "received_avp", "$avp(i:42)")

# -- auth params --
#modparam("auth_db", "calculate_ha1", no)
#modparam("auth_db", "password_column", "ha1")
#modparam("auth_db", "password_column_2", "ha1b")

modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

# -- rr params --
modparam("rr", "enable_full_lr", 1)

# -- presence params --
modparam("presence", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("presence", "max_expires", 3600)
modparam("presence", "force_active", 1)
modparam("presence", "server_address", "sip:200.28.82.6:5060")

# -- nathelper params ---

modparam("nathelper", "rtpproxy_sock", "udp:127.0.0.1:7890")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from", "sip:200.28.82.6")

# --- main routing logic
route{

	
	if (!mf_process_maxfwd_header("10")) {
		sl_send_reply("483","Too Many Hops");
		exit;
	};
	if (msg:len>=  2048 ) {
		sl_send_reply("513", "Message too big");
		exit;
	};

	# NAT detection
	
	route(2);

	if (!method=="REGISTER")
		record_route();

	if (loose_route()) {
		append_hf("P-hint: rr-enforced\r\n"); 
		route(1);
	};

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

	if (uri==myself) {
		# presence handling
		if (is_method("PUBLISH|SUBSCRIBE")) {
			route(4);
		}
				
		if (method=="REGISTER") {
			if (!www_authorize("", "subscriber")) {
				www_challenge("", "0");
				exit;
			};
			
			if (isflagset(5)) {
				# set branch flag -- when someone will call this user
				# the INVITE will have branch flag 6 set after lookup("location")
				setbflag(6);
				# if you want OPTIONS natpings uncomment next
				# setbflag(7);
			};
			save("location");
			exit;
		};

		if (!lookup("location")) {
			sl_send_reply("404", "Not Found");
			exit;
		};
		append_hf("P-hint: usrloc applied\r\n"); 
		
		if (method=="INVITE") {
			if (uri=~"^sip:[1][0-9]{3}@.*"){
				xlog("L_INFO","$Cbx--- LLAMADA A ASTERISK ---$Cxx\n");
				xlog("L_INFO","$Cbx---> Redirigiendo a Asterisk...$Cxx\n");
				rewritehostport("200.28.82.6:5070");
				route(1);
				exit;
			};
		};

	};

	route(1);
}


route[1] {
	if (subst_uri('/(sip:.*);nat=yes/\1/')){
		setbflag(6);
	};

	if (isflagset(5)||isbflagset(6)) {
		route(3);
	}

	if (!t_relay()) {
		sl_reply_error();
	};
	exit;
}

route[2]{
	force_rport();
	if (nat_uac_test("19")) {
		if (method=="REGISTER") {
			fix_nated_register();
		} else {
			fix_nated_contact();
		};
		setflag(5);
	};
}


route[3] {
	if (is_method("BYE|CANCEL")) {
		unforce_rtp_proxy();
	} else if (is_method("INVITE")){
		force_rtp_proxy();
		t_on_failure("2");
	
	};
	if (isflagset(5))
		search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
	t_on_reply("1");
}

#presence handling route

route[4] {
	# absorb retransmissions
	if (!t_newtran())
	{
		sl_reply_error();
		exit;
	};

	if (is_method("PUBLISH"))
	{
		handle_publish();
		t_release();
	}else if (is_method("SUBSCRIBE")) {
		handle_subscribe();
		t_release();
	};
	exit;
}


failure_route[2] {
	if (isbflagset(6) || isflagset(5)) {
		unforce_rtp_proxy();
	}
}

onreply_route[1] {
	if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
		force_rtp_proxy();
	}
	search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');

	if (isbflagset(6)) {
		fix_nated_contact();
	}
	exit;
}


el config de mi SIP.CONF de Asterisk es la siguiente

[desde_openser] 			
type=friend 
context=llamadas_desde_openser
insecure=port,invite 
externalnotify=yes 
allow=all 
host=200.48.82.56:5060


_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline



More information about the Users-es mailing list