[OpenSIPS-Users] Transactional REGISTER processing with 2.1

Răzvan Crainea razvan at opensips.org
Mon Feb 20 03:25:00 EST 2017


Hi, Maxim!

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.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 02/17/2017 09:15 PM, Maxim Sobolev wrote:
> P.S. python_exec("www_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.
>
> On Fri, Feb 17, 2017 at 11:12 AM, Maxim Sobolev <sobomax at sippysoft.com 
> <mailto:sobomax at sippysoft.com>> wrote:
>
>     Hi guys,
>
>     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:
>
>     route[3] {
>             # Ensure that all incoming messages contain auth info
>             xlog("L_INFO", "processing %rm received from %si:%sp");
>             if (!t_newtran()) {
>                     sl_send_reply("500", "could not create transaction");
>                     break;
>             };
>             if (!python_exec("www_authenticate")) {
>                     xlog("L_INFO", "challenging %ct");
>                     if (is_avp_set("s:digest_challenge")) {
>     append_to_reply("%$digest_challenge");
>                     };
>                     t_reply("401", "Unauthorized");
>                     break;
>             };
>            [....some more unrelated processing and checks...]
>             xlog("L_INFO", "saving contact %ct into the database");
>             save_noreply("location");
>             if (is_avp_set("s:contact")) {
>                     append_to_reply("%$contact");
>             };
>             t_reply("$code", "$reason");
>     }
>
>     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?
>
>     Any ideas, pointers, hints are greatly appreciated. Thanks in advance!
>
>     -Maxim
>
>
>
>
> -- 
> Maksym Sobolyev
> Sippy Software, Inc.
> Internet Telephony (VoIP) Experts
> Tel (Canada): +1-778-783-0474
> Tel (Toll-Free): +1-855-747-7779
> Fax: +1-866-857-6942
> Web: http://www.sippysoft.com
> MSN: sales at sippysoft.com <mailto:sales at sippysoft.com>
> Skype: SippySoft

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170220/029c9d9a/attachment.html>


More information about the Users mailing list