# MFC-R2 and NCC API call control

When applications receive calls using NCC API call control with the MFC-R2 protocol, they can receive digits in the following ways:

- All at once

- One at a time

## Receiving digits all at once

For MFC-R2, after NCCEVN_INCOMING_CALL is received, the following fields of the NCC_CALL_STATUS structure contain information relevant to the call:

Field | Description
--- | ---
calledaddr | Called number. Also referred to as the direct inward dial (DID) number.
callingaddr | Calling number (if available). Also referred to as the automatic number identification (ANI) number.

For MFC-R2, after NCCEVN_INCOMING_CALL is received, the following fields of the NCC_CAS_EXT_CALL_STATUS structure contain information relevant to the call:

Field | Description
--- | ---
usercategory | Calling party category (Group I), for example, normal subscriber, operator, maintenance equipment.
anipresentation | ANI digits may not be available because of interworking of different protocols with different features in the call path, or ANI presentation might be restricted. Possible values include: 0 = Calling number presentation allowed (default) 1 = Calling number presentation restricted 2 = Calling number not available
tollcategory | Category associated with the calling party in register signaling Group II. Usually this is the same as the user category, but in some countries it carries the toll category of the call.

Several parameters affect the way the MFC-R2 TCP accepts, processes and presents the incoming digits to the host:

Parameter | Description
--- | ---
DIDnumber | Number of direct inward dial (DID) digits the TCP should expect from the calling party. Default is 7.
ANInumber | Number of automatic number identification (ANI) digits the TCP should expect. Set this number to one more than the number of ANI digits to expect, to include the category digit. For example, if the TCP is to expect 7 digits, set this parameter to 8 (the default). If this parameter is set to 0, no ANI digits are collected.
DIDBeforeANI | Number of DID digits the TCP should receive before signaling the calling party to send ANI digits. It defaults to 1.

When you call nccAnswerCall with MFC TCPs, the upper five bits of the number_of_rings argument are reserved, and should be set to zero. This means that the mfc0 TCPs can play a maximum of 0x7FF (2047) ring back tones when answering a call.

## Receiving digits one at a time

To receive digits one at a time, make sure the Ncc.Start.OverlappedReceiving parameter is set.

For MFC-R2, digits appears in the following format:

d1 # c1 a1 a2 a3 ... am # d2 d3 ... dn # c2

where:

Value | Description
d1...dn | DID digits received. n is determined by the NCC.X.ADI_MFC.DIDnumber parameter.
c1 | Group I category of the calling party (user category).
a1 ... am | ANI digits received. m is determined by the NCC.X.ADI_MFC.ANInumber parameter.
c2 | Group II category of the calling party (toll category).
# | Separator symbol.

Note: The number of DID digits received before the first # separator depends on the parameter NCC.X.ADI_MFC.DIDbeforeANI.