<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">(Shooting from the hip, but let’s brainstorm just for fun :-) )</div><div class=""><br class=""></div>I would consider not saving the incoming REGISTER in the Kamailio location database,<div class="">notfork it but replicate or forward twice to the ASterisk servers. Keep a counter - maybe in a hash table - </div><div class="">and when the first 200 ok come in, raise the counter and then drop it.</div><div class=""><br class=""></div><div class="">When the second response comes in, save to kamailio location database (yes, it works on a response) and</div><div class="">then forward the response to the client. Note that you may end up in trouble unless you are really sure</div><div class="">that all servers have exactly the same expiry time.</div><div class=""><br class=""></div><div class="">Whatever you do you will have a UA that retransmits unless you respond with some 1xx code and</div><div class="">a situation where you may timeout the UA before you time out on Asterisk - so trim the Kamailio</div><div class="">transmit timer to be very short, much shorter than the UA so you make sure that Kamailio times out</div><div class="">way ahead of your UA.</div><div class=""><br class=""></div><div class="">Now, you can have a timeout on htable so that you catch the situation where you don’t get any</div><div class="">response from Asterisk and do something about it - tell the UA to come back in a while</div><div class="">with a retry-after or something else.</div><div class=""><br class=""></div><div class="">I am pretty sure I am missing something here, but it may give you some ideas to test out.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">/O</div><div class=""><br class=""></div><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 27 Jul 2016, at 14:38, Jonathan Hunter <<a href="mailto:hunterj91@hotmail.com" class="">hunterj91@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hello,<div class=""><br class=""></div><div class="">Thanks for the response.</div><div class=""><br class=""></div><div class="">I appreciate your comments and agree, however the architecture cannot be changed currently so in the meantime its looking to apply a fix to allow for stability in the short term.</div><div class=""><br class=""></div><div class="">I have built/designed other platforms and registrations don't go anywhere near the Media servers,  so it is a case of working with what we have for the short term due to a number of reasons I wont go into. :)</div><div class=""><br class=""></div><div class="">Understand where your coming from however.</div><div class=""><br class=""></div><div class="">Jon</div><div class=""><br class=""></div><div class=""><br class=""><br class=""><div class=""><hr id="stopSpelling" class="">From:<span class="Apple-converted-space"> </span><a href="mailto:oej@edvina.net" class="">oej@edvina.net</a><br class="">Date: Wed, 27 Jul 2016 14:17:14 +0200<br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:sr-users@lists.sip-router.org" class="">sr-users@lists.sip-router.org</a><br class="">Subject: Re: [SR-Users] Checking for 200ok Response to a REGISTER request kamailio-Asterisk<br class=""><br class=""><br class=""><div class=""><blockquote class=""><div class="">On 27 Jul 2016, at 14:01, Jonathan Hunter <<a href="mailto:hunterj91@hotmail.com" class="">hunterj91@hotmail.com</a>> wrote:</div><br class="ecxApple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class=""><div class=""><br class="ecxApple-interchange-newline">Hi Guys,</div><div class=""><br class=""></div><div class="">So currently on our network we have a kamailio server which users register against, we then replicate the register messages to 2 Asterisk boxes sat behind it so that all entities are aware of the registration state of the users.</div><div class=""><br class=""></div><div class="">REGISTER--->KAMAILIO---->ASTERISK A</div><div class="">                    ---->ASTERISK B</div><div class=""><br class=""></div><div class="">With a REGISTER---200OK exchange between Kamailio and Asterisk.</div><div class=""><br class=""></div><div class="">We have an issue where at some points the Asterisk servers when under load dont respond with a 200 ok(something being investigated)  to the register messages sent to kamailio, so I am just working on some logic for the register message to be resent using the t_replicate and t_set_fr functions.</div><div class=""><br class=""></div><div class="">This works well should both Asterisk servers not respond, however, as I am using replicate and it is parallel forking, if say Asterisk A answers first and is available with a 200ok then that in turn cancels the register message branch being sent to Asterisk B(which I know is fine), however  there could be a scenario where Asterisk B doesnt respond, and we wont know about it to try and resend the Register message, as the branch is cancelled.</div><div class=""><br class=""></div><div class="">Hope that makes sense?</div><div class=""><br class=""></div><div class="">I am looking at checking that both the Asterisk servers have responded and sent a 200ok, which I can grab in an onreply route but Im just wondering if someone has done something similar or has any suggestions as it is tricky to achieve currently.</div><div class=""><br class=""></div><div class="">I have also thought about stateless working but I really need kamailio to keep retransmitting the register until it gets a response.</div><div class=""><br class=""></div><div class="">Many thanks</div></div></div></div></blockquote><br class=""></div><div class="">In my view you are making a very complex solution. Why do you need to store the same registration in so many places? That’s </div><div class="">indicating a problem in the architecture.</div><div class=""><br class=""></div><div class="">/O</div><br class=""><br class="">_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<span class="Apple-converted-space"> </span><a href="mailto:sr-users@lists.sip-router.org" class="">sr-users@lists.sip-router.org</a><span class="Apple-converted-space"> </span><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" class="">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></div></div></div><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:sr-users@lists.sip-router.org" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">sr-users@lists.sip-router.org</a><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></div></blockquote></div><br class=""></div></div></body></html>