| CONTACT | DEVELOPER CENTER | PARTNERS | SITEMAP
GO
Useful Links
  • Search Helpweb
    
    

Dialogic Support Helpweb

Dialogic® Diva® SDK

Changing DTMF 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 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 shown 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 Server 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 Server 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:
  9:02:35.164 X  6 CAPI20_PUT(022)
  0x0000  02 00 80 80  49 00 01 01  10 00 01 00  07 01 00 4F  ....I..........O  
  0x0010  00 27 00 00                                         .'..              
  ---
  FACILITY REQ             AppID 0x0002 MsgNr 0x0049 NCCI: 0x00100101
  Facility selector: 0x1 DTMF    
  Facility parameter (0x7):       
  Function: Start DTMF listen      
  Tone-Duration: 79 ms      
  Gap-Duration: 39 ms      
  DTMF-Digits (0x0): 
Note that DivaSetCallProperties must be called before call connection (e.g. before you call DivaAnswerVoice) otherwise they will have no effect.


Feedback

Please rate the usefulness of this page:  

0 - not useful at all
1 - potentially useful
2 - quite useful
3 - very useful
4 - exactly the information I needed     

Please enter a comment about this page: