Technical Helpweb

- more articles

How to modify tone definitions - DM3/HMP vs JCT

Symptom:
This technical note discusses how you modify tone definitions on both Dialogic® DM3 Media Boards/HMP and Dialogic® JCT Media Boards. There are two project files provided below which demonstrate the differences between tone modification for the JCT and DM3 boards.


Dialogic® JCT Media Boards

APIs used:
dx_chgfreq( ) - specifies frequencies and tolerances for one or both frequencies of a single- or dual-frequency tone
dx_chgdur( ) - specifies the cadence (on time, off time, and acceptable deviations) for a tone
dx_chgrepcnt( ) - specifies the repetition count required to identify a tone
dx_initcallp( ) - initiates and activates call progress analysis
dx_deltones( ) - removes all tone templates previously added to a channel

Steps to modify:
1) Call dx_deltones( ) to clear all tone templates remaining on the channel. Note that this function deletes all global tone definition (GTD) tones for the given channel, and not just those involved with call progress analysis. 

2) Make all desired modifications to the default tone definitions using the dx_chgfreq( ), dx_chgdur( ), and dx_chgrepcnt( ) functions.

3) Once all desired modifications are finished, execute the dx_initcallp( ) function to activate call progress analysis.

Dialogic® JCT Media Board Default Tone Definitions:
 
NOTE:  SIT tones for the JCT boards are modified in the DX_CAP struct (ca_lowerfrq, ca_upperfrq, etc) and NOT via the APIs shown here.

Dialogic® DM3 Media Boards and Host Media Processing (HMP)
 
 
APIs used:
dx_querytone( ) - gets tone information for a specific call progress tone
dx_deletetone( ) - deletes a specific call progress tone
dx_createtone( ) - creates a new tone definition for a specific call progress tone

Steps to modify: 
1) Get the tone information for the call progress tone to be modified using dx_querytone( ). After the function completes successfully, the relevant tone information is contained in the TONE_DATA structure.

2) Delete the current call progress tone using dx_deletetone( ) before creating a new tone definition.

3) Create a new tone definition for the call progress tone using dx_createtone( ). Specify the new tone information in the TONE_DATA structure.

4) Repeat steps 1-3 in this order for each tone to be modified.

Note: you must issue dx_querytone( ), dx_deletetone( ), and dx_createtone( ) in this order, one tone at a time, for each tone definition to be modified. Errors may result if this procedure is not followed.

Dialogic® DM3 Media Board Default Tone Templates:
 

Sample Code

All this code can be found in the attached source Code.zip

TestCPAToneChange() function 

int result;
TONE_DATA tonedata;
int brdhdl;
if ((brdhdl = dx_open("brdB1",0)) == -1)
{
printf("Cannot open board\n");
/* Perform system error processing */
exit(1);
}
/* NOTE if done ASYNC When running in asynchronous mode, this function returns 0 to indicate that it initiated
successfully and generates the TDX_QUERYTONE event to indicate completion or
TDX_QUERYTONE_FAIL to indicate failure. The TONE_DATA structure should remain in
scope until the application receives these events. */
Log(API,cpaindex,"Querying for TID_BUSY1");
if ((result = dx_querytone(brdhdl, TID_BUSY1, &tonedata, EV_SYNC)) == -1)
{
printf("Cannot obtain tone information for TID_BUSY1 \n");
/* Perform system error processing */
exit(1);
}
Log(API,cpaindex,"Deleting TID_BUSY1");
if ((result = dx_deletetone(brdhdl, TID_BUSY1, EV_SYNC)) == -1)
{
printf("Cannot delete the TID_BUSY1 tone \n");
/* Perform system error processing */
exit(1);
}
/* Change call progress default Busy tone */
 
tonedata.structver = 0;
tonedata.numofseg = 1; /* Single segment tone */
tonedata.tn_rep_cnt = 4;
tonedata.toneseg[0].structver = 0;
tonedata.toneseg[0].tn_dflag = 0; /* 0=single, 1=Dual tone */
tonedata.toneseg[0].tn1_min = 425; /* Min. Frequency for Tone 1 (in Hz) */
tonedata.toneseg[0].tn1_max = 490; /* Max. Frequency for Tone 1 (in Hz) */
tonedata.toneseg[0].tn2_min = 0; /* Min. Frequency for Tone 2 (in Hz) */
tonedata.toneseg[0].tn2_max = 0; /* Max. Frequency for Tone 2 (in Hz) */
tonedata.toneseg[0].tn_twinmin = 0;
tonedata.toneseg[0].tn_twinmax = 0;
tonedata.toneseg[0].tnon_min = 40; /* Debounce Min. ON Time  In 10ms units*/
tonedata.toneseg[0].tnon_max = 55; /* Debounce Max. ON Time */
tonedata.toneseg[0].tnoff_min = 40; /* Debounce Min. OFF Time */
tonedata.toneseg[0].tnoff_max = 55; /* Debounce Max. OFF Time */
 
Log(API,cpaindex,"Creating New TID_BUSY1");
if ((result = dx_createtone(brdhdl, TID_BUSY1, &tonedata, EV_SYNC)) == -1) {
printf("create tone for TID_BUSY1 failed\n");
/* Perform system error processing */
exit(1);
}
Product List
Dialogic® DM3 Media Boards
Dialogic® JCT Media Boards
Dialogic® Host Media Processing

Related Documentation
Dialogic® Voice API for Windows Operating Systems - Programming Guide
http://www.dialogic.com/~/media/manuals/docs/voice_programming_win_v2.pdf
See section 7.8 (DM3), section 7.15 (JCT)




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:

First published: 27-May-2008
Last published: 30-Sep-2011
Open access: Product rule: ; Page rule: Auto

Service Center Logon