Previous PageTable Of ContentsIndexNext Page



4 Initializing a Messaging API Application

4.1 Introduction

This chapter:

4.2 Making Switch Connections for AG ISDN

To allow an application access to ISDN channels, several MVIP switch connections must be made. In your AG configuration file, if EnableMvip=NO and DigitalMode=PRI, these settings are automatically made when the AG board boots. However, if EnableMvip=YES, the application must make these settings, using the CTA switching service or swish utility (CT Access) or SwitchPath function calls (AG Access).

The connections to be made are:

The following table shows the connections made by default when EnableMVIP=NO and DigitalMode=PRI.

4.3 Initializing CT Access or AG Access

To begin operations, the application initializes CT Access or AG Access, and creates a separate CTA context for each D channel and B channel it will require. To accomplish this:

For more information about initializing CT Access, see the CT Access Developer's Reference Manual. For more information about initializing AG Access, see the AG Access Developer's Manual.

4.3.1 Specifying D Channel CTA Context Streams and Timeslots

Create a separate CTA context for each D channel that your application will interact with. The AG Quad T, AG Quad E, AG Quad Connect T, and AG Quad Connect E can each support up to four separate D channels. The AG Dual T and AG Dual E can each support up to two separate D channels. The AG-T1 and AG-E1 can support one D channel each.

To open CTA contexts under CT Access, use ctaCreateContext followed by ctaOpenServices. To open CTA contexts under AG Access, use adiOpenPort. In each call to ctaCreateContext or adiOpenPort, specify:

Under CT Access, these values are included in the CTA_MVIP_ADDR structure passed to ctaCreateContext. Under AG Access, they are specified directly in the adiOpenPort.

4.3.2 Specifying B Channel CTA Context Streams and Timeslots

Along with your D channel contexts, create a separate CTA context for each B channel that your application will interact with. In each call to ctaCreateContext or adiOpenPort, specify:

Under CT Access, these values are included in the CTA_MVIP_ADDR structure passed to ctaCreateContext. Under AG Access, they are specified directly in adiOpenPort.

4.4 Accessing D Channels

Once one or more CTA contexts have been created for the D channels, initialize a separate ISDN protocol stack instance for each of these CTA contexts, and associate a specific D channel with each one. When this is done, a D channel is ready to send and receive messages.

4.4.1 Initializing ISDN Protocol Stack Instances

Use isdnStartProtocol to initialize ISDN protocol stack instances.

To start up an ISDN protocol stack instance for ISDN ACU call control or LAPD, set the protocol, partner_equip, and parms arguments as follows:

protocol Set to:

partner_equip
The type of equipment connected to the AG board. Set to one of the following:

If the AG board is...

And AG ISDN is to run in:

Set partner_equip to:

Connected to network

ACU configuration

EQUIPMENT_NT

Connected to network

LAPD configuration

EQUIPMENT_DCE

Acting as network

ACU configuration

EQUIPMENT_TE

Acting as network

LAPD configuration

EQUIPMENT_DTE

parms Pointer to a parameter structure to configure the protocol stack. If the application needs to change any of the parameters described in Appendix C: Parameters, pass a pointer to one of the following structures in this call:

If the application will not need to modify parameters, pass NULL to accept the default settings. The default parameters for either configuration enable the required service access points (SAPIs). Furthermore, for ACU, all the services are supported by default.

The ISDNEVN_START_PROTOCOL event contains the completion status of the start request. If the ISDN protocol stack instance started successfully, the value field in this event will contain SUCCESS. Otherwise, another value will appear here.

For more information about isdnStartProtocol, see Chapter 7.

4.5 Starting the "No Call Control" TCP

Once all ISDN protocol stack instances have been created, start a "no call control" TCP on each B channel CTA context. This TCP puts the CTA context in a state where voice or media functions can be used without call control.

To start the TCP, call adiStartProtocol for each B channel CTA context, specifying NOCC in the protoname argument.

When adiStartProtocol is called, ADIEVN_STARTPROTOCOL_DONE is returned. If the NOCC TCP is started successfully, the event value field contains ADI_REASON_FINISHED. Otherwise, the value field contains another reason code.

4.5.1 Setting mediamask (AG Quad T/E only)

mediamask is a field in the ADI_CALLCTL_PARMS structure passed in the adiStartProtocol call. It controls which DSP resources are reserved for each DSP function (DTMF detection, echo cancellation, etc.). If you are using an AG Quad T or AG Quad E, you may need to change the setting of mediamask depending upon the setting of the CCMode statement in your AG configuration file. CCMode defines the call control resource allocation for these boards.

If CCMode is set to HIGH, MEDIUM, or LOW and mediamask is non-zero, when adiStartProtocol is called, an ADIEVN_START_PROTOCOL_DONE event is returned with the value field set to ADIERR_NOT_ENOUGH_ RESOURCES.


Natural MicroSystems, Inc.
100 Crossing Boulevard
Framingham, MA 01702

Contact Developer Support

Previous PageTable Of ContentsIndexNext Page