<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi, Maxim!<br>
<br>
The code you are using now should do what you request. t_newtran()
returns 0 for retransmissions, therefore for the second message
(retransmission) that will run the script, t_newtran() will
immediately absorb the message and return without executing any
further instructions.<br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 02/17/2017 09:15 PM, Maxim Sobolev
wrote:<br>
</div>
<blockquote
cite="mid:CAH7qZfsAnjUiTBap5PNMCxPOTmJh3ebVkhsgyb_scpuhQ3FxPw@mail.gmail.com"
type="cite">
<div dir="ltr">P.S. <span style="font-size:12.8px">python_exec("www_</span><wbr
style="font-size:12.8px"><span style="font-size:12.8px">authenticate")
does not do any magic here, it's just figures out the right
domain to use based on some business rules and then calls
www_authenticate() with that parameter.</span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Feb 17, 2017 at 11:12 AM, Maxim
Sobolev <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:sobomax@sippysoft.com" target="_blank">sobomax@sippysoft.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div class="m_6911824313400074143gmail_signature">
<div dir="ltr">Hi guys,</div>
<div dir="ltr"><br>
</div>
<div>We are underway to migrate from ancient SER-2.0.0
to more modern OpenSIPS and one of the question that
is still in my TODO list is implementing transactional
processing of the REGISTER requests. In the old SER we
had something along those lines:</div>
<div><br>
</div>
<div>
<div>route[3] {</div>
<div> # Ensure that all incoming messages
contain auth info</div>
<div> xlog("L_INFO", "processing %rm received
from %si:%sp");</div>
<div> if (!t_newtran()) {</div>
<div> sl_send_reply("500", "could not
create transaction");</div>
<div> break;</div>
<div> };</div>
<div> if (!python_exec("www_<wbr>authenticate"))
{</div>
<div> xlog("L_INFO", "challenging
%ct");</div>
<div> if (is_avp_set("s:digest_<wbr>challenge"))
{</div>
<div>
append_to_reply("%$digest_<wbr>challenge");</div>
<div> };</div>
<div> t_reply("401", "Unauthorized");</div>
<div> break;</div>
<div> };</div>
<div> [....some more unrelated processing and
checks...]</div>
<div> xlog("L_INFO", "saving contact %ct into
the database");<br>
</div>
<div> save_noreply("location");</div>
<div> if (is_avp_set("s:contact")) {</div>
<div> append_to_reply("%$contact");</div>
<div> };</div>
<div> t_reply("$code", "$reason");</div>
<div>}</div>
</div>
<div><br>
</div>
<div>The idea here is to avoid possibly costly DB lookup
and other checks on each possible re-transmit. What
would be the proper way of doing this with the
OpenSIPS 2.1? Or if it's not possible to replicate
such scheme, what would be the best way to implement
this which to get the change accepted into the
OpenSIPS mainline?</div>
<div><br>
</div>
<div>Any ideas, pointers, hints are greatly appreciated.
Thanks in advance!</div>
<span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>-Maxim</div>
</font></span></div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">Maksym Sobolyev<br>
Sippy Software, Inc.<br>
Internet Telephony (VoIP) Experts<br>
Tel (Canada): +1-778-783-0474<br>
Tel (Toll-Free): +1-855-747-7779<br>
Fax: +1-866-857-6942<br>
Web: <a moz-do-not-send="true"
href="http://www.sippysoft.com" target="_blank">http://www.sippysoft.com</a><br>
MSN: <a moz-do-not-send="true"
href="mailto:sales@sippysoft.com" target="_blank">sales@sippysoft.com</a><br>
Skype: SippySoft<br>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>