Hi Experts,

I still believe it is broken even in the latest builds. Not sure if the installations are not running into this flawed 422 sending logic.
To investigate, I further dipped into the Opensips repo and please see attached a checkin dating back in 2009 that had apparently fixed the 422 sending, I strongly believe this will be required in the Kamailio here as well to fix the logic. 

image.png
Ref: Line#788 at https://github.com/OpenSIPS/opensips/blob/master/modules/sst/sst_handlers.c

Regards,
Harneet Singh 

On Fri, Mar 27, 2020 at 10:44 PM harneet singh <hbilling@gmail.com> wrote:
Hi All,

I am facing an issue in understanding how the min_se should be working in kamailio. As per the SST documentation, it seems like if the min_se is configured as 500, then any value of Session-Expires OR MIN-SE if lower than 500, can be responded to by a 422.
However, I strangely see the reverse happening. To investigate further, I looked in to the ki_sst_check_min() code in the master, and these seems like a potential issue.

Ref Code: Inside ki_sst_check_min(), there is an if condition like below:

if (sst_min_se < MIN(minse, se.interval)) { 

However, shouldn't it be the other way around? ie 
if (sst_min_se > MIN(minse, se.interval)) { 

because we need to send 422 if the received value(in INVITE etc) is smaller than the sst configure min_se value? 
I also found a different documentation, at https://git.sgu.ru/oldssu/ex-opensips/blob/cb9df8d59dbb254a9d862569fd5d11f6656c597d/modules/sst/sst_handlers.c where the check is as below?
if (sst_min_se > MIN(minse, se.interval)) { 

Can someone confirm if this is broken, or my understanding is incorrect?

Regards,
Harneet 
 

--
"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth" - Sir Arthur Conan Doyle


--
"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth" - Sir Arthur Conan Doyle