# TPKT endpoint filter

Packetizes and multiplexes streams from single channels or multiple channels according to the ThroughPacket algorithm. For more information about TPKT endpoint filter endpoint filter parameters, refer to TPKT endpoint address structure and TPKT endpoint parameter structure.

Note: TPKT endpoints do not currently support IPv6.

#### Filter ID

MSP_ENDPOINT_TPKT

#### Initialization structure

TPKT_ENDPOINT_PARMS

#### Restrictions

Used in full duplex voice connections that use the ThroughPacket multiplexing algorithm.

#### Filter connections

Can connect to full duplex voice channels.

#### Commands

TPKT endpoints responds to the following filter command:

Command | Description
MSP_CMD_TPKT_CONFIG | Changes a TPKT endpoint configuration. Note: TPKT endpoints must be in a disabled state when receiving MSP_CMD_T38UDP_CONFIG commands.

When applications use the MSP_CMD_TPKT_CONFIG command to send the channel configuration information, they specify information in the following TPKT_ENDPOINT_PARMS structure:

typedef struct tag_TPKT_ENDPOINT_PARMS{
DWORD localSessionID;
DWORD localSessionSeq;
DWORD remoteSessionID;
DWORD remoteSessionSeq;
DWORD deliveryMethod;
BYTE remoteGatewayIP[4];
DWORD coderType;
DWORD frameDuration;
} TPKT_ENDPOINT_PARMS;

When sending MSP_CMD_TPKT_CONFIG commands, applications provide a pointer to a TPKT_ENDPOINT_PARMS structure. This structure contains all of the parameters used to configure the ThroughPacket endpoint when the application created it.

When using the MSP_CMD_TPKT_CONFIG command, applications can specify a value of 0xFFFF for 16-bit parameters or 0xFFFFFFFF for 32-bit parameters (or -1 in decimal format) to retain the existing settings for any endpoint parameters. Otherwise the MSPP service expects a new value for every parameter in the TPKT_ENDPOINT_PARMS structure. For more information about ThroughPacket endpoint parameters, refer to the Overview of endpoint structures or to the mspinit.h header file.

For a list of command IDs and their associated structures, refer to the mspcmd.h header file.

#### Queries

TPKT endpoint filters respond to the following filter query any time after the endpoint is created:

Query ID | Description
MSP_QRY_TPKT_CHANNEL | Retrieves information about the TPKT endpoint channel configuration and statistics.

Sending an MSP_QRY_TPKT_CHANNEL query returns the following structure (with substructures):

typedef struct tag_msp_TPKT_ENDPOINT_QUERY {
DWORD FilterId;
msp_TPKT_CHANNEL_ENTRY
msp_TPKT_CHANNEL_STATS
} msp_TPKT_ENDPOINT_QUERY;
typedef struct {
DWORD rxPkts;
DWORD txPkts;
} msp_TPKT_ENDPOINT_STATS;
typedef struct {
DWORD channelState;
DWORD localSessionID;
DWORD remoteSessionID;
DWORD localSessionSeq;
DWORD remoteSessionSeq;
DWORD deliveryMethod;
BYTE remoteGatewayIP[4];
DWORD coderType;
DWORD frameDuration;
DWORD secondsActive;
} msp_TPKT_ENDPOINT_ENTRY;

The returned msp_TPKT_ENDPOINT_STATS substructure provides the following information:

Field | Description
rxPkts | Number of packets received from the network since the endpoint was enabled.
txPkts | Number of packets sent to the network.

The returned msp_TPKT_ENDPOINT_ENTRY substructure provides the following information:

Field | Description
channelState | State of the session: 0 - created 1 - configured 2 - active
localSessionID | Local session ID.
remoteSessionID | Remote session ID.
localSessionSeq | Sequence number for detecting session overlap: 0|1
remoteSessionSeq | Sequence number for detecting session overlap: 0|1
deliveryMethod | Session delivery method.
remoteGatewayIP | Destination gateway for this session.
coderType | TPKT vocoder type.
frameDuration | Amount of voice data in a packet (for example, 10 ms, 20 ms).
secondsActive | Number of seconds that the TPKT endpoint has been active.

#### Details

Fusion applications can use MSPP service ThroughPacket (TPKT) endpoints to reduce the total bandwidth needed to transfer multiple sessions of data to a common destination over a packet network. TPKT endpoints group multiple payloads from separate voice channels into larger packets.

To implement TPKT endpoints on a Fusion system, you must:

Step | Action
1 | Configure TPKT data transmission parameters in the CG board's keyword file (using the NaturalAccess OAM API configuration parameters) and boot the board. These keywords specify: TPKT DLM file to load to the CG board. Data transmission parameters for TPKT endpoints created on the board.
2 | Create and configure TPKT endpoints with MSPP service functions.
3 | Connect the TPKT endpoints to MSPP channels and enable the channels.

For more information about NaturalAccess OAM API TPKT board keywords, refer to the Dialogic® NaturalAccess™ Fusion VoIP API Developer's Manual or the CG board installation manual.

Applications can create MSPP TPKT endpoints in one of two modes:

Protocol | Description
Complex | TPKT transport where payloads from different sessions are combined into larger packets to reduce the number of packets transferred to the network.
Simplex | TPKT transport where media packets for individual sessions are carried in separate packets. This type of transport is similar to RTP and does not significantly effect the bandwidth required by the application.

When the application creates TPKT endpoints, the localSessionID parameter assigns a session identifier to the endpoint. This session ID (an integer in the range of 0 to 4094) remains associated with the endpoint until the application destroys the endpoint. The application uses the remoteSessionID parameter to specify the ID of the session on the remote destination gateway.

Gateways exchange remoteSessionID and remoteSessionSeq information while performing IP call control prior to initiating TPKT sessions.

Applications use the MSPP function mspSendCommand (with the MSP_CMD_TPKT_CONFIG command) to change TPKT endpoint configuration parameters, and the mspSendQuery function (with the MSP_QRY_TPKT_ENDPOINT query) to retrieve TPKT endpoint configuration parameters. TPKT endpoints can receive commands or queries in any state (that is, enabled or disabled).

localSessionSeq and remoteSessionSeq parameters are flags with a value of 0 or 1. Applications use these parameters to detect session overlap. Session overlap occurs when an application disables an TPKT endpoint and then re-enables the endpoint to send data for a different session. Applications use localSessionSeq and remoteSessionSeq parameters to avoid these overlaps.

For example, when the application creates an active connection using a TPKT endpoint, the application can set the TPKT endpoint's localSessionSeq parameter to 0. If the application disables and then re-enables the TPKT endpoint, it can reset the localSessionSeq parameter to 1 by using mspSendCommand (while the endpoint is disabled). The remote TPKT endpoint uses the session sequence flag to discard packets intended for the disabled session. During the transition period when the remote gateway is not yet aware that the session has been disabled, the MSPP service running on the local gateway detects any packets directed to the disabled session and drops them.

TPKT endpoints distinguish between G.723.1 vocoders running at 6.4 kbit/s and G.723.1 vocoders running at 6.4 kbit/s. Standard Fusion G.723.1 vocoders, in accordance with RFC1890, do not distinguish between these vocoder types. When configuring G.723.1 vocoders for 5.33 kbit/s operation, use mspSendCommand to change the vocoder payload ID from the default (4) to 127.

For more information about using mspSendCommand to change the vocoder payload ID or about using ThroughPacket endpoints refer to the Fusion Developer's Manual.

#### See also

DS0 full duplex endpoint filter, Voice decoder channel filter, Voice encoder channel filter