# adiStartMFDetector

Enables the detection of MFs (multi-frequency tones).

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStartMFDetector ( CTAHD ctahd, unsigned mftype)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.
mftype | Type of MF tone to detect: ADI_MF_US ADI_MF_CCITT_FORWARD ADI_MF_CCITT_BACKWARD

#### Return values

Return value | Description
SUCCESS |
ADIERR_INVALID_CALL_STATE | Function not valid in the current call state.
CTAERR_FUNCTION_ACTIVE | Function already started.
CTAERR_FUNCTION_NOT_AVAIL | mf.dsp not loaded to the board.
CTAERR_INVALID_CTAHD | Context handle is invalid.
CTAERR_INVALID_STATE | Function not valid in the current port state.
CTAERR_SVR_COMM | Server communication error.

#### Events

Event | Description
ADIEVN_MF_DETECT_DONE | DTMF detector is no longer running. The event value field contains one of the following: CTA_REASON_RELEASED Call terminated. CTA_REASON_STOPPED Function stopped by adiStopMFDetector. CTAERR_xxx or ADIERR_xxx DTMF detector failed.
ADIEVN_MF_DIGIT_BEGIN | MF digit detected on.
ADIEVN_MF_DIGIT_END | MF digit detected off.

#### Details

The following DSP
file must be loaded to the board before running adiStartMFDetector:

For these boards... | Load this DSP file...
AG | mf.m54
CG | mf.f54

See DSP file summary for DSP file descriptions. Refer to the board installation and developer's manual for a table of MIPS
usage for all functions.

Use this function to enable detection of MFs (multi-frequency tones). Stop the function by calling adiStopMFDetector.

You must disable DTMF
detection using adiStopDTMFDetector before initiating MF detection, as there are some overlapping frequency ranges in which both a DTMF and an MF event are reported. Likewise, when the application is finished with MF detection, re-enable DTMF detection (adiStartMFDetector) if DTMFs are desired.

ADIEVN_MF_DIGIT_BEGIN and ADIEVN_MF_DIGIT_END are generated for every MF tone detected. Each event contains an ASCII representation (character) of the MF digit in the event value field.

This table lists the MF frequencies for each mftype, along with the digit value returned in the event's value field:

Digit | US MF | ITU forward | ITU backward
--- | --- | --- | ---
1 | 700,900 | 1380,1500 | 1140,1020
2 | 700,1100 | 1380,1620 | 1140,900
3 | 900,1100 | 1500,1620 | 1020,900
4 | 700,1300 | 1380,1740 | 1140,780
5 | 900,1300 | 1500,1740 | 1020,780
6 | 1100,1300 | 1620,1740 | 900,780
7 | 700,1500 | 1380,1860 | 1140,660
8 | 900,1500 | 1500,1860 | 1020,660
9 | 1100,1500 | 1620,1860 | 900,660
0 | 1300,1500 | 1740,1860 | 780,660
B | 700,1700 | 1380,1980 | 1140,540
C | 900,1700 | 1500,1980 | 1020,540
D | 1100,1700 | 1620,1980 | 900,540
E | 1300,1700 | 1740,1980 | 780,540
F | 1500,1700 | 1860,1980 | 660,540

The following table lists the mapping to the United States MF digits for MF dialing:

Digit | United States MF name
--- | ---
0 to 9 | Specific digit address
B | MF ST3P
C | MF STP
D | MF KP
E | MF KP2, MF ST2P
F | MF ST

Note: The digit values are the same as those used by adiStartDTMF and adiStartDial when MF digits are dialed.

#### See also

adiStartDTMFDetector, adiStopDTMFDetector