sstCheckMin("1") doesn't enter the block when returns 1

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sstCheckMin("1") doesn't enter the block when returns 1

Iñaki Baz Castillo
Hi, "sst" doc has an example:
  http://www.opensips.org/html/docs/modules/devel/sst.html#id2503829

        if (sstCheckMin("1")) {
                xlog("L_ERR", "422 Session Timer Too Small reply sent.\n");
                exit;
        }

Well, this is not what I see. When the request has a Session-Expires lower
than "min_se" and "reject_to_small" = 1, OpenSIPS replies a 422, but the
block code is not executed and the script continues (for example doing a
normal routing/lookup).

My "sst" configuration:

  modparam("sst", "min_se", 40)
  modparam("sst", "reject_to_small", 1)
  modparam("sst", "sst_flag", FLAG_SST)

Is it normal?

PD: Could I understand the purpose of "reject_to_small" parameter and how it
affects on "sstCheckMin()" function?

Thanks.



--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: sstCheckMin("1") doesn't enter the block when returns 1

Iñaki Baz Castillo
El Jueves, 27 de Noviembre de 2008, Iñaki Baz Castillo escribió:

> Hi, "sst" doc has an example:
>   http://www.opensips.org/html/docs/modules/devel/sst.html#id2503829
>
> if (sstCheckMin("1")) {
>                 xlog("L_ERR", "422 Session Timer Too Small reply sent.\n");
>                 exit;
>         }
>
> Well, this is not what I see. When the request has a Session-Expires lower
> than "min_se" and "reject_to_small" = 1, OpenSIPS replies a 422, but the
> block code is not executed and the script continues (for example doing a
> normal routing/lookup).
>
> My "sst" configuration:
>
>   modparam("sst", "min_se", 40)
>   modparam("sst", "reject_to_small", 1)
>   modparam("sst", "sst_flag", FLAG_SST)
>
> Is it normal?
>
> PD: Could I understand the purpose of "reject_to_small" parameter and how
> it affects on "sstCheckMin()" function?

I'm doing some tests and I'm really tired, Ive got no conclusion (except
perphas that the module doens't work properly?) The block for:
  if sstCheckMin("1") {
    # block
  }
is never runned, even if parameter is 1/0, "reject_to_small" is 1/0 and, of
course, the request has Session-Expires: X (being X minor than "min_se").

If "reject_to_small" is 1 and the SST flag is set, then 422 is *alway* replied
by OpenSIPS even if "sstCheckMin()" is called with param 1 or 0. And again:
the code block of "if sstCheckMin() {..." is *never* runned.

If "reject_to_small" is 0, then 422 is never sent automatically, and there is
no way of doing it manually since, again, "sstCheckMin(1/0)" returns no
true/false.... how to explain:


a)
----------
modparam("sst", "reject_to_small", 1)
...
xlog("L_INFO", "\n\n########## starting SST...... ###########\n");
sstCheckMin("1");
xlog("L_INFO", "********** sstCheckMin: $rc ***********\n");
setflag(FLAG_SST);
-----------

This generates 422 and the log:
---------
########## starting SST...... ###########
********** sstCheckMin: 18446744073709551615 ***********
---------


b)
----------
modparam("sst", "reject_to_small", 1)
...
xlog("L_INFO", "\n\n########## starting SST...... ###########\n");
sstCheckMin("0");
xlog("L_INFO", "********** sstCheckMin: $rc ***********\n");
setflag(FLAG_SST);
-----------

Exaclty the SAME. This generates 422 and the log:
---------
########## starting SST...... ###########
********** sstCheckMin: 18446744073709551615 ***********
---------


c)
----------
modparam("sst", "reject_to_small", 0)
...
xlog("L_INFO", "\n\n########## starting SST...... ###########\n");
sstCheckMin("1");
xlog("L_INFO", "********** sstCheckMin: $rc ***********\n");
setflag(FLAG_SST);
-----------

This DOES NOT generate 422, and the log:
---------
########## starting SST...... ###########
********** sstCheckMin: 18446744073709551615 ***********
---------


d)
----------
modparam("sst", "reject_to_small", 0)
...
xlog("L_INFO", "\n\n########## starting SST...... ###########\n");
sstCheckMin("0");
xlog("L_INFO", "********** sstCheckMin: $rc ***********\n");
setflag(FLAG_SST);
-----------

Exaclty the SAME. NO 422 and the log:
---------
########## starting SST...... ###########
********** sstCheckMin: 18446744073709551615 ***********
---------



And when using "if sstCheckMin() { block }" I've **never** got running the
block code, never.

Am I doing something wrong?

Thanks.


--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: sstCheckMin("1") doesn't enter the block when returns 1

Iñaki Baz Castillo
I find a similar case:
  http://www.mail-archive.com/users%40lists.openser.org/msg00936.html

Does module "sst" really work?

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users