Prosody installation guide: test programs: rtpclerk

This is an application which aids testing. It co-ordinates the use of port numbers and addresses for RTP streams. In normal use of RTP, this is done by SIP, but for testing it is sometimes convenient to have a much simpler scheme which automatically connects streams.

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

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

Command line options are as follows.

-i address The address on which to listen. If this option is omitted, rtpclerk will listen on all local addresses.
-p port The port on which to listen.

The rtpclerk waits for two kinds of connections. The first kind is from a program such as rtprec, which informs rtpclerk of the address and port on which each instance is listening for a RTP stream. The second kind is from a program such as rtpplay, which asks for an address and port to which it will send an RTP stream.

Example scenario

Suppose you want to test sending three RTP streams between two Prosody X cards. The addresses have been configured as follows:

Host10.0.0.1
First card10.0.1.1
Second card10.0.1.2

This test scenario requires us to run rtpplay to generate the RTP streams, rtprec to record them as they arrive, and rtpclerk to co-ordinate the play and record pairs so that they connect to each other. These three programs must run simultaneously. For manual testing, it is most convenient to run each in a separate window, since that allows the output generated by each to be easily viewed. First, the rtpclerk must be started:

	rtpclerk -p 12345

Next we start the rtpplay, since it must wait for the recordings to get the port numbers:

	rtpplay -n 3 -c alaw -Fa -m 8 -Ca 127.0.0.1 -Cp 12345 -x x:10.0.1.1/mykey file.alaw

The rtpplay program will print "awaiting port number".

Finally, we start the rtprec:

	rtprec -n 3 -c alaw -Fa -m 8 -Ca 127.0.0.1 -Cp 12345 -L 10.0.1.2 -x x:10.0.1.2/mykey
	rec-%d.alaw

This results in three RTP streams configured for A-law using payload type 8 being sent from 10.0.1.1 to 10.0.1.2 each of which is a copy of the data in file.alaw and is being recorded into files such as rec-16388.alaw (where the exact name depends on the port number used).

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


This is one of the Prosody test programs .