Creates an MSPP endpoint.
DWORD mspCreateEndpoint ( CTAHD ctahd, MSP_ENDPOINT_ADDR* addr, MSP_ENDPOINT_PARMS* parm, MSPHD* ephd )
|
Argument |
Description |
|
ctahd |
Context handle used to open the MSPP service. |
|
addr |
Pointer to an MSP_ENDPOINT_ADDR structure, as shown: typedef struct tag_MSP_ENDPOINT_ADDR For more information refer to Overview of endpoint address structures. |
|
parm |
Pointer to an endpoint parameters structure, as shown: typedef struct tag_MSP_ENDPOINT_PARMS For more information refer to Overview of endpoint parameter structures. |
|
ephd |
Pointer to a MSPP return endpoint handle. |
Note: For more information about the MSPP channel address and parameter structures, refer to the Overview of the MSPP service parameters.
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BAD_ARGUMENT |
A function argument includes an invalid value or a required pointer argument is NULL. |
|
CTAERR_INVALID_CTAHD |
The handle is invalid. |
|
CTAERR_INVALID_HANDLE |
An invalid handle was passed as an argument to this function. |
|
MSPERR_DRIVER_COMMAND_FAILED |
An SPI command has failed. |
|
Event |
Description |
|
MSPEVN_CREATE_ENDPOINT_DONE |
Generated when a MSPP endpoint is created in response to mspCreateEndpoint. The event.value field can contain the following: SUCCESS MSPRSN_FAILED_TO_ALLOCATE The MSPP service is unable to allocate on-board resources. The event.objHd indicates the ephd of the created endpoint. |
Applications create MSPP endpoints by invoking mspCreateEndpoint and specifying a ctahd used to open the MSPP service instance. In addition, applications specify parameters in an address structure and a parameter structure that define the endpoint's configuration.
The address structure specifies the type of endpoint to create, as well as the source and destination addresses for transferring the data. The parameter structure configures specific features that will be available on the MSPP endpoint. For more information on MSPP parameters, refer to the Overview of the MSPP service parameters.
When it creates the MSPP endpoint, the MSPP service returns a unique endpoint object handle (ephd) that the application can use to configure and control the endpoint. MSPP endpoints are enabled by default. For more information, refer to Creating MSPP endpoints.
The MSPP service provides the following set of endpoints for sending and receiving data to and from a network interface:
|
Endpoint type |
Filter ID |
Description |
|
DS0 (PSTN) |
MSP_ENDPOINT_DS0 |
Provides an entry and/or exit point for transferring a voice over IP data stream, or a T.38 fax data stream. DS0 endpoints can be connected to simplex or duplex channels. |
|
RTP IPv4 full duplex |
MSP_ENDPOINT_RTPFDX |
Provides an entry and exit point for a full duplex voice over IPv4 stream (includes an RTP header within UDP packets). |
|
RTP IPv4 simplex receive |
MSP_ENDPOINT_RTPIN |
Provides an entry point for a simplex voice over IPv4 data stream (includes an RTP header within UDP packets). |
|
RTP IPv4 simplex send |
MSP_ENDPOINT_RTPOUT |
Provides an exit point for simplex voice over IPv4 data streams (includes an RTP header within UDP packets). |
|
RTP IPv6 full duplex |
MSP_ENDPOINT_RTPFDX_V6 |
Provides an entry and exit point for a full duplex voice over IPv6 stream (includes an RTP header within UDP packets). |
|
RTP IPv6 simplex receive |
MSP_ENDPOINT_RTPIN_V6 |
Provides an entry point for a simplex voice over IPv6 data stream (includes an RTP header within UDP packets). |
|
RTP IPv6 simplex send |
MSP_ENDPOINT_RTPOUT_V6 |
Provides an exit point for simplex voice over IPv6 data streams (includes an RTP header within UDP packets). |
|
TPKT full duplex |
MSP_ENDPOINT_TPKT |
Provides an entry and exit point for a duplex voice data stream in which packets are processes according to the ThroughPacket multiplexing algorithm. |
|
T38UDP full duplex |
MSP_ENDPOINT_T38FDX |
Provides an entry and exit point for full duplex T.38 fax UDP data streams (including those carrying T.38 fax data). |
For information about address and parameter information required to create types of MSPP endpoints, refer to the Overview of the MSPP service parameters.
mspDestroyEndpoint, mspDisableEndpoint, mspEnableEndpoint
mspAddr.eEpType = MSP_ENDPOINT_DS0;
mspAddr.nBoard = DEFAULT_BOARDID;
mspAddr.size = sizeof(DS0_ENDPOINT_ADDR);
mspAddr.EP.DS0.nTimeslot = 1;
mspParm.eParmType = MSP_ENDPOINT_DS0;
mspParm.EP.DS0.media = MSP_VOICE;
mspParm.size = sizeof(DS0_ENDPOINT_PARMS);
ret = mspCreateEndpoint( hCta, &mspAddr, &mspParm, &hEp);
if (ret != SUCCESS)
return FAILURE;
// Wait for event
ctaWaitEvent( hCtaQueHd, &Event, CTA_WAIT_FOREVER );
// Check the reason code
if ( Event.id != MSPEVN_CREATE_ENDPOINT_DONE ||
Event.value != CTA_REASON_FINISHED )
return FAILURE;