One more question, Leonid, if I may:
When I get the TDX_CST event, is there any way of telling, if the DTMF came in via in-band audio or via RFC2833? If it comes in via RFC2833, I would like to disable DTMF input via in-band audio to prevent duplicate detection, if the tones leak into the caller's microphone.