[OpenSIPS-Users] Session timers refreshing

Mariana Arduini marianarduini at gmail.com
Mon Nov 12 18:17:24 CET 2012


Hello all,

I´ve checked on SST module and it does not mention anything about
refreshing the dialog timeout value. We need to handle this through UPDATE
messages.

We are using dialog module:

modparam("dialog", "timeout_avp", "$avp(session_expires)")

When we get the INVITE, we do:

        if($(hdr(Session-Expires)))
        {
            # Handling the case "Session-Expires: 4000;refresher=uac"
            $var(se_value) = $(hdr(Session-Expires){s.select,0,;});

            if($(var(se_value){s.int}) >= MIN_SE)
            {
                # Setting/Updating dialog's timeout
                $avp(session_expires) = $(var(se_value){s.int});
                xlog("L_ERR","******** set timer for INVITE:
$avp(session_expires) seconds");
            }
            else
            {
                 xlog("L_ERR","Session-Expires header value lower than
minimum supported (MIN_SE)");
                append_to_reply("Min-SE: MIN_SE\r\n");
                sl_send_reply("422","Session Interval Too Small");
                exit;
            }
        }

Using dlg_list, I can see the dialog timeout was correctly set. When I do
the same thing for the UPDATE, the dialog timeout is not refreshed:

 if (is_method("UPDATE") && $(hdr(Session-Expires)) ) {

        if(match_dialog())
        {
            # Handling the case "Session-Expires: 4000;refresher=uac"
            $var(se_value) = $(hdr(Session-Expires){s.select,0,;});

            if($(var(se_value){s.int}) >= MIN_SE)
            {
                $avp(session_expires) = $(var(se_value){s.int});
            } else {
                xlog("L_ERR","Session timer not refreshed");
            }

            sl_send_reply("200", "OK");
            exit;
        }
        else
        {
            sl_send_reply("481", "Transaction Does Not Exist");
            exit;
        }

}

Any hints, please?

Thanks in advance.

Mariana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121112/72672f9b/attachment.htm>


More information about the Users mailing list