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
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@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
On 2/22/13 7:37 PM, Olle E. Johansson 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?
loop detection can have several rules. Looking at the stack of Via addresses is not enough usually, it has to check also if the r-uri it is different than previous cycle. It can be coded in configuration file using htable, but I guess it can get in some level of complexity when having to deal with parallel forking. Perhaps a config function doing all the logic inside would be nicer, but considering that max forwards does the job at some point, nobody spent the time for something else.
Cheers, Daniel