# ThroughPacket sample: tpktsamp

tpktsamp demonstrates creating, connecting, enabling ThroughPacket connections for transferring data across the gateway. tpktsamp requires the test equipment to place and receive voice calls over CG board interfaces.

#### Featured functions

mspCreateEndpoint, mspCreateChannel, mspConnect, mspEnableChannel, mspSendCommand, mspDisconnect, mspDisableChannel.

tpktsamp also uses Natural Access functions to initialize the MSPP service, and to set up event queues and contexts and uses the NCC service to perform call control at the PSTN interface.

#### Usage

demo

## Running tpktsamp

#### Before you begin

Before running the demonstration program:

1. Edit the tpktsamp configuration file (demo.cmd) to specify the following information:

   Entry | Description | Allowed values and default
   -b boardnum | CG board number. Default is 0. | N/A
   -p ccprotocol | Call control protocol to use. | Default is wnk0.
   -c tpktmode | ThroughPacket session delivery mode to use. | complex = Payloads from different sessions are combined into larger packets. simple = Separate media sessions are carried in separate packets.
   -E | Disables echo cancellation processes performed on board DSPs. Set this option when using hardware echo cancellation on CG 6565 and CG 6565C boards. | N/A
   -l localIPaddress | Local IP address of the CG board Ethernet interface. | IPv4 or IPv6 address. There is no default local IP address.
   -l localgtwaddress | Remote L1 gateway address. | IPv4 or IPv6 address. here is no default remote L1 gateway address
   -u UDPportnum | Voice media (RTP) UDP port number. The next channel increments this UDP port number by two. Therefore, for the default port, the first channel uses port 50000, and the next one uses 50002, then 50004, and so on. | UDP port number.
   -t numcalls | Number of ThroughPacket voice calls to start. | Default is 1.
   -v numcalls | Number of RTP voice calls to start. | Default is 0.
   -s timeslot | Timeslot at which to start. | Default is 0.
   g vocodertype | Type of encoder/decoder filter to use. Use commas with the supported vocoder types in the following combinations: Entering a single vocodertype without commas specifies a full duplex path that uses the specified encoder and decoder. Inserting a comma before the vocodertype (,711) specifies a simplex channel that uses only the voice decoder. Inserting a comma after the vocodertype (723,) specifies a simplex channel that uses only the voice encoder. Separating different vocodertypes with a comma (723, 711) specifies a duplex channel that uses one type of encoder (G.723) with another decoder (G.711). | G723 G711 G726 G729
   -e flag | A flag to indicate whether to enable RTCP. Use only with RTCP sessions. | 0 = Disabled (default). 1 = Enabled.

2. Edit one of the sample Fusion CG board keyword files so that it contains configuration information appropriate for the system.

3. Edit the fusion_oamsys.cfg file so that it specifies the following information for the system:

   Entry | Description
   Bus | Bus number of the CG board.
   Slot | Slot number of the CG board.
   File | File name of the CG board keyword file.

Running the tpktsamp command file (demo.cmd) automatically boots the CG board according to the information specified in the modified fusion_oamsys.cfg file and the modified sample Fusion CG board keyword file.

#### Procedure

To run tpktsamp:

Step | Action
1 | Navigate to the nms\fusion\samples\tpktsamp directory.
2 | Edit the demo.cmd file (as described in Before you begin) to specify appropriate parameters for your system configuration and for desired program operation.
3 | Enter the following command: demo
4 | Use test equipment to establish phone calls to the Fusion gateway system line interfaces. All incoming calls from the CG board are routed to the specified destination IP address. tpktsamp displays information about the its activities as it performs data transfer and conversion tasks.
5 | Enter any of the following options at the prompt. These commands take effect for all active ports:
Option | Description
A | Increase jitter buffer depth by 1.
B | Decrease jitter buffer depth by 1.
C | Query jitter state.
D | Query encoder state.
E | Query decoder state.
F | Query ThroughPacket and RTP state.
G | Disable ThroughPacket filters.
H | Reconfigure and re-enable ThroughPacket filters.
1 | Map payload ID 127 for G723Low vocoder.
Encoder and decoder filters can receive queries only when they are enabled.
6 | Press the ESC key to exit the program.