[SR-Users] Loop detection in Kamailio

Stoyan Mihaylov stoyan.v.mihaylov at gmail.com
Mon Feb 25 17:12:20 CET 2013


I had problems with loop but only for ACK and BYE messages.
Whole my system looks like
SIP Users (many) <->Kamailio<->Asterisk (one or more servers)
I am using Kamailio for load balance and registration, and everything
else will be done from one or more Asterisk servers
When I have INVITE:
	if(is_method("INVITE")){
		ds_select_dst("1","4");
		$sht(forw=>$ft)=$du;
And then when I have ACK or BYE:

route[ACKBYE] {
#!ifdef WITH_MYFORWARD
	if(($sht(forw=>$ft))=~$td){
		$du=$sht(forw=>$ft);
	}else if((($td=="sip.stribogkonsult.com")||($td=="85.130.96.243"))&&($si=="85.130.96.243")){
		$du=$sht(forw=>$ft);
		return;
	}
#!endif
	return;
}
In general - if $td == $si - I am in big trouble (loop) and then I am
using stored in variable (forw), IP address of Asterisk (it works with
many Asterisk servers behind one Kamailio).
I store IP in variable (forw) during INVITE.



On Fri, Feb 22, 2013 at 8:37 PM, Olle E. Johansson <oej at edvina.net> wrote:
> Hi!
>
> I can see that there's been some discussion about SIP loop detection on the OpenSER and SER mailing lists, but I must have missed the conclusion. Apart from setting a max-forwards, how would you configure your Kamailio server to prevent looping?
>
> Regards,
> /O
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list