SDK: Change DTMF detection sensitivity

When you are processing inbound DTMF in a Diva SDK application, normally the sensitivity of the DTMF detection is set with some default values when you execute the DivaReportDTMF function.  The default values are 80ms for the minimum duration of DTMF tones, and 40ms for the gap between successive DTMF tones.

In some cases it is necessary to change these values to 'tune' the recognition to work better with some DTMF sources.  In CAPI, this is done using a FACILITY request, but in the Diva SDK it is done using the DivaSetCallProperties function.  An example function is show below:

BOOL ChangeDTMFParameters( DivaCallHandle ch, DWORD duration, DWORD gap ) {     DivaCallPropertyValue v;     DWORD ret;          v.VoiceDTMF_DetectDuration = duration;     ret = DivaSetCallProperties( ch, DivaCPT_VoiceDTMF_DetectDuration, &v,         sizeof(v.VoiceDTMF_DetectDuration));     if(ret!=DivaSuccess)       return FALSE;     v.VoiceDTMF_DetectPause = gap;     ret = DivaSetCallProperties( ch, DivaCPT_VoiceDTMF_DetectPause, &v,         sizeof(v.VoiceDTMF_DetectPause));     if(ret==DivaSuccess)       return TRUE;     else       return FALSE; }

 

So to use this function, you might make a call like so:

ret = ChangeDTMFParameters( ch, 79, 39 ); 

 

You can see the two DivaSetCallProperties calls being executed, if you look at the Diva SDK trace (set with CONFIG.EXE from the SDK 'bin' directory):

[01/10/2005 09:02:35:054] [SDK] [Calls.cpp     ] [API] [0444] DivaSetCallProperties() App: 0x007FEAB8, ....  hCall: 0x00802D60, pCall: 0x00924238, CallId: [1] PropertyType: 103 [01/10/2005 09:02:35:064] [SDK] [Calls.cpp     ] [API] [0444] DivaSetCallProperties() App: 0x007FEAB8, ....  hCall: 0x00802D60, pCall: 0x00924238, CallId: [1] PropertyType: 104

 

Also, if you run a CAPI level trace (using the Diva Diagnostics utility) you will see that the command is ultimately translated into a FACILITY_REQ at the CAPI level, with the 79 and 39ms values being passed to the card:

NOTE

DivaSetCallProperties must be called before the DTMF reporting is enabled (e.g. before you call DivaReportDTMF) otherwise they will have no effect.

Return to Documentation Home I Return to Sangoma Support