
Description | Example | Cautions | See Also
Name: |
int dx_chgfreq(tonetype, freq1, freq1dev, freq2, freq2dev) | |
Inputs: |
int tonetype |
|
int freq1 |
| |
int freq1dev |
| |
int freq2 |
| |
int freq2dev |
| |
Returns: |
0 |
|
-1 |
| |
-2 |
| |
Includes: |
srllib.h | |
Category: |
PerfectCall Call Analysis | |
The dx_chgfreq( ) function changes the frequency for a PerfectCall tone, identified by tonetype, by modifying its frequency component.
The Voice Driver comes with default definitions for each of the PerfectCall Call Analysis tones; this function alters the frequency component of one of the definitions.
PerfectCall Call Analysis supports both single-frequency and dual-frequency tones. For dual-frequency tones, the frequency and tolerance of each component may be specified independently. For single-frequency tones, specifications for the second frequency are set to zero.
Changing a tone definition has no immediate effect on the behavior of an application. The dx_initcallp( ) function takes the tone definitions and uses them to initialize a channel. Once a channel is initialized, subsequent changes to the tone definitions have no effect on that channel. For these changes to take effect, dx_deltones must be called and then followed by calling dx_initcallp.
Parameter |
Description |
tonetype |
specifies the identifier of the tone whose definition is to be modified. It may be one of the following: |
| |
| |
| |
| |
| |
| |
| |
| |
freq1 |
is the frequency of the first tone (in Hz). |
freq1dev |
is the maximum permissible deviation from freq1 (in Hz). |
freq2 |
is the frequency of the second tone, if any (in Hz). If there is only one frequency, freq2 is set to zero. |
freq2dev |
is the maximum permissible deviation from freq2 (in Hz). |
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
DX_CAP cap_s;
int ddd, car;
char *chnam, *dialstrg;
chnam = "dxxxB1C1";
dialstrg = "L1234";
/*
* Open channel
*/
if ((ddd = dx_open( chnam, NULL )) == -1 ) {
/* handle error */
}
/*
* Delete any previous tones
*/
if ( dx_deltones(ddd) < 0 ) {
/* handle error */
}
/*
* Change Enhanced call progress default local dial tone
*/
if (dx_chgfreq( TID_DIAL_LCL, 425, 150, 0, 0 ) < 0) {
/* handle error */
}
/*
* Change Enhanced call progress default busy cadence
*/
if (dx_chgdur( TID_BUSY1, 550, 400, 550, 400 ) < 0) {
/* handle error */
}
if (dx_chgrepcnt( TID_BUSY1, 4 ) < 0) {
/* handle error */
}
/*
* Now enable Enhanced call progress with above changed settings.
*/
if (dx_initcallp( ddd )) {
/* handle error */
}
/*
* Set off Hook
*/
if ((dx_sethook( ddd, DX_OFFHOOK, EV_SYNC )) == -1) {
/* handle error */
}
/*
* Dial
*/
if ((car = dx_dial( ddd, dialstrg,(DX_CAP *)&cap_s, DX_CALLP|EV_SYNC))==-1) {
/* handle error */
}
switch( car ) {
case CR_NODIALTONE:
printf(" Unable to get dial tone\n");
break;
case CR_BUSY:
printf(" %s engaged\n", dialstrg );
break;
case CR_CNCT:
printf(" Successful connection to %s\n", dialstrg );
break;
default:
break;
}
/*
* Set on Hook
*/
if ((dx_sethook( ddd, DX_ONHOOK, EV_SYNC )) == -1) {
/* handle error */
}
dx_close( ddd );
}
None.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation