
Description | Example | Cautions | See Also
Name: |
int dx_chgdur(tonetype, ontime, ondev, offtime, offdev) | |
Inputs: |
int tonetype |
|
int ontime |
| |
int ondev |
| |
int offtime |
| |
int offdev |
| |
Returns: |
0 |
|
-1 |
| |
-2 |
| |
Includes: |
srllib.h | |
Category: |
PerfectCall Call Analysis | |
The dx_chgdur( ) function changes the duration for a PerfectCall tone. The Voice Driver comes with default definitions for each of the PerfectCall Call Analysis tones, which are identified by tonetype.
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: |
| |
| |
| |
| |
| |
| |
| |
| |
ontime |
is the length of time that the tone is on |
ondev |
is the maximum permissible deviation from ontime (10 ms units). |
offtime |
is the length of time that the tone is off |
offdev |
is the maximum permissible deviation from offtime (10 ms units). |
#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 );
}
This function changes only the definition of a signal. The new definition does not apply to a channel until dx_deltones is called and then dx_initcallp( ) is called on that channel.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation