[OpenSIPS-Users] Session timers refreshing
Răzvan Crainea
razvan at opensips.org
Mon Nov 12 20:32:22 CET 2012
Hi, Mariana!
The dialog timeout avp has effect only if it is set before match_dialog
and loose_route. But only the dialog matched by either loose_route,
either match_dialog, will be updated. If none is found, then nothing
will be changed. Therefore I can't really see a problem here - if the
UPDATE doesn't match the dialog, you can freely reply with a 481 without
any consequences.
Best regards,
Razvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com
On 11/12/2012 08:21 PM, Mariana Arduini wrote:
> 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 <mailto: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 <http://s.int>}) >= MIN_SE)
> {
> # Setting/Updating dialog's timeout
> $avp(session_expires) = $(var(se_value){s.int
> <http://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 <http://s.int>}) >= MIN_SE)
> {
> $avp(session_expires) = $(var(se_value){s.int
> <http://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.
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121112/5633a443/attachment-0001.htm>
More information about the Users
mailing list