This is a comprehensive tone detection application. It allows all the tone detection parameters to be specified and is suitable for testing non-standard tables of tones. For testing basic tone detection, there are two simpler programs, detraw and detect.
Go to directory $(TiNG)/test.
You must have these firmware modules loaded:
Run tonedet
with the appropriate options (the program is
gen-LINUX_V6/tonedet or
gen-WINNT_V6/tonedet
depending on which operating system you are using).
Command line options are:
-t <timeslot>
| timeslot to use (see Test program timeslots). |
-x <modspec>
| Use these Prosody processor modules, specified as described in Test programs: Specifying Prosody Processor modules |
For example,
gen-WINNT_V6/tonedet -x x:1.2.3.4/mykey -t 64:0
would start the program with timeslot 64:0 configured as the timeslot to listen on. It does not yet start listening - it prints a prompt and waits for commands to be entered. The prompt looks like this:
mx:1.2.3.4/mykey[0]
which shows the Prosody processor module is correctly selected (in this example, module 0 on card with address 1.2.3.4). Each line entered is one command, which consists of one character followed by any parameters. The commands are:
Character | Meaning | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f FREQ1 FREQ2
| Perform
sm_add_input_freq_coeffs()
to add a new frequency to the tone table. The
parameters are:
f 679.6875 710.9375would add the lowest frequency used by DTMF tones. This command responds by printing the tone id returned. | ||||||||||||||||||
t ID1+N1 ID2+N2 3RD SNR MINPWR TWIST
| Perform
sm_add_input_tone_set()
to add a new frequency to the tone table. The
parameters are:
t 0+4 4+4 0.0794 0.7556 1e8 10would add a tone set equivalent to the prefedined DTMF tone set (tone set 0). This command responds by printing the tone set id returned. | ||||||||||||||||||
j TSID WHAT VAL
| Perform
sm_adjust_input_tone_set()
to change a tone detection setting. The
parameters are:
j 0 3rdPeak 0.0794would set the 'third peak' value for toneset 0 to its default. This could also be done numerically with j 0 0f 0.0794
| ||||||||||||||||||
r TSID
| Perform sm_reset_input_cptones() to clear the set of call-progress tones and specify the tone set for new ones. | ||||||||||||||||||
c TID [ FID MAX MIN ]*
| Perform
sm_add_input_cptone()
to add a new call-progress tone. The TID paramter is the
new tone ID, and the remaining parameters specify
the cadence of the new tone, and are repeated for each
element in the tone. They are:
c 4 1 288 512 0 128 256 1 288 512would add a call-progress tone the same as the predefined U. K. ring tone (tone 4). | ||||||||||||||||||
m MODSPEC
| Select the Prosody processor module to use. Subsequent commands will operate on the specified module. See Test programs: Specifying Prosody Processor modules for details. | ||||||||||||||||||
l c
| (letter 'l') Start listening for call progress tones. Listening continue until another 'l' command or until the program is terminated. | ||||||||||||||||||
l {1 ,40 ,64 }[EL ] [m ] [s N]
| (letter 'l') Start listening for call progress tones.
Listening continue until another 'l' command or until
the program is terminated. The parameters control the
fields passed to
sm_listen_for().
l 40E m s2would start listening for tones in toneset 2 with minimum duration 40 mS, reporting at the end of each tone and mapping the tones to digits. | ||||||||||||||||||
# anything | Do nothing. This is intended for use in files of commands for comments. | ||||||||||||||||||
' test | Print the text. This is intended for use in files of commands so that it's possible to tell how much of the file has been read. |
When it detects anything, it prints a description of what was detected. For example:
Digit *: 42 0
means that it detected the DTMF digit *
and that the
param0 and
param1 fields
from sm_get_recognised()
were 42
and 0
respectively.
.
The source code for this program is provided (detect.c).
This is one of the Prosody test programs .