Prosody installation guide: test programs: rtprec

This is a very simple recording application. It records a RTP stream into a file. It can be stopped by a command, but otherwise records forever. The recorded file has no headers or other formatting of any kind - just the data. See also locrec which performs the equivalent function for TDM timeslots.

Go to directory $(TiNG)/test/rtprec.

You must have downloaded firmware modules as listed below.

Run rtprec with the appropriate options (the program is gen-LINUX_V6/rtprec or gen-WINNT_V6/rtprec depending on which operating system you are using).

Command line options are as follows. All options which configure a codec start with -C.

-CF frame_len The duration of a coded frame in ticks.
-CNe Enables comfort noise
-CNm comfort_noise_payload_mapping The payload type code to use for comfort noise packets. Only relevant when comfort noise has been enabled.
-CP Enables packet loss concealment.
-CV variant The codec variant to use (GSMFR only).
-Ca clerk_addr The address of the clerk daemon.
-Cb bitrate The bit rate of the RTP coded data in bits per second. Only relevant where the selected codec has more than one possible rate.
-Cp clerk_port The port of the clerk daemon.
-E tone_elim_mode use tone elimination, with mode tone_elim_mode.
-F format format of the file to record. The known formats can be listed by specifying a question mark (?).
-J max_ms The maximum jitter allowed in milliseconds.
-L local_ip The IP address on which we are listening, which is passed to the clerk daemon.
-P per_mod The maximum number of channels to allocate on a single module.
-S tone_set the toneset to use for tone elimination (if enabled).
-T threshold set the data transfer threshold
-U Show message when overruns occur.
-X maxoctets Limit the length of all recordings to this amount of data.
-a agc use AGC
-c codec Selects the RTP codec to use. The known codecs can be listed by specifying a question mark (?).
-d Report detection of RFC2833 tone packets.
-e sil_elim use silence elimination, eliminating silences longer than sil_elim milliseconds. (default, 0, means do not eliminate silences)
-g Generate tones into the audio based on RFC2833 tone packets.
-j initial_ms The target jitter in milliseconds.
-l max_elapsed_time Set a maximum elapsed time for the recording to N milliseconds (default, 0, means no maximum).
-m payloadmapping The payload type for data produced by the codec.
-n numchan start recording this many channels (default = 1)
-q max_silence Set a maximum silence in milliseconds. As soon as this much silence occurs, the recording finishes. (default, 0, means no maximum).
-r rfc2833tones The payload type to use for RFC2833 tones. If this value is zero, no RFC2833 tones are sent.
-v volume adjust volume of the playback by this (in dB)
-x identifier Use these Prosody processor modules, specified as described in Test programs: Specifying Prosody Processor modules
-y sync syncronised record - prepare channels but don't start them until the 'g' command is given
<file> name of file from which data is to be recorded.

For example,

	gen-WINNT_V6/rtprec -x x:1.2.3.4/mykey -F ALawPCM@8000 -c alaw -m 8 rec1.dat

would record data in A-law encoded speech into rec1.dat from the card 1.2.3.4. The RTP stream must be alaw with a payload mapping of 8. The stream must be sent to the port on which the VMP is listening. This can be reported by the application printing it out, allowing you to use any means to arrange for the RTP stream to be sent there, or it can be reported by the application to the clerk daemon if one has been specified.

The firmware modules that are required depend on the options you specify. Here are the details:

ModuleWhen needed
datafeed always
gainbg If you use '-a 1' for AGC or '-v' to adjust the volume
vmprx always
vmpplc If you use -CP to enable PLC.
sixkin when the file format is ACUBLKPCM@6000, ALawPCM@6000, OKIADPCM@6000, or ULawPCM@6000
recA when the file format is ALawPCM@6000 or ALawPCM@8000
recima when the file format is IMAADPCM
recmu when the file format is ULawPCM@6000 or ULawPCM@8000
recoki when the file format is OKIADPCM@6000 or OKIADPCM@8000
amr-nb when the RTP codec is AMR (Adaptive Multi Rate) narrowband.
evrc when the RTP codec is EVRC (Enhanced Variable Rate CODEC).
g7231a when the RTP codec is G.723.1.
g726 when the RTP codec is G.726.
g728 when the RTP codec is G.728.
g729ab when the RTP codec is G.729A.
gsm-efr when the RTP codec is GSM-EFR (Enhanced Full Rate).
gsm-fr when the RTP codec is GSM-FR (Full Rate).
ilbc when the RTP codec is iLBC (Internet Low Bit Rate Codec).
smv when the RTP codec is SMV (Selectable Mode Vocoder).
sync when the -y option is used

When this program starts, it starts as many channels as specified by the -n option, and then prints a prompt and waits for commands. While waiting for commands any running channels will be serviced, but status changes will not be reported. The commands are:

CharacterMeaning
(i.e. blank line - no command) Print status
?Print summary of possible commands
+Start another channel
a NSet AGC for future channels to N
ggo - allow channels held for synchronisation by -y option to start
G channo[=gain]gain - set gain of given channel which is already running
kNKill channel or VMP N, .
KNKill channel N, discarding any uncollected data.
lN set maximum elapsed time for future channels.
qQuit - exit without waiting for channels to finish.
TNSet TiNGtrace to N.
wQuit - wait for all channels to finish.
x NSet maximum octets for future channels to N
# anythingdo nothing - used for comments

The status is shown in each prompt. The prompt starts with two characters for each current channel. The first character indicates the status of the play for that channel:

CharacterStatus
*Active - data was transferred since printing last prompt
.Idle - no data was transferred since printing last prompt
-Done - recording has finished
 Channel is no longer in use
uUnderrun occurred since last printing prompt

The second character indicates the status of the VMP[rx] for that channel:

CharacterStatus
vIdle - VMP is idle (not yet started)
vBusy - VMP is running
-Done - VMP has finished
 Channel is no longer in use

The source code for this program is provided (rtprec.c).


This is one of the Prosody test programs .