asterisk/channels
Tzafrir Cohen 3451d6a72d suspended destructions of pri spans on events
If a DAHDI span disappears, we wish for its representation in Asterisk
to be destroyed as well.

The information about the span's removal may come from several paths:

1. DAHDI sends DAHDI_EVENT_REMOVE on every channel.
2. An extra DAHDI_EVENT_REMOVED is sent on every subsequent call to
   DAHDI_GET_EVENT.
3. Every read (including the internal one by libpri on the D-channel)
   returns -ENODEV.

Asterisk responsds to DAHDI_EVENT_REMOVE on a channel by destroying it.

Destroying a channel requires holding the channel list lock (iflock).
Destroying a channel that is part of a span requires holding the span's
lock. Destroying a channel from a context that holds the span lock,
while at the same time another channel is destroyed directly, leads to a
deadlock. Solution: don't destroy span while holding the channels list
lock.

Thus changes in this patch:
* Deferring removal of PRI spans in response to events: doomed spans
  are collected on a list.
* Doomed spans are removed periodically by the monitor thread.
* ENODEV reads from the D-channel will warant the same deferred removal.

Review: https://reviewboard.asterisk.org/r/3548/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23 07:44:19 +00:00
..
dahdi bridge_native_dahdi: Return channel join failure if could not make the channels compatible. 2013-10-15 20:26:13 +00:00
h323 Voicemail: Remove mailbox identifier format (box@context) assumptions in the system. 2013-12-19 16:52:43 +00:00
iax2 Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
misdn Allow mISDN to send PROGRESS messsage. 2013-05-10 22:12:52 +00:00
pjsip Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
sip Fix build warnings with TEST_FRAMEWORK enabled 2014-06-19 19:40:45 +00:00
Makefile channels/Makefile: clean pjsip directory 2013-12-13 05:00:53 +00:00
chan_alsa.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_bridge_media.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_console.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_dahdi.c suspended destructions of pri spans on events 2014-06-23 07:44:19 +00:00
chan_dahdi.h chan_dahdi: Adds support for major update to libss7. 2014-06-16 18:27:51 +00:00
chan_gtalk.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_h323.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_iax2.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_jingle.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_mgcp.c res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers 2014-05-22 15:52:30 +00:00
chan_misdn.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_motif.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_multicast_rtp.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_nbs.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
chan_oss.c main/Makefile: Fix build failure on SmartOS/Illumos/SunOS 2014-04-17 20:25:16 +00:00
chan_phone.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_pjsip.c PJSIP: Send initial connected line information 2014-06-05 11:59:09 +00:00
chan_sip.c channels/chan_sip: Forbid remote bridging if T.38 is negotiated 2014-06-16 02:40:44 +00:00
chan_skinny.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
chan_unistim.c Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messages 2014-05-28 22:54:12 +00:00
chan_vpb.cc uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
console_board.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_gui.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
misdn_config.c Add named callgroups/pickupgroups 2012-08-07 12:46:36 +00:00
sig_analog.c res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers 2014-05-22 15:52:30 +00:00
sig_analog.h Convert sig_analog to use a global callback table. 2012-08-08 20:32:53 +00:00
sig_pri.c suspended destructions of pri spans on events 2014-06-23 07:44:19 +00:00
sig_pri.h suspended destructions of pri spans on events 2014-06-23 07:44:19 +00:00
sig_ss7.c chan_dahdi: Adds support for major update to libss7. 2014-06-16 18:27:51 +00:00
sig_ss7.h chan_dahdi: Adds support for major update to libss7. 2014-06-16 18:27:51 +00:00
vcodecs.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
vgrabbers.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00