[OpenSIPS-Users] Session timers refreshing

Mariana Arduini marianarduini at gmail.com
Mon Nov 12 20:21:51 CET 2012


After some testing I found out the dialog timeout is correctly refreshed if
I set the avp before calling match_dialog(), but this is a problem, because
we can only refresh the timer if the UPDATE message belongs to a dialog.
Otherwise, we must reply with a 481.

I tried using loose_route() instead but no success yet.

Please advise.

Thanks,
Mariana.


On Mon, Nov 12, 2012 at 3:17 PM, Mariana Arduini <marianarduini at gmail.com>wrote:

> 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/a43881c0/attachment.htm>


More information about the Users mailing list