<div dir="ltr"><div class="gmail_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_authenticate")) {</div><div>                xlog("L_INFO", "challenging %ct");</div><div>                if (is_avp_set("s:digest_challenge")) {</div><div>                        append_to_reply("%$digest_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><div><br></div><div>-Maxim</div></div>
</div>