[asterisk-dev] Sysfs udev /dev/dahdi/span-names/ population
Oron Peled
oron.peled at xorcom.com
Sat Jul 24 16:10:57 CDT 2010
On Saturday, 24 בJuly 2010 22:49:05 Kevin P. Fleming wrote:
> The driver should expose the various pieces of information it
> has available, and the admin can create a suitable udev rule (probably
> by copying an example that would exist in the docs) based on whether
> they prefer to use the connector string or the label...
It is exactly what the driver/udev rules do in this branch. It is
handled as follows:
* The driver exposes "location", "hardware_id" and "hardware_port"
as span attributes in sysfs
* A script that runs from udev, uses this information to create the
namespaces under /dev/dahdi
We didn't have to invent the wheel for this, a quick look under /dev/disk
would clearly show on whose shoulders we stood ;-)
Few other quick notes:
* Current DAHDI PCI cards don't have any on-board ID so identifying
hardware by its location makes this feature usefull also for non-Xorcom
devices until their vendors choose to implement hardware-id's (hint ;-)
* The optional "aliases" which are implemented by a separate script
allow the administrator to give "nicer" names to their devices:
- It improve readbility of device paths in the dialplan
(e.g: DAHDI/main-office!5 )
- It can solve problems if the hardware ID or the location contains
characters which are invalid in the dialplan, chan_dahdi.conf or
system.conf
- It allows an administrator to replace a faulty device with an identical
one, regardless of its hardware_id/location by editing a single mapping
file.
Bye,
--
Oron Peled Voice: +972-4-8228492
oron at actcom.co.il http://users.actcom.co.il/~oron
Linux lasts longer!
-- "Kim J. Brand" <kim at kimbrand.com>
More information about the asterisk-dev
mailing list