# Creating MSPP channels

An MSPP channel is made up of one or more filters that transform a real-time flow of voice or fax data from one form to another. For example, an MSPP G.711 duplex channel encodes and decodes (according to the G.711 algorithm) a two-way flow of voice data as it moves between the PSTN and packet network. The application creates the MSPP channels independently of MSPP endpoints, and then uses channels to connect pairs of compatible endpoints.

Applications create MSPP channels with mspCreateChannel. When invoking mspCreateChannel, the application provides a handle (ctahd) and specifies parameters in an address structure and a parameter structure. The MSPP service returns a unique channel object handle (chnhd) that the application can use to configure and control the channel. Once the application creates an MSPP channel, it can use the channel to connect MSPP endpoints and create a simplex or duplex media path for voice or fax data.

The following table provides an overview of the information provided with mspCreateChannel for different types of MSPP channels:

Channel type | Address structure | Parameter structure
Voice (for example G.711 or G.723.1.) | Board number Channel type Enable or disable special filter attributes (with the FilterAttribs parameter) | Jitter parameters Voice encoder parameters Voice decoder parameters
Record | Board number Channel type | Jitter parameters Note: Applications specify initial record channel jitter filter settings within an MSP_VOICE_CHANNEL_PARMS structure.
RTP switching | Board number Channel type | None
T.38 fax relay | Board number Channel type | Enable or disable channel features (NSF filtering or ECM) Types of unsolicited events the endpoint returns Maximum bit rate and timeout value for the fax transmission

The application specifies the type of channel it wants to create (voice, T.38 fax or switch) in the channel address structure shown below:

typedef struct tag_MSP_CHANNEL_ADDR
{
DWORD size;
DWORD nBoard;
MSP_CHANNEL_TYPE channelType;
DWORD FilterAttribs;
} MSP_CHANNEL_ADDR;

Each MSPP channel is composed of a linked set of filters that are organized to carry out operations with data that flows through the channel. When the application creates the channel type in the channel address structure, the MSPP service initializes all the filters necessary to carry out the operations performed by that channel.

The MSPP service provides the following channel types (voice channels are supported in duplex and simplex form):

Channel | Description
Voice duplex | Transfers encoded voice data to an IP network (in G.711, G.723.1, G.729A, or G.726 format) and decoded voice data to a PSTN.
Voice encoder | Transfers encoded voice data to an IP network (in G.711, G.723.1, G.729A, or G.726 format).
Voice decoder | Transfers decoded from G.711, G.723.1, G.729A, or G.726 format to voice data for a PSTN.
Record | Performs jitter functions for native record audio streams (in G.711, G.723.1, G.729A, or G.726 format) without performing voice encoding or decoding.
RTP switching | Transfers a simplex data stream between RTP endpoints (IPv4, IPv6, or a combination).
T.38 fax | Transfers a duplex T.38 fax data stream between T38UDP and DS0 endpoints and converts digital fax data to analog form and analog data to digital form.

When using mspCreateChannel, the application also provides a channel parameter structure that configures specific elements of the channel's functionality (the parameter structure is not required for RTP switching channels). For example, when creating a T.38 fax full duplex channel the application specifies the following parameters:

typedef struct tag_msp_FILTER_FAXRELAY_CONFIG
{
WORD modemask;
WORD eventmask;
WORD maxbitrate;
WORD timeout;
} msp_FILTER_FAXRELAY_CONFIG;

Parameters in the msp_FILTER_FAXRELAY_CONFIG structure specify various aspects of the fax relay filter's behavior such as the event mask associated with the filter and the maximum bit rate of fax transmissions processed by the filter.

When creating a channel, the application can specify the value 0xFFFF for 166-bit parameters or 0xFFFFFFFF for 32-bit parameters (or -1 in decimal format) to accept the default value for any parameters within the channel's parameter structure. Otherwise, the MSPP service expects the application to provide valid settings for each parameter in the channel parameter structure.