blob: 751d74fb34a0adcb42a172da9a0143a205e20666 (
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
|
Astribank Metering Interface
""""""""""""""""""""""""""""
In analog phone lines, some PBX'es can generate/detect special tones
used for billing the call (phone metering).
Astribank FXS and FXO drivers now support these features if compiled
with -DWITH_METERING
Software interface:
FXS - To generate a metering pulse, write the channel number (0-7) into
the file:
/proc/xpp/XBUS-nn/XPD-mm/metering_gen
Where:
nn = XBUS number
mm = XPD number
Writing channel number 31 signifies a broadcast -- i.e: generate
metering pulse on all channels.
Example:
echo 31 > /proc/xpp/XBUS-00/XPD-00/metering_gen
FXO - To read current metering counters from an FXO, simply read:
/proc/xpp/XBUS-nn/XPD-mm/metering_read
The format is self documenting:
# Chan Meter (since last read)
0 5
1 0
2 12
...
Reading this file reset the counters. So the numbers always show
the meters since last read.
The metering register should be sampled at a rate which is double
than the highest expected metering pulses. This rate is adjustable
via a module parameter "poll_metering_interval". The current default
is 500ms which is good if the metering pulses are sent not more
often than once per second.
Remark: The FXS hardware can generate maximum 0.85 volt RMS, while the FXO
needs a minimum of 1.1 volt RMS for detection. Therefore, this
feature cannot be tested in a loopback (Astribank-FXS to Astribank-FXO).
|