[Home]

Summary:ASTERISK-17400: [patch] session-timers=refuse is not enforced for *caller*
Reporter:Walter Doekes (wdoekes)Labels:
Date Opened:2011-02-14 09:38:58.000-0600Date Closed:2011-05-04 08:48:09
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) issue_18804_v2.diff
( 1) issue_18804.diff
( 2) issue18804_session_timer_refuse_caller.patch
Description:Hi,

when my peer calls with these headers

Supported: timer
Session-Expires: <some-integer>

session-timers are enabled, even though this peer has session-timers=refuse set.

It looks like that setting only disables the session-timers if the peer is the *callee*.

****** STEPS TO REPRODUCE ******

Create a SIP peer with 'session-timers=refuse', have it include these two headers in the INVITE:

Supported: timer
Session-Expires: 100

Result:
asterisk returns this in 1xx/200: Session-Expires: 100;refresher=uas (and does re-INVITE's to keep the session open)

Expected result:
asterisk should "refuse" the session timer request by ignoring the two mentioned headers.

****** ADDITIONAL INFORMATION ******

Attached, a little patch that should fix it.


Regards,
Walter Doekes
OSSO B.V.


P.S. Yes, I agree that the peer shouldn't be sending those headers. Unfortunately, that is out of my control. I believe it's an Alcatel (OxO_GW_710/022.001).
Comments:By: David Vossel (dvossel) 2011-05-03 16:17:58

I noticed that it appears the peername is already searched for in the st_get_mode function, so passing the authpeer in seems like redundant information. I uploaded a patch that gives the mode found during searching for the peername precedence over the cached value during handle request invite.  Please verify this patch also resolves the issue for you as I believe it is a more straightforward approach.

By: David Vossel (dvossel) 2011-05-03 21:09:41

Ah, my patch is not correct, The whole point of caching the mode is so the peername doesn't need to be looked up anymore.   I'll figure something better out.

By: David Vossel (dvossel) 2011-05-04 08:37:56

The second patch i put up is much better.  If the st_mode is retrieved in handle_request_invite it forces a look up of the mode rather than using the cached one.

By: Digium Subversion (svnbot) 2011-05-04 08:40:43

Repository: asterisk
Revision: 316616

U   branches/1.6.2/channels/chan_sip.c

------------------------------------------------------------------------
r316616 | dvossel | 2011-05-04 08:40:42 -0500 (Wed, 04 May 2011) | 12 lines

Fixes session-timers=refuse not being enforced for *caller*

During handle_request_invite, the session timer mode was retrieved from
a cached variable.  This patch forces a peer lookup of the session timer
mode in the case of an incoming invite.

(closes issue ASTERISK-17400)
Reported by: wdoekes
Patches:
     issue18804_session_timer_refuse_caller.patch uploaded by wdoekes (license 717)
     issue_18804_v2.diff uploaded by dvossel (license 671)

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

http://svn.digium.com/view/asterisk?view=rev&revision=316616

By: Digium Subversion (svnbot) 2011-05-04 08:44:42

Repository: asterisk
Revision: 316617

_U  branches/1.8/
U   branches/1.8/channels/chan_sip.c

------------------------------------------------------------------------
r316617 | dvossel | 2011-05-04 08:44:41 -0500 (Wed, 04 May 2011) | 19 lines

Merged revisions 316616 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
 r316616 | dvossel | 2011-05-04 08:40:41 -0500 (Wed, 04 May 2011) | 12 lines
 
 Fixes session-timers=refuse not being enforced for *caller*
 
 During handle_request_invite, the session timer mode was retrieved from
 a cached variable.  This patch forces a peer lookup of the session timer
 mode in the case of an incoming invite.
 
 (closes issue ASTERISK-17400)
 Reported by: wdoekes
 Patches:
       issue18804_session_timer_refuse_caller.patch uploaded by wdoekes (license 717)
       issue_18804_v2.diff uploaded by dvossel (license 671)
........

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

http://svn.digium.com/view/asterisk?view=rev&revision=316617

By: Digium Subversion (svnbot) 2011-05-04 08:48:08

Repository: asterisk
Revision: 316618

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r316618 | dvossel | 2011-05-04 08:48:07 -0500 (Wed, 04 May 2011) | 26 lines

Merged revisions 316617 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r316617 | dvossel | 2011-05-04 08:44:41 -0500 (Wed, 04 May 2011) | 19 lines
 
 Merged revisions 316616 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ........
   r316616 | dvossel | 2011-05-04 08:40:41 -0500 (Wed, 04 May 2011) | 12 lines
   
   Fixes session-timers=refuse not being enforced for *caller*
   
   During handle_request_invite, the session timer mode was retrieved from
   a cached variable.  This patch forces a peer lookup of the session timer
   mode in the case of an incoming invite.
   
   (closes issue ASTERISK-17400)
   Reported by: wdoekes
   Patches:
         issue18804_session_timer_refuse_caller.patch uploaded by wdoekes (license 717)
         issue_18804_v2.diff uploaded by dvossel (license 671)
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=316618