summaryrefslogtreecommitdiff
path: root/xpp/README.Astribank
blob: 5e491767479547f9759a8a4a7a90accf47829d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
This file documents the Zaptel drivers for the Xorcom Astribank8 Channel Bank.
The drivers reside in a separate subdirectory, xpp/ .


Building and Installation:
"""""""""""""""""""""""""
Building and installation is basically like the normal procedure of 
installing Zaptel with some additions.

Building drivers:
""""""""""""""""
From the toplevel zaptel directory run a command similar to (I used line
continuation to prevent line wrapping):

 $ make \
        KSRC=/usr/src/kernel-headers-2.6.12-1-386       \
        KVERS=2.6.12-1-386                              \
        XPPMOD=xpp/                                     \
        EC_TYPE=CAN_KB1

 - The KSRC= points to a configured kernel source tree.
 - The KVERS= should match the relevant tree version.
 - The XPPMOD= instructs the Zaptel Makefile to descend into the xpp/
   subdirectory. The slash (/) in the end is mandatory.
 - The EC_TYPE= select the echo canceler.

Building firmware utilities:
"""""""""""""""""""""""""""
Then you should compile the firmware loading utilities. Simply go
to the zaptel/xpp/utils and run make.

Those who don't use prepackaged drivers should make sure they also
install the (externally available) fxload utility.

Installation:
""""""""""""

All firmware files should be copied to a new directory:
  /usr/share/zaptel/

The xpp_fxloader and xpp_fxloader.usbmap should be copied to:
 /etc/hotplug/usb/

In addition, the file xpp/xpp_modprobe contains optional modprobe settings.
It may be copied verbatim into /etc/modprobe.conf or (better) copied to
/etc/modprobe.d/ .

Loading Firmware Details:
""""""""""""""""""""""""
The Astribank needs a firmware loaded into it. Without the firmware, 
the device will appear in lsusb with vendor ID 04b4 and product ID 8613
The firmware is provided in the Intel hex format. It can be loaded using 
the program fxload, which is typically part of the package 'fxload' or 
'hotplug-utils' . 

To load the firmware automatically using the standard hotplug script, 
place xpp/utils/xpp_fxloader and xpp/utils/xpp_fxloader.usermap in 
/etc/hotplug/usb and place xpp/utils/*.hex in /usr/share/zaptel .

Alternatively, xpp_fxloader when given the parameter 'xppdetect' will load 
the firmwares from /usr/share/zaptel/ . You can use it to load the 
firmware manually.

You should then get in lsusb the vendor ID e4e4 and device ID 2121
(those IDs are temporary and likely to change in upcoming versions). 
Once there is such a device, the xpp_usb driver should load
automatically on hot-plugging. In fact, you may find it simpler to
disconnect and reconnect the device than running 'modprobe xpp_usb'.


The driver has been separated into several modules: xpp.ko, xpd_fxs.ko and 
xpp_usb.ko . Generally you only need to modprobe xpp_usb, and it should also
be loaded by hotplug when you connect the Astribank. However in order for it
to load xpd_fks.ko correctly

Refer to the instructions for Zaptel. After our small patches were applies, 
you get xpp.ko which is basically yet another zaptel driver, like wcfxo
and wctdm.

When loaded, you should get one span, of 8 extensions, 2 output ports and 
4 input ports:

  root@rapid:~# cat /proc/zaptel/2 
  Span 1: XBUS-0/XPD-0 "Xorcom XPD #0/0: FXS" NOTOPEN 

           1 XPP_FXS/0-0 FXOKS (In use) 
           2 XPP_FXS/0-1 FXOKS (In use) 
           3 XPP_FXS/0-2 FXOKS (In use) 
           4 XPP_FXS/0-3 FXOKS (In use) 
           5 XPP_FXS/0-4 FXOKS (In use) 
           6 XPP_FXS/0-5 FXOKS (In use) 
           7 XPP_FXS/0-6 FXOKS (In use) 
           8 XPP_FXS/0-7 FXOKS (In use) 
           9 XPP_OUT/0-8 FXOKS (In use) 
          10 XPP_OUT/0-9 FXOKS (In use) 
          11 XPP_IN/0-10 FXOKS (In use) 
          12 XPP_IN/0-11 FXOKS (In use) 
          13 XPP_IN/0-12 FXOKS (In use) 
          14 XPP_IN/0-13 FXOKS (In use) 

For such a simple case you could use:

/etc/zaptel.conf:

fxoks=1-14
loadzone=us
tonezone=us

/etc/asterisk/zapata.conf:

[channels]
group=1
signalling=fxo_ks
immediate=no

context=from-internal
channels => 1-8

; actually they will never generate calls, so the context 
; here is irrelevant
;context=outputs
channels => 9-10

; input ports should get an answer:
immediate=yes
context=inputs
channels => 11-14

;;;;;; end of zapata.conf


/proc Interface
"""""""""""""""
The Astribank drivers provide their own /proc interface under /proc/xpp .
(Note that the details of this interface are still potentially subject to 
changes)

/proc/xpp/xbuses lists the connected devices (an xbus is such a device), 
one per line. A device is normally "connected". "missing" means that it
was disconnected, but Asterisk still holds channels from it open. You can
also see in the xbuses file to which physical connection the Astribank
is connected.

/proc/xpp/sync is a read/write file . It prints the current
synchronization source. printing to it can change the synchronization
source. Host-synchronization is currently the default but for better
sound quality you should synchronize from the Astribank.

/proc/xpp/XBUS-n gives information about device number n (starting from
0). under it, /proc/XBUS-n/XPD-m gives information regarding span number
m in that device.

/proc/xpp/XBUS-n/XPD-m/zt_registration is a read-write file for
manually registering/unregistering the span with Zaptel. A span will 
register automatically when generated, though. Span unregistration may
fail if some channels from the span are used (e.g: by Asterisk).
Registration is by writing 1 and unregistration is by writing 0 to the
file.

(There are a bunch of other status files under /proc/xpp/ )


Useful Module Parameters:
""""""""""""""""""""""""
zap_autoreg: (xpp)
Register spans automatically (1) or not (0). Default: 1. 
Unsetting this could be useful if you have several Astribanks and you 
want to set their registration order manually using zt_registration in 
the /proc interface.

initialize_registers (xpd_fxs)
The script that is run to initilize registers of the device. The default is 
/usr/share/zaptel/initialize_registers . 
Setting this value could be useful if that location is inconvient for you.

print_dbg: (all modules)
It will make the driver print tons of debugging messages. Can be sometime 
even handy, but overly-verbose in the case of xpp_usb. Can be safely 
set/unset at run-time using /sys/modules .



BTW: XPP here does not stand for X Printing Panel, XML Pull Parser, 
X-Windows Phase Plane or XML Professional Publisher. It is simply the 
Xorcom Peripheral Protocol, which connects a computer to a XPD (Xorcom 
Peripheral Device).