summaryrefslogtreecommitdiff
path: root/xpp/README.Astribank
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/README.Astribank')
-rw-r--r--xpp/README.Astribank95
1 files changed, 90 insertions, 5 deletions
diff --git a/xpp/README.Astribank b/xpp/README.Astribank
index 221ef3a..4e83142 100644
--- a/xpp/README.Astribank
+++ b/xpp/README.Astribank
@@ -22,9 +22,10 @@ firmware and initialization files for the Astribank:
make -C xpp/utils
-In order to build the user space utilities, you will need the libusb-dev
-package on Debian (and derivatives like ubuntu) or libusb-devel on RedHat
+In order to build the user space utilities, you will need the libusb-dev
+package on Debian (and derivatives like ubuntu) or libusb-devel on RedHat
(and derivatives like Centox/Trixbox).
+
INSTALLATION:
""""""""""""
@@ -130,11 +131,54 @@ number. So you need to re-check the value of NNN with lsusb. Typically
this will be the old value + 1.
+Firmware Loading with Hotplug:
+"""""""""""""""""""""""""""""
+The Hotplug framework was popular for hotplugging and usually also
+autoloading drivers. If it is used on your system, you'll see
+/etc/hotplug with many files under it. Hotplug will automatically load
+most relevant USB and PCI kernel modules by the relevant USB and PCI
+IDs. Again: if the framework is in place and the proper configuration
+files are in place, the firmware should be loaded automatically.
+
+In order to get hotplug to autoload the firmware into the Astribank,
+the configuration file xpp_fxloader.usermap and the script xpp_fxloader
+should be copied into /etc/hotplug/usb/ . This is done by 'make -C
+xpp/utils install' .
+
+xpp_fxloader.usermap includes a map of USB IDs and the command to run
+when they are encountered. It instructs hotplug to run the script
+xpp_fxloader from that directory. This is done by 'make -C
+xpp/utils install' .
+
+When xpp_fxloader is run without any parameters it assumes that it was
+run by the hotplug scripts. It will then check if the even is an "add"
+event (and not a "remove" event), and if so, install the required
+firmware file. It will be called twice, as after the load of the USB
+firmware the device will reenumerate itself and thus "unplug" and
+"replug" to load the FPGA firmware.
+
+
Firmware Loading with UDEV:
""""""""""""""""""""""""""
-Firmware loading with udev should work but is not installed
-automatically, yet. See the comments in the beginning of the script
-/etc/hotplug/usb/xpp_fxloader .
+The UDEV framework has replaced Hotplug in most recent systems. If you
+have a recent 2.6 system with no Hotplug and files under /etc/udev,
+chances are you ude udev. udev does quite a few nice things.
+Again: if the framework is in place and the proper configuration
+files are in place, the firmware should be loaded automatically.
+
+In order to get hotplug to autoload the firmware into the Astribank,
+the configuration file xpp.rules should be copied into /etc/udev/rules.d
+and the script xpp_fxloader should be copied into /etc/hotplug/usb/ .
+This is done by 'make -C xpp/utils install' .
+
+xpp.rules instructs udevd to run xpp_fxloader with the option udev and
+the USB ID when an Astribank is plugged and needs loading firmware.
+When xpp_fxloader is run with the option udev it assumes that it was
+run by udevd scripts. It will then install the required firmware file.
+It will be called twice, as after the load of the USB firmware the
+device will reenumerate itself and thus "unplug" and "replug" to load
+the FPGA firmware.
+
Loading The Modules:
"""""""""""""""""""
@@ -301,6 +345,47 @@ When loaded, you should get one span, of 8 extensions, 2 output ports and
13 XPP_IN/0-12 FXOKS (In use)
14 XPP_IN/0-13 FXOKS (In use)
+Sample dialplan (extentions.conf) for all the above:
+
+[phones-zap]
+; 401 will dial to channel 1, 420, to zaptel channel 20, etc.
+exten => _4XX,1,Dial(ZAP/${EXTEN:1})
+
+[trunk-9]
+; Dial through the first FXO port availble.
+; This assumes that all FXO ports are in group 0 and all others are not,
+; as in the sample zapata.conf for 8FXS/8FXO below, and as is generated
+; by genzaptelconf by default.
+exten => 9.,Dial(Zap/g0/${EXTEN:1})
+
+[from-internal]
+; The context of FXS ports: analog phones.
+; They are allowed to dial to all other phones
+include => phones-zap
+; They are also allowed to call through the trunk:
+include => trunk-9
+
+[from-pstn]
+; Calls from the PSTN enter here. Redirect calls to an IVR
+; or a default extension in the s context here. In this case we
+; redirect calls to Zaptel channel 1:
+exten => s,1,Dial(Zap/1)
+
+[astribank-inputs]
+exten => s,1,Set(ZAP_CHAN=Cut(${CHANNEL},-,1))
+exten => s,n,Set(ZAP_CHAN=Cut(${ZAP_CHAN},/,2))
+; 11 is the number of the first input port. At least in the sample
+; configuration below.
+exten => s,n,Set(INPUT_NUM=Math(${ZAP_CHAN}-11))
+; The sample below just logs the signal.
+exten => s,n,NoOp(Got signal from input port number ${INPUT_NUM})
+; Alternatively:
+;exten => s,n,System(run something)
+
+; No. We did not forget the context astribank-outputs. Output
+; ports only get calls from the PBX. Thus they don't need a context
+; of their own.
+
/proc Interface
"""""""""""""""