[OpenSIPS-Users] Absorbing retransmissions and CANCEL

Alex Massover alex at jajah.com
Sun Oct 12 10:01:19 CEST 2008


Hi!

I found a workaround, sl_reply_error() was sending 500, in the following code:

if(!t_relay("0x01"))
        {
                sl_reply_error();
        }

But still it would be much better if I detect CANCELed transactions explicitly, and it will allow me to keep sl_reply_error() for other cases.

--
Best Regards,
Alex Massover

-----Original Message-----
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Alex Massover
Sent: Sunday, October 12, 2008 9:50 AM
To: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Absorbing retransmissions and CANCEL

Hi!

Thanks, this solves this problem, but now I run to another problem, when CANCEL is sent while perl_exec(“very_heavy_auth”) is still running, OpenSIPS responds with 500 and I have the following in the log:

Oct 12 07:34:09 y /usr/sbin/opensips[21371]: ERROR:tm:t_forward_nonack: discarding fwd for a cancelled/6xx transaction
Oct 12 07:34:09 y /usr/sbin/opensips[21371]: ERROR:tm:w_t_relay: t_forward_nonack failed
Oct 12 07:34:09 y /usr/sbin/opensips[21371]: WARNING:tm:t_unref: script writer didn't release transaction

The problem is with sending 500, the same thing but running silently will be ok.

Or even better to detect somehow that transaction was cancelled and stop further processing when perl_exec(“very_heavy_auth”) exits. Bogdan already explained to me that CANCEL processed in different process. But still the transaction is common and tm module knows that it canceled. The question is, how can I make it running nicer, without sending 500.

--
Best Regards,
Alex Massover

-----Original Message-----
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Iñaki Baz Castillo
Sent: Saturday, October 11, 2008 3:39 PM
To: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Absorbing retransmissions

El Sábado, 11 de Octubre de 2008, Alex Massover escribió:
> Hi!
>
> Thanks! It really looks better. You wrote: " if retransmission, the
> function will send the last reply sent automatically and break the script."
>
> If I understand correctly in order for this to work I need to move all my
> other sl_send_reply("4xx") to t_reply("4xx") also? So it will be able to
> send not only 100, but all negative replies also?

That's true, if you have already created the transaction you must send replies
statefully, this is, using "t_reply".

But note here that this is a matter of efficience:
If you create a transaction and finally you reply 4XX you are wasting system
resources, this is the reason RFC 3261 suggest to never create a transaction
after authentication has been checked.

But in your case, if the authentication process is slow it could be a need to
create the transaction before performing the authentication, but maybe you
could do it more efficience by doing:



route[0] {


        # If there is no Proxy-Authorization header terminate the request statessly:
        if ! $hdr(Proxy-Authorization)
                { sl_reply(“407, "Proxy Authentication Required”); }

        ...
        t_newtran();
        t_reply("100","Trying");
        ....
         if(!perl_exec(“very_heavy_auth”))
                { t_reply(“403”); }
                 …
        ....
        t_relay("0x01");


}


--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************



******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************



******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************



More information about the Users mailing list