[Home]

Summary:ASTERISK-14569: [patch] session-expires default timer wrong
Reporter:Marcus Hunger (fnordian)Labels:
Date Opened:2009-07-31 04:13:32Date Closed:2009-09-07 08:18:21
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) sessionexpires.patch
( 1) sip_debug_patch2.txt
( 2) sip_debug_patched.txt
( 3) sip_debug.txt
Description:There is a bug in chan_sip which causes asterisk to set invalid session-expires-header in 200 OK after invites. My guess is that it's been there for a long time but got activated with bugfix 15403.

The problem is, that for invites without session-expires-headers a reply is generated with Session-Expires: -1;refresher=uas causing the uac to hangup the call with BYE immediately.

A workaround is setting session-timers=refuse in sip.conf

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

Maybe it's related to 15597
Comments:By: Marcus Hunger (fnordian) 2009-07-31 04:26:12

the workaround does not work if the uac requires timer.

By: Leif Madsen (lmadsen) 2009-09-02 19:16:48

I have confirmed this issue as I ran into it with another client. I have no had a chance to test this patch, but I can if someone really wants. It is a single one line change, so perhaps it just needs to be reviewed.

By: Olle Johansson (oej) 2009-09-03 03:20:04

As always, can we get a SIP debug just to document the issue?

By: Atis Lezdins (atis) 2009-09-03 10:49:05

Attached two SIP debug logs for Asterisk 1.6.1.5 and Audiocodes MP-124 FXS calling itself without re-INVITEs.

Initially Asterisk 1.6.1.5 is broken and no voice is passed through, after using this patch everything seems to work.

By: Olle Johansson (oej) 2009-09-07 06:40:27

What is the setting of the peer 90027

By: Olle Johansson (oej) 2009-09-07 06:42:58

The bug is actually later on, where we set the st_interval to uac_min_se if uac_max_se is not defined. That's bad.

By: Olle Johansson (oej) 2009-09-07 06:45:53

Try this:
Index: channels/chan_sip.c
===================================================================
--- channels/chan_sip.c (revision 216646)
+++ channels/chan_sip.c (arbetskopia)
@@ -18705,7 +18705,7 @@
st_interval = uac_max_se;
}
} else {
- st_interval = uac_min_se;
+ st_interval = global_max_se;
}
break;

By: Atis Lezdins (atis) 2009-09-07 07:41:21

mysql> SELECT * FROM sip_buddies WHERE username="90027"\G
*************************** 1. row ***************************
           id: 527
       ext_id: 34574
         name: 90027
  accountcode: NULL
     amaflags: NULL
    callgroup: 1
     callerid: AudioCodes 1 - Port 01 <90027>
  canreinvite: no
      context: default-sip
    defaultip: NULL
     dtmfmode: rfc2833
     fromuser: NULL
   fromdomain: NULL
  fullcontact: sip:90027@192.168.0.37
         host: dynamic
     insecure: NULL
     language: NULL
      mailbox:
    md5secret: NULL
          nat: yes
         deny: NULL
       permit: NULL
         mask: NULL
  pickupgroup:
         port: 5060
      qualify: no
  restrictcid: NULL
   rtptimeout: NULL
rtpholdtimeout: NULL
       secret: 90027
         type: friend
     username: 90027
  defaultuser: 90027
     disallow: all
        allow: ulaw
  musiconhold: NULL
   regseconds: 1252321664
       lastms: 0
    regserver: NULL
       ipaddr: 192.168.0.37
    useragent: Audiocodes-Sip-Gateway-MP-124 FXS/v.4.80A.025.004
     regexten:
cancallforward: yes
       setvar:
   call-limit: 8

By: Atis Lezdins (atis) 2009-09-07 07:55:13

oej: your patch works too. SIP trace attached

By: Digium Subversion (svnbot) 2009-09-07 08:07:19

Repository: asterisk
Revision: 216695

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r216695 | oej | 2009-09-07 08:07:19 -0500 (Mon, 07 Sep 2009) | 8 lines

If there is no session timer in the INVITE, set it to default value (not unset minimum = -1)

Patch by oej

closes issue ASTERISK-14569
Reported by: fnordian
Tested by: atis

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

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

By: Digium Subversion (svnbot) 2009-09-07 08:09:17

Repository: asterisk
Revision: 216696

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

------------------------------------------------------------------------
r216696 | oej | 2009-09-07 08:09:17 -0500 (Mon, 07 Sep 2009) | 16 lines

Merged revisions 216695 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r216695 | oej | 2009-09-07 15:06:19 +0200 (M?\195?\131?\194?\165n, 07 Sep 2009) | 8 lines

If there is no session timer in the INVITE, set it to default value (not unset minimum = -1)

Patch by oej

closes issue ASTERISK-14569
Reported by: fnordian
Tested by: atis

........

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

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

By: Digium Subversion (svnbot) 2009-09-07 08:11:39

Repository: asterisk
Revision: 216697

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

------------------------------------------------------------------------
r216697 | oej | 2009-09-07 08:11:39 -0500 (Mon, 07 Sep 2009) | 16 lines

Merged revisions 216695 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r216695 | oej | 2009-09-07 15:06:19 +0200 (M?\195?\131?\194?\165n, 07 Sep 2009) | 8 lines

If there is no session timer setting in the INVITE, set it to default value (not unset minimum = -1)

Patch by oej

closes issue ASTERISK-14569
Reported by: fnordian
Tested by: atis

........

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

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

By: Digium Subversion (svnbot) 2009-09-07 08:18:20

Repository: asterisk
Revision: 216698

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

------------------------------------------------------------------------
r216698 | oej | 2009-09-07 08:18:20 -0500 (Mon, 07 Sep 2009) | 16 lines

Merged revisions 216695 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r216695 | oej | 2009-09-07 15:06:19 +0200 (M?\195?\131?\194?\165n, 07 Sep 2009) | 8 lines

If there is no session timer in the INVITE, set it to default value (not unset minimum = -1)

Patch by oej

closes issue ASTERISK-14569
Reported by: fnordian
Tested by: atis

........

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

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