# LPS and NCC API call control

This topic describes how to perform the following tasks while using NCC API call control with the LPS protocol:

- Using release guard

- Transferring calls on loop start lines

- Using loop current reversal parameters

- Using caller ID

## Using release guard

If you place a call immediately after releasing a call, the line is not taken off-hook until sufficient time has elapsed to ensure that the COs consider the line idle after the previous call. The release guard is controlled by the NCC.X.ADI_LPS.releaseguardtime parameter.

Note: The LPS0 TCP queues a command to place a call during this period and proceeds with dialing when the release guard time expires.

## Transferring calls on loop start lines

Call transfer operations use many of the same parameters as outbound call placement operations. These parameters are stored in the NCC_ADI_PLACECALL_PARMS and NCC_ADI_CALLPROG_PARMS structures. For details about the parameters stored in these structures, refer to the Dialogic® NaturalAccess™ NaturalCallControl™ API Developer’s Manual.

Modify the NCC.X.ADI_LPS.connstring or NCC.X.ADI_LPS.xferstring parameters to specify additional parameters with the loop start protocol that control prefix dial strings for transfer and reconnect.

When in the connected state, if an attempt is made to transfer a call, and transfer is enabled (NCC.X.ADI_LPS.xfersupport = 1), the TCP executes the commands contained in the string specified by the xferstring parameter before dialing the called address that was passed to nccAutomaticTransfer.

If the dial fails, NCCEVN_CALL_DISCONNECTED is sent up to the host, with reason NCC_DIS_DIAL_FAILURE (or NCC_DIS_NO_DIALTONE if dialtone was expected but not present). The protocol then returns to the connected state. When returning to the connected state, the second string specified by the connstring parameter is dialed.

## Using loop current reversal parameters

Some networks reverse the tip and ring polarity on the line when the far-end party hangs up. You can enable detection of loop current reversal events indicating far-end disconnects by setting the reversalmode parameter in the protocol parameter file.

If detection of loop current reversal on far-end hang-up is enabled, the TCP sends the NCCEVN_CALL_DISCONNECTED event to the application after the called party hangs up. Then the application should call nccReleaseCall to return to the idle state.

Caution: | Enable loop current reversal events only if the network provides this service. Otherwise, the TCP may operate incorrectly.

If you are connected to a network that is equipped to reverse the tip and ring polarity to indicate the far end positive answer and/or disconnect events, you can make these events available to the protocol by setting the NCC.X.ADI_LPS.reversalmode parameter to one of the following:

Value | Description
--- | ---
0 | Disable the loop current polarity reversal detection.
1 | Indicate remote answer if the switch reverses polarity.
2 | Indicate remote hang-up if the switch reverses polarity.
3 | Indicate both remote answer and hang-up if the switch reverses polarity twice.

If the polarity reversal detection is used as a far-end answer indication (reversalmode is set to 1 or 3), wait for some time after the dialing period before starting the detector. Since the wait time duration depends on the switch you are connected to, you may need to modify the NCC.X.ADI_LPS.polardialtime parameter to adjust to the switch conditions.

If you use the polarity reversal to indicate the far-end hang-up (reversalmode is set to 2 or 3), some time should elapse after establishment of the loop condition and before starting the detector. You may need to adjust this time interval to the switch conditions by setting the NCC.X.ADI_LPS.polaranswertime parameter with the appropriate value.

## Using caller ID

Users of loop start trunks can subscribe to caller ID service. Caller ID information transfer is performed by using modem tones on the line at different times during the call set up. Different protocols are used in different countries to transfer caller ID information.

Note: Protocol parameters that control caller ID information are set in the CAS protocol country-specific parameter file. These should not be modified.

For information on the CID files supported for particular countries, refer to:

- BellCore caller ID data

- NTT (Japan) caller ID data

- ETSI (France) caller ID data

To enable your application to receive caller ID information, complete the following steps:

Step | Action
1 | Edit the ag.cfg file to include the following statement : AG2DSPfile = adsir.m54 (for AG 2000/C boards)
2 | Enable caller ID TCP functionality by setting NCC.X.ADI_LPS.cidsupport = 1.
3 | Do not change the NCC.X.ADI_LPS.CIDtype parameter. This parameter is set to the following values for different countries:
Value | Description
0 | BellCore CID protocol. Data transmission occurs during the first long silent period between two ring patterns. Both multiple and single message formats are supported by the protocol.
1 | NTT Japan CID protocol. Line reversal followed by CAR alerting signal precedes FSK modulation transmission. Normal rings start after data transmission. The protocol supports the multiple message format.
2 | ETSI ringing pulse alerting signal CID protocol. Ringing pulse alert signal precedes FSK modulation transmission. Normal rings start after data transmission. The protocol supports the multiple message format. Used in France.
Protocol parameters that control this behavior are set in the CAS protocol country-specific parameter file. These should not be modified.
4 | Respond to NCCEVN_INCOMING_CALL events by invoking nccGetCallStatus to retrieve caller ID data. Because the caller ID data is stored in the NCC_CALL_STATUS structure (on a call-by-call basis), applications must analyze the call status of every incoming call to retrieve caller ID information.

See CAS TCP call control capabilities for information about country-specific caller ID fields that the software can recognize (if the user subscribes to the CID service).