[SR-Users] SIP re-invite Packets

Alex Balashov abalashov at evaristesys.com
Tue Jul 17 15:24:38 CEST 2018


On Tue, Jul 17, 2018 at 04:21:25PM +0300, Ali Taher wrote:

> Can you please send me a simplified config that suit my case ?

Try this for a main request route:

---

route {
	if(!mf_process_maxfwd_header("10")) {
		sl_send_reply("483", "Too Many Hops");
		exit;
	}

	# Maybe some sanity_check() here. 

	if(has_totag()) {
		if(loose_route()) {
			if(!t_relay())
				sl_reply_error();

			exit;
		} else {
			if(is_method("ACK")) {
				if(t_check_trans())
					t_relay();
			} else
				sl_send_reply("403", "Forbidden");
		}

		exit;
	}

	# CANCELs / branches.

	if(is_method("CANCEL")) {
		if(!t_relay_cancel()) {
			sl_send_reply("500", "Server Internal Error");
			exit;
		}

		exit;
	}

	t_check_trans();

	if(is_method("OPTIONS")) {
		sl_send_reply("200", "OK");
		exit;
	} 
	
	else if(is_method("INVITE")) {
		# Route your calls.

		exit;
	}

	sl_send_reply("403", "Method unsupported");
	exit;
}


-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list