# RFC 2833 related events

When the application enables inband DTMF detection, MSPP voice channels generate the following events when they detect DTMF tones:

Event | Description
MSPEVN_DPF_DTMF_REPORT | Returned when a voice encoder filter detects a DTMF digit on a data stream received from a PSTN.
MSPEVN_DPF_DTMF_PLAY_END | Returned when a voice decoder filter finishes generating a DTMF digit (as directed by a MSP_CMD_DECODE_PLAY_DTMF_DIGIT filter command).
MSPEVN_RFC2833_REPORT | Returned when the RTP endpoint receives an RFC 2833 packet.

MSPEVN_RFC2833_REPORT events are returned both when a voice encoder filter detects a DTMF tone, and when an RTP endpoint detects an inband DTMF packet. In both cases the events return DTMF tone information in the following structure:

typedef struct {
DWORD FilterID;
U8 EvtID;
U8 EvtVol;
WORD EvtDuration;
}DISASM_DTMF_EVENT_STRUCT;

Fields in the returned structure provide the following information:

Field | Description
FilterID | Filter ID associated with the voice encoder filter in the MSPP channel that detected the DTMF tone.
EventID | Detailed information about the type of DTMF detected. Possible values include: 0-9:DTMF digits 0 - 9, respectively 10: DTMF digit * 11: DTMF digit # 12-15: DTMF digits A - D, respectively 16: DTMF digit End notification
EvtVol | For DTMF digits and other events representable as tones, this describes the power level of the tone, expressed in dB. Power levels range from 0 to -63 dB. The range of valid DTMF is from 0 to -36 dBm0 (must accept); lower than -55 dBm0 must be rejected (TR-TSY-000181, ITU-T Q.24A). Therefore, larger values denote lower volume. The EvtVol value is defined only for DTMF digits. For other events, it is set to zero by the sender and is ignored by the receiver. For more information refer to RFC 2833.
EvtDuration | Duration of the digit, in timestamp units. The digit begins at the instant identified by the RTP timestamp and lasts as long as indicated by this value. For sampling rates of 8000 Hz, this field is can express event durations of up to approximately 8 seconds. For more information refer to RFC 2833.

When the Fusion application at the receiving gateway receives an unsolicited event indicating that the MSPP channel has detected a DTMF tone, the application can generate a DTMF tone for the receiving party using the ADI service. Fusion applications must invoke the MSPP service function mspReleaseBuffer after receiving DTMF carriage unsolicited events.