# Starting CAS protocols

Before starting a CAS protocol, the application must initialize NaturalAccess and obtain context handles
. The TCP parameters are automatically loaded during initialization. For information about initializing NaturalAccess and obtaining context handles, refer to the Dialogic® NaturalAccess™ Software Developer’s Manual.

This topic provides the following information:

- Using nccStartProtocol

- Using CAS protocols

## Using nccStartProtocol

When a context is open and the TCP parameters are loaded, the application can start a protocol on that context according to the loaded parameters (see Configuring TCPs). Invoke nccStartProtocol to start a TCP. After a TCP is started on a context, the application can use call control functions to place and answer calls on that context.

Note: To start a TCP from within an application, the TCP must have been downloaded to the board during system initialization. The configuration utility downloads all TCPs specified in the board keyword file. For more information about the board keyword file, see Configuring the boards.

nccStartProtocol requires a TCP name as one of its arguments. CAS TCPs include:

Protocol | TCP name
--- | ---
Analog loop start | lps0
Australian P2 | ap20
EL7 | el70
European digital CAS | euc0
Feature group D | fgd0
Digital ground start | gds0
MELCAS | mel0
MF-Socotel | mfs0
Multi-frequency compelled R2 | mfc0
NEC PBX | nec0
Off-premises station | ops0
Operator workstation | sta0
Pulsed E and M | eam0
Signaling system 5 | ss50
System R1.5 (inbound calls) | r150
System R1.5 (outbound calls) | r151
Wink start (digital and analog) | wnkx (x=0,1)

After the application calls nccStartProtocol, it receives NCCEVN_STARTPROTOCOL_DONE. If the TCP is started successfully, the event value field contains CTA_REASON_FINISHED. Otherwise, the value field contains a reason code that describes the error that occurred.

If your application terminates, all channels associated with the application are terminated, the TCP shuts down, and the bit pattern specified in the IdleCode statement in the board keyword file is signaled on the line.

## Using CAS protocols

On AG boards, DSP functions started by the TCP (for example, DTMF detection) cannot be active while calls are in the connected state. For this reason, when calling nccStartProtocol, the value of the NCC API parameter mediamask (in the NCC.X.ADI_START_PARMS structure) must be set to 0.

If mediamask is not set to 0, the TCP does not start and the application receives the NCCEVN_STARTPROTOCOL_DONE event with the reason NCC_REASON_OUT_OF_RESOURCES. The application must then set mediamask to zero before starting the protocol again.

For information about NCC.X.ADI_START parameters, refer to NCC call control parameters.

For information about managing DSP resources on CG boards, refer to the appropriate board installation manual.