# Creating TPKT endpoints

The MSPP service provides a standard set of endpoints that are each capable of sending and receiving data to and from a particular network-specific format. These endpoints provide sources through which data can enter and leave the system. MSPP TPKT endpoints perform payload multiplexing and de-multiplexing with the voice data that is transferred through them.

Applications create MSPP endpoints by invoking the MSPP service function mspCreateEndpoint. To create a TPKT endpoint, the application specifies a ctahd associated with a MSPP service instance and specifies TPKT parameters in two structures:

Structure | Parameters
TPKT endpoint address structure | typedef struct tag_MSP_ENDPOINT_ADDR { DWORD nBoard; // board number DWORD eParmType; MSP_ENDPOINT_TPKT } MSP_ENDPOINT_ADDR;
TPKT endpoint parameter structure | typedef struct tag_MSP_ENDPOINT_PARMS { DWORD size; MSP_ENDPOINT_PARAMETER DWORD eParmType; MSP_ENDPOINT_DS0, union { typedef struct { DWORD localSessionID; DWORD localSessionSeq; DWORD remoteSessionID; DWORD remoteSessionSeq; DWORD deliveryMethod; BYTE remoteGatewayIP[4]; DWORD coderType; } msp_TPKT_ENDPOINT_CONFIG; } EP; } MSP_ENDPOINT_PARAMETER;

UDP port conflicts can occur if the application running on the host system uses UDP port number already associated with an RTP or TPKT endpoint or vice versa. To guarantee that no UDP port conflicts occur when opening a UDP socket on the board that will be used for a TPKT session, the application can open a socket with the same UDP port on the host. Opening a socket in this way causes the host IP stack to generate unique UDP port numbers for each RTP or TPKT session without creating address conflicts. For more information, refer to the CG board manual.