isdnrepSection: Linux System Commands (1)Updated: 2000/11/06 |
isdnrepSection: Linux System Commands (1)Updated: 2000/11/06 |
The format in which times are given is described below. The time span has the following syntax:
Warning! Entries are really deleted from the file. Careless use can result in all entries being deleted, e.g. with "isdnrep -d -".
"number" is specified in the same format as in configuration files (see isdn.conf(5)). E.g. wildcards can be used.
If the flag 'm' is given, the corresponding MSN is meant. E.g.: "m2" means MSN#2. If "m0" is given, all numbers are to be displayed.
If the flag 'n' is given, the given number is not to be displayed.
The default format string for (non-HTML output) is
" %X %D %15.15H %T %-15.15F %7u %U %I %O"
With the following string all the important data is displayed while keeping the total length to 80:
"%X%D %10.10H%T%-14.14F%U%I %O"
The above string is put into isdn.conf at installation as REPFMTSHORT and can be used with -Fshort.
REPFMT1 = ... # -> isdnrep -F1
REPFMTMYSTRING = ... # -> isdnrep -Fmystring or
isdnrep -F MYSTRING
answering machine messages
The %C can be used in the isdnrep output format to make a link to a voice recording file. For this to work, the following entry is needed in the [ISDNLOG] section in isdn.conf:
VBOXPATH= /var/spool/vbox/fred/incoming # incoming directory pathname
Now isdnrep can find the file correctly. Clicking on this link will cause the file to be sent. These files are in ZyXEL format; the browser cannot use these directly. The type is given by isdnrep as follows:
Content-Type: application/x-zyxel4
The correct application (helper) for this has to be configured in the browser. Alternatively, a conversion program can be specified to isdnrep which will convert the ZyXEL format. The pathname of the file to convert is given as a parameter to the program.
In the [ISDNLOG] section of isdn.conf an entry as follows specifies which conversion program to use:
VBOXCMD1 = /usr/bin/program1
for versions 0.x and 1.x of vbox, and
VBOXCMD2 = /usr/bin/program2
for versions 2.x of vbox. Both entries can be given, isdnrep recognizes which version created the recording.
The program must first output a line with the content-type, followed by the data itself. To convert the ZyXEL format into a WAV file, the following script may be used:
#! /bin/sh
##
## script to play voice messages from vbox-2.0
##
## WARNING! If the paths are not set correctly,
## netscape may simply crash!
PATH=$PATH:"path to sox":"path to pvftools":"path to vbox"
FILENAME1=/tmp/voxplay.$$.voc
FILENAME2=/tmp/voxplay.$$.wav
VOLUME=8
vboxtoau <$1 | \
autopvf | \
pvfamp $VOLUME | \
pvfcut 0.20 | \
pvftovoc > $FILENAME1
sox $FILENAME1 $FILENAME2
echo Content-Type: audio/x-wav
echo
cat $FILENAME2
rm -f $FILENAME1 $FILENAME2
The script above needs the packages sox and pvftools.
Additionally, the browser needs to be told how to handle "audio/x-wav".
This is done by adding the following lines to the files listed:
The package NAS (Network Audio System) may be needed.
Now, when the browser is started, it will recognize WAV files and start the corresponding program to handle these. The WAV format has been chosen as this can also be played from a Windows pc.
faxes received by mgetty
When %G is used in the isdnrep output format, any faxes received by mgetty will be accessible via a HTML link, in the same manner as the ansering machine messages.
For the faxes the following entry in the [ISDNLOG] section in isdn.conf is needed:
MGETTYPATH = /var/spool/fax/incoming
WARNING: if isdnrep doesn't have permission to read the files, they will not be displayed; there will be no error message.
When isdnrep passes these files back to the browser, they have the G3 format. The following header is used to notify the browser of this:
Content-Type: application/x-faxg3
As the browser probably doesn't understand this format, the following changes to the files listed are needed:
The program g3view has to be installed for this to work.
If now the link is clicked on, the browser will automatically start the external g3view to handle this data.
If you prefer another format (instead of G3) such as JPEG, the format has to be converted. The following entry in the [ISDNLOG] section of isdn.conf takes care of this:
VBOXCMD = /usr/bin/g3tojpeg # example
The script g3tojpeg can be something like this:
#! /bin/sh ## ## command to display faxes in a browser ## ## WARNING! If the paths are not set correctly, ## netscape may simply crash! export PATH=$PATH:"path to g3topbm":"path to convert" echo Content-Type: image/jpeg echo g3topbm < $1 | convert pbm:- jpeg:-
The packages ImageMagick and mgetty are needed. Mgetty is probably already installed if you want to use this feature :-)
The advantage of the JPEG format is that it can also be displayed by a browser running on a Windows pc.
summary
A suitable value for REPFMTWWW is
REPFMTWWW = "%X %D %17.17H %T %-17.17F %-20.20l SI: %S %9u %U %I %O %G %C"
Netscape 3.0 Gold and Arena have been tested, and both work fine with isdnrep's HTML output, although Arena's display is not as colourful as Netscape's.
A known problem (which is impossible to solve completely) is determining the relationship between an isdn connection and a fax or vbox recording. Unfortunately the times for isdnrep, mgetty and vbox differ. Isdnrep tries to make the best guess, but it's always possible that e.g. a fax is connected to the wrong isdn connection.
$ isdnrep -v -t 6/1/96
I S D N Connection Report - Tue Aug 26 22:21:19 1997
Sat Jan 6 1996
00:54:19 UNKNOWN -> UNKNOWN No user responding (4)
[...]
16:33:24 0:03:23 UNKNOWN -> UNKNOWN 7 EH 0,84 DM
17:33:47 UNKNOWN -> UNKNOWN Unallocated (unassigned)(5)
number
20:02:28 0:02:37 Phone/HDLC <- UNKNOWN (1)
20:09:53 0:07:01 Modem/X.75 -> T-Online 3 EH 0,36 DM (2)
21:27:56 UNKNOWN -> UNKNOWN User busy (3)
22:09:41 0:29:36 UNKNOWN -> UNKNOWN 43 EH 9,89 DM*
======================================================================
1 IN= 0:02:37, 13 OUT= 3:40:14, 3 failed 210 EH 25,20 DM
(6)^^^^^^^^^^^^ (7)^^^^^^^^^^^^^ (8)^^^^^^^ (9)^^^^^^ (10)^^^^^^^^
DIALOUT Summary for Sat Jan 6 1996 (11)
-----------------------------------------------------------
T-Online 1 call(s) 0:07:01 3 EH 0,36 DM
UNKNOWN 11 call(s) 0:17:00 20 EH 2,40 DM
DIALIN Summary for Sat Jan 6 1996 (12)
-----------------------------------------------------------
UNKNOWN 1 call(s) 0:02:37
Zone 1 : City 2 call(s) 2:23:13 50 EH 6,00 DM (13)
Zone x : UNKNOWN 11 call(s) 0:17:00 20 EH 2,40 DM
Notes
If the charge units are marked with "*", the PTT switch did not give charge info; these are the number of units guestimated by isdnrep.
Examples:
Examples:
Examples of time spans and their meaning: