[asterisk-dev] [Code Review] handle DAHDI_EVENT_REMOVED on a D-Channel

Tzafrir Cohen tzafrir.cohen at xorcom.com
Wed Jun 16 15:15:17 CDT 2010

This is an automatically generated e-mail. To reply, visit:

Review request for Asterisk Developers and rmudgett.


When a DAHDI device is removed at run-time it sends the event DAHDI_EVENT_REMOVED on each channel. This is intended to signal the userspace program to close the respective file handle, as the driver of the device will need all of them closed to properly clean-up.

This event has long since been handled in chan_dahdi (chan_zap at the time). However the event that is sent on a D-Channel of a "PRI" (ISDN) span simply gets ignored.

This code adds handling for closing the file descriptor (and shutting down the span, while we're at it). It also adds a CLI command to help test it.

This code seems to be rather DAHDI-generic and thus I opted not to change anything in sig_pri.c .

I use a simplified version of the container_of() macro from the Linux Kernel, which basically returns a pointer to a struct that contains a different struct to which we already have a pointer. Thus I assume this will always be run with on a struct sig_pri_pri that is contained ina s struct dahdi_pri .

I'm not sure what proper locking needs doing.


  /trunk/channels/chan_dahdi.c 270972 

Diff: https://reviewboard.asterisk.org/r/726/diff


Disconnecting either using the CLI command or with device removal for some E1 and some BRI devices.



More information about the asterisk-dev mailing list