Summary:ASTERISK-07068: [patch][post 1.4] destroy channel on ZT_EVENT_REMOVED
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2006-05-31 20:53:34Date Closed:2008-06-07 12:44:18
Versions:Frequency of
Environment:Attachments:( 0) chanzap_chanremoved_1.2.diff
( 1) chanzap_chanremoved_20.diff
( 2) chanzap_chanremoved_trunk.diff
( 3) zaptel_removed.diff
Description:The following patch adds uses a new zaptel event to signal the removal of a zaptel channel.

That event should signal that the hardware has been disconnected. Thus Asterisk should close the open file descriptor for the channel to allow the zaptel driver to clean up.

For the sake of simplicity I send this for each channel separately, as each channel "holds" an open file. Though you actually almost always disconnect complete spans.


For the sake of simplicity I have also used the implementation of 'zap destroy channel' , which I broke to two functions. I'm also not sure handle all the possible pathes in which the signal can be read.
Comments:By: Tzafrir Cohen (tzafrir) 2006-06-01 04:14:32

well, 19 is a good value for zaptel 1.2, but not for zaptel trunk. changing the value to 20. Please use the patch chanzap_chanremoved_20.diff

I also added a patch vs. zaptel trunk (r1083) that simply adds that define to zaptel.h .

Potential impact of this patch to systems with unpatched zaptel should be zero, as this event should not be generated.

By: Tzafrir Cohen (tzafrir) 2006-07-06 18:09:36

Added a 1.2 backport that I use successfully.

Also note that the current version of the Astribank zaptel drivers (xpp) sends ZT_EVENT_REMOVED . AFAIK no other channel sends that event.

Please reconsider this for 1.4, as it has minimal impact (currently: only for Astribank users. And I'm likely to her about problems with Astribank systems).

By: Serge Vecher (serge-v) 2006-07-07 08:34:48

tzafrir: I think it is best to address whether this goes into 1.4 or not directly with kpf.

By: jmls (jmls) 2006-10-31 12:30:12.000-0600

tzafrir, did you discuss this with kpf ?

By: jmls (jmls) 2006-11-20 11:43:47.000-0600

ping. housekeeping :)

By: jmls (jmls) 2007-02-11 03:24:39.000-0600

ping. housekeeping :)

By: Tzafrir Cohen (tzafrir) 2007-02-11 03:48:21.000-0600

Added a diff vs. trunk 53911.

By: Russell Bryant (russell) 2007-03-07 19:06:06.000-0600

The necessary changes to zaptel and asterisk have been merged into both 1.4 and trunk.  Thanks!

By: Digium Subversion (svnbot) 2008-06-07 12:44:13

Repository: dahdi
Revision: 2294

U   branches/1.4/zaptel.h

r2294 | russell | 2008-06-07 12:44:12 -0500 (Sat, 07 Jun 2008) | 3 lines

Add a constant for ZT_EVENT_REMOVED to allow a driver to hint to userspace that
a channel has been removed. (issue ASTERISK-7068, tzafrir)



By: Digium Subversion (svnbot) 2008-06-07 12:44:18

Repository: dahdi
Revision: 2295

_U  trunk/
U   trunk/zaptel.h

r2295 | russell | 2008-06-07 12:44:16 -0500 (Sat, 07 Jun 2008) | 11 lines

Merged revisions 2294 via svnmerge from

r2294 | russell | 2007-03-07 18:48:22 -0600 (Wed, 07 Mar 2007) | 3 lines

Add a constant for ZT_EVENT_REMOVED to allow a driver to hint to userspace that
a channel has been removed. (issue ASTERISK-7068, tzafrir)