[Home]

Summary:ASTERISK-12201: [patch] Don't send BYE for a dialog that already was terminated after blind transfer
Reporter:Frederic LE FOLL (flefoll)Labels:
Date Opened:2008-06-16 04:27:39Date Closed:2008-06-16 13:25:10
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Transfers
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_sip.c.br14.121495.patch-ALREADYGONE
Description:__sip_autodestruct(), scheduled by sip_scheddestroy(), transmits a BYE request if the call was formerly REFER'ed, even if the peer SIP device already has terminated the dialog.

We can see it after a blind transfer where the transferer sends a BYE when its REFER request has succeeded.
In this case, chan_sip handles the BYE request, marks the dialog as ALREADYGONE, schedules dialog destruction (not immediate when no more owner) and replies 200 OK.
Then, when __sip_autodestruct() runs, it generates a BYE request. In my opinion, if the dialog is marked ALREADYGONE, then ... it's already gone ! And BYE is not required.
Of course, the result is 481 Call/Transaction Does Not Exist.

I propose to add a test of SIP_ALREADYGONE flag.


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

The code in __sip_autodestruct() that transmits the BYE was added in two steps :
Rev 33236 : Another try at hanging up the transferer channel after the masq : adds the transmit_request_with_auth()
Rev 47476 : ...and make sure that the dialog is destroyed : adds sip_scheddestroy()
Comments:By: Digium Subversion (svnbot) 2008-06-16 07:01:42

Repository: asterisk
Revision: 122869

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r122869 | file | 2008-06-16 07:01:39 -0500 (Mon, 16 Jun 2008) | 6 lines

Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue ASTERISK-12201)
Reported by: flefoll
Patches:
     chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)

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

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

By: Digium Subversion (svnbot) 2008-06-16 07:03:15

Repository: asterisk
Revision: 122870

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r122870 | file | 2008-06-16 07:03:14 -0500 (Mon, 16 Jun 2008) | 14 lines

Merged revisions 122869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122869 | file | 2008-06-16 09:08:28 -0300 (Mon, 16 Jun 2008) | 6 lines

Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue ASTERISK-12201)
Reported by: flefoll
Patches:
     chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)

........

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

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

By: Digium Subversion (svnbot) 2008-06-16 07:04:13

Repository: asterisk
Revision: 122871

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

------------------------------------------------------------------------
r122871 | file | 2008-06-16 07:04:12 -0500 (Mon, 16 Jun 2008) | 22 lines

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

................
r122870 | file | 2008-06-16 09:09:54 -0300 (Mon, 16 Jun 2008) | 14 lines

Merged revisions 122869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122869 | file | 2008-06-16 09:08:28 -0300 (Mon, 16 Jun 2008) | 6 lines

Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue ASTERISK-12201)
Reported by: flefoll
Patches:
     chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)

........

................

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

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

By: Digium Subversion (svnbot) 2008-06-16 13:25:10

Repository: asterisk
Revision: 123107

_U  team/seanbright/resolve-shadow-warnings/
U   team/seanbright/resolve-shadow-warnings/UPGRADE.txt
A   team/seanbright/resolve-shadow-warnings/apps/app_fax.c
U   team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c
U   team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
U   team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
U   team/seanbright/resolve-shadow-warnings/configs/modules.conf.sample
U   team/seanbright/resolve-shadow-warnings/funcs/func_channel.c
U   team/seanbright/resolve-shadow-warnings/include/asterisk/_private.h
U   team/seanbright/resolve-shadow-warnings/include/asterisk/config.h
U   team/seanbright/resolve-shadow-warnings/include/asterisk/timing.h
U   team/seanbright/resolve-shadow-warnings/main/asterisk.c
U   team/seanbright/resolve-shadow-warnings/main/channel.c
U   team/seanbright/resolve-shadow-warnings/main/timing.c
A   team/seanbright/resolve-shadow-warnings/res/res_timing_pthread.c

------------------------------------------------------------------------
r123107 | seanbright | 2008-06-16 13:25:06 -0500 (Mon, 16 Jun 2008) | 109 lines

Merged revisions 122766,122802,122834,122870,122920,122923,122926,122928,122977,123009,123041,123044,123076 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r122766 | tilghman | 2008-06-13 18:52:20 -0400 (Fri, 13 Jun 2008) | 2 lines

Document the input for ast_realtime_require_field()

................
r122802 | tilghman | 2008-06-15 11:21:16 -0400 (Sun, 15 Jun 2008) | 8 lines

Add some more IAX2-specific information about the channel to the CHANNEL()
function and begin the transition from SIPCHANINFO() to just using CHANNEL().
(closes issue ASTERISK-12193)
Reported by: mostyn
Patches:
      iax_and_sip_channel_info.patch uploaded by mostyn (license 398)
      (with some additional cleanup by me)

................
r122834 | seanbright | 2008-06-15 23:33:03 -0400 (Sun, 15 Jun 2008) | 1 line

Resurrected app_fax
................
r122870 | file | 2008-06-16 08:09:54 -0400 (Mon, 16 Jun 2008) | 14 lines

Merged revisions 122869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122869 | file | 2008-06-16 09:08:28 -0300 (Mon, 16 Jun 2008) | 6 lines

Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue ASTERISK-12201)
Reported by: flefoll
Patches:
     chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)

........

................
r122920 | file | 2008-06-16 08:32:02 -0400 (Mon, 16 Jun 2008) | 14 lines

Merged revisions 122919 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122919 | file | 2008-06-16 09:31:09 -0300 (Mon, 16 Jun 2008) | 6 lines

Only compare the first 15 characters so that even if the charset is specified we still accept it as SDP.
(closes issue ASTERISK-12154)
Reported by: lanzaandrea
Patches:
     chan_sip.c.diff uploaded by lanzaandrea (license 496)

........

................
r122923 | russell | 2008-06-16 08:48:11 -0400 (Mon, 16 Jun 2008) | 5 lines

- Fix a typo in a timing API call
- Convert the last part of channel.c over to use the timing API.  This would
  not have made a difference when using the dahdi timing module.  I noticed
  it when trying to use another timing source.  Oops.  :)

................
r122926 | russell | 2008-06-16 09:03:40 -0400 (Mon, 16 Jun 2008) | 4 lines

Add a "timing test" CLI command.  It opens a timer and configures it for
50 ticks per second, and then counts to see how many ticks it actually
gets in a second.

................
r122928 | russell | 2008-06-16 09:08:13 -0400 (Mon, 16 Jun 2008) | 11 lines

Merge res_timing_pthread.  This is a timing interface for Asterisk that
does not require DAHDI.  It's called "pthread" because it uses a pthread
API call in the timing thread for sleeping and ensuring we wake up at
an appropriate time.  I wasn't sure what else to call it.  :)

The timing API requires a file descriptor that can be polled on.  So,
when you open a timer, this module creates a pipe and returns the read
end of the pipe.  There is a background thread that wakes up every 10ms
and checks to see if any of the currently open timers need a 'tick' and
writes to the appropriate pipe.

................
r122977 | russell | 2008-06-16 09:31:36 -0400 (Mon, 16 Jun 2008) | 2 lines

Note that only one timing interface should get loaded.

................
r123009 | seanbright | 2008-06-16 11:25:03 -0400 (Mon, 16 Jun 2008) | 1 line

Coding guidelines stuff only.
................
r123041 | seanbright | 2008-06-16 12:29:18 -0400 (Mon, 16 Jun 2008) | 1 line

Remove some unused variables
................
r123044 | seanbright | 2008-06-16 13:14:11 -0400 (Mon, 16 Jun 2008) | 1 line

Convert to use stringfields.  Still some more work to do on config load/reload.
................
r123076 | seanbright | 2008-06-16 13:33:10 -0400 (Mon, 16 Jun 2008) | 1 line

Last commit for a bit, minor cleanups and move the lock initialization.
................

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

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