[OpenSIPS-Devel] [ opensips-Bugs-3016652 ] Dialogs with SSTenabled use default timeout

SourceForge.net noreply at sourceforge.net
Tue Jul 13 10:39:26 CEST 2010


Bugs item #3016652, was opened at 2010-06-15 21:18
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3016652&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.5.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Artem Osmerkin (aosm)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Dialogs with SSTenabled use default timeout

Initial Comment:
While SST module is activated, dialogs still use default timeouts.

I have conducted some investigation. It seems like there is a miscommunication between SST and the core - SST set AVP of one type but Dialog module get another one.

Please have a look at the following snippets of code.

set_timeout_avp() in sst_handlers.c
Here we are passing PV_VAL_INT.

    pv_val.flags = PV_VAL_INT;
    pv_val.ri = value;
    if (timeout_avp->setf(msg,&timeout_avp->pvp,EQ_T,&pv_val)!=0) {
        LM_ERR("failed to set new dialog timeout value\n");
    } else {
        rtn = 0;
    }

get_dlg_timeout() in dlg_handlers.c
Here we got PV_VAL_INT flag cleared. Therefore, we use defaut timeout.

    if( timeout_avp && pv_get_spec_value( req, timeout_avp, &pv_val)==0
        && pv_val.flags&PV_VAL_INT && pv_val.ri>0 ) {
        return pv_val.ri;
    }
    return default_timeout;

It seems as the reason of such a behaviour is in pv_set_avp() in pvar.c
We are trying to evaluate another flag PV_TYPE_INT instead of PV_VAL_INT before assigning values to newly added AVP:

    if(val->flags&PV_TYPE_INT)
    {
        avp_val.n = val->ri;
    } else {
        avp_val.s = val->rs;
        flags |= AVP_VAL_STR;
    }
Else branch is executed and then, when we call pv_get_avp, we have wrong set of flags and no value assigned to ri member.

It is possible that changing (val->flags & PV_TYPE_INT) with (val->flags & PV_VAL_INT) is nedded, but Iam not sure that it will not cause any side effects. 

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-07-13 11:39

Message:
Hi Artem,

The right fix will be in SST module, to replace :
      pv_val.flags = PV_VAL_INT;
with
      pv_val.flags = PV_VAL_INT| PV_TYPE_INT ;

if you could test and report if ok , I will upload the fix on SVN asap.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3016652&group_id=232389



More information about the Devel mailing list