
Description | Example | Cautions | See Also
Name: |
int dx_chgrepcnt(tonetype, repcnt) | |
Inputs: |
int tonetype |
|
int repcnt |
| |
Returns: |
0 |
|
-1 |
| |
2 |
| |
Includes: |
srllib.h | |
Category: |
PerfectCall Call Analysis | |
The dx_chgrepcnt( ) function changes the repetitions for a PerfectCall tone, identified by tonetype, by modifying its repetition count component (the number of times that the signal must repeat before being recognized as valid).
The Voice Driver comes with default definitions for each of the PerfectCall Call Analysis tones; this function alters the repetition count component of one of the definitions.
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 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: |
| |
| |
| |
| |
| |
| |
| |
| |
repcnt |
is the number of times that the signal must repeat. |
#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 tone. The new definition does not apply to a channel until dx_initcallp( ) is called on that channel.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation