JCT - How to modify tone definitions
Symptom
This technical note discusses how you modify tone definitions on both Dialogic JCT Media Boards. The below project files provided which demonstrate tone modification for the JCT 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
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.Â
Make all desired modifications to the default tone definitions using the dx_chgfreq( ), dx_chgdur( ), and dx_chgrepcnt( ) functions.Â
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.
Sample Code
All this code can be found in the attached sourceÂ
TestCPAToneChange()
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 JCT Media Boards
Â