[Serusers] SER + Asterisk; BYE gets 404

Bart J. Smit bart at smits.co.uk
Tue Mar 7 18:43:40 CET 2006


I am running ser 0.9.6 on CentOS 4.2 with asterisk on the same box
listening on 5065.

When I register a phone with ser, I can call XXXX at pbx.nexusmgmt.com and
these calls are forwarded to the asterisk on a forward(<external
IP>,5065). I've attached my full routing block below.

After hanging up from either phone, the BYE packet never gets delivered.
It shows up in ethereal as being addressed to the external IP address of
the box and it gets a 404 in reply.

When I register a phone directly with the Asterisk, I can hang up from
either end as normal, so the issue must be with ser.

Any hints on how I can route the BYE packets correctly?

Thanks,

Bart...


route {

	#
-----------------------------------------------------------------
	# Sanity Check Section
	#
-----------------------------------------------------------------
	if (!mf_process_maxfwd_header("10")) {
		sl_send_reply("483", "Too Many Hops");
		break;
	};

	if (msg:len > max_len) {
		sl_send_reply("513", "Message Overflow");
		break;
	};
	#
-----------------------------------------------------------------
	# Record Route Section
	#
-----------------------------------------------------------------
	if (method!="REGISTER") {
		record_route();
	};

	#
-----------------------------------------------------------------
	# Loose Route Section
	#
-----------------------------------------------------------------
	if (loose_route()) {
		t_relay();
		break;
	};

	#
-----------------------------------------------------------------
	# Call Type Processing Section
	#
-----------------------------------------------------------------
	if (uri=~"sip:[0-9]{4}@pbx\.nexusmgmt\.com") {
		forward(65.126.236.148,5065);
		break;
	};
	if (uri!=myself) {
		route(1);
		break;
	};

	if (method=="CANCEL") {
		route(1);
		break;
	} else if (method=="INVITE") {
		route(3);
		break;
	} else  if (method=="REGISTER") {
		route(2);
		break;
	};

	lookup("aliases");
	if (uri!=myself) {
		route(1);
		break;
	};

	if (!lookup("location")) {
		sl_send_reply("404", "User Not Found");
		break;
	};

	route(1);
}

route[1] {

	#
-----------------------------------------------------------------
	# Default Message Handler
	#
-----------------------------------------------------------------

	t_on_reply("1");

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

route[2] {

	#
-----------------------------------------------------------------
	# REGISTER Message Handler
	#
----------------------------------------------------------------

	sl_send_reply("100", "Trying");

	if (!www_authorize("","subscriber")) {
		www_challenge("","0");
		break;
	};

	if (!check_to()) {
		sl_send_reply("401", "Unauthorized");
		break;
	};

	consume_credentials();

	if (!save("location")) {
		sl_reply_error();
	};
}

route[3] {

	#
-----------------------------------------------------------------
	# INVITE Message Handler
	#
-----------------------------------------------------------------

	if (!proxy_authorize("","subscriber")) {
		proxy_challenge("","0");
		log(1,"authenticate please\n");
		break;
	} else if (!check_from()) {
		sl_send_reply("403", "Use From=ID");
		break;
	};

	lookup("aliases");
	if (uri!=myself) {
		route(1);
		break;
	};

	if (!lookup("location")) {
		sl_send_reply("404", "User Not Found");
		break;
	};

	route(1);
}




More information about the sr-users mailing list