[OpenSIPS-Users] No ACK send after SIP OK

Erik Wölfel e.woelfel at atlasinteractive.de
Thu Feb 17 16:39:34 CET 2011


Hi Guys,

my scneario is the following:

UA -------> Opensips 1.6.24 --------> Asterisk 1.4.23

Im using drouting to do failover to my Asterisk Machines (10.0.20.124:5060,10.0.20.134:5060,10.0.20.131:5060).
Opensips runs on 10.0.20.124:5080. When routing to the asterisk on the same machine it works like a charm.
When routing to machines with other ips than my own, the following scenario accurs:

Opensips	Asterisk
INVITE --------->
<---------------SIP OK
---> ACK
<---------------SIP OK
---> ACK
<---------------SIP OK
---> ACK
<---------------SIP OK
---> ACK

So the SIP OK will be retransmitted 6 times after the channel hangs up. In the logs of opensips i see the SIP OK is getting there and an ACK will be transmitted to the correct IP. It never arrives though.
I've already tried using a nat account on the asterisk. It doesn't work.
What am I doing wrong?

Please find my route conf below:

route{

	if(!allow_routing())
	{	sl_send_reply("503","Service Unavailable");
		exit;
	}

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

	#initial requests

	# CANCEL processing
	if (is_method("CANCEL")) {
		if (t_check_trans())
			t_relay();
		exit;
	}

	t_check_trans();

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

	if (loose_route()) {
		xlog("loosing route\n");
		# 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(method=="INVITE"){
		route(4);
	}

	# with proper names and addresses in it)
	if (uri==myself) {

		# presence handling

		if (method=="REGISTER") {
			# Uncomment this if you want to use digest authentication
			save("location");
			if (!www_authorize("", "subscriber")) {
				www_challenge("", "0");
				exit;
			};


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

}

route[1] {
	if (!t_relay()) {
		sl_reply_error();
	};
	exit;
}

#dynamische route
route[4] {
	rewritehostport("10.0.20.134:5060");
  	if (!do_routing("0")) {
    	send_reply("503", "No Rules matching the URI");
    	exit;
  	}

  	if (is_method("INVITE")) {
    		t_on_failure("4");
  	}
  	route(1);
}
onreply_route[2]{
	xlog("L_INFO","Got reply 2\n");
}

failure_route[1] {
	if (t_was_cancelled()) {
        exit;
    }
}
branch_route[2]{
	xlog("L_INFO","branching route 2\n");
}
branch_route[4]{
	xlog("L_INFO","branching route 4\n");
}
failure_route[4] {
	xlog("L_INFO","having failure route 4\n");
  	if (t_was_cancelled()) {
  		xlog("L_INFO","route 4 cancelled\n");
        exit;
    }
    if (use_next_gw()) {
			xlog("next gw\n");
       		t_relay();
       		xlog("relay done\n");
       		exit;
  		 } else {
       		t_reply ("503", "Service not available");
       		exit;
   	}
	if (t_check_status("[34][0-9][0-9]")) {
        exit;
    }
}

Best Regards
Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110217/9eebd716/attachment-0001.htm>


More information about the Users mailing list