
Description | Example | Cautions | See Also
Name: |
int dx_initcallp(chdev) | |
Inputs: |
int chdev |
|
0 |
| |
-1 |
| |
Returns: |
srllib.h | |
dxxxlib.h | ||
Category: |
PerfectCall Call Analysis | |
The dx_initcallp( ) function initializes and activates PerfectCall Call Analysis on the channel identified by chdev. In addition, this function adds all tones used in Call Analysis to the channel's Global Tone Detection (GTD) templates.
To use PerfectCall Call Analysis, dx_initcallp( ) must be called prior to using dx_dial( ) on the specified channel. If dx_dial( ) is called before initializing the channel with dx_initcallp( ), then Call Analysis will operate in Basic mode only for that channel.
PerfectCall Call Analysis allows the application to detect three different types of dial tone, two busy signals, ringback, and two fax or modem tones on the channel. It is also capable of distinguishing between a live voice and an answering machine when a call is connected. Parameters for these capabilities are downloaded to the channel when dx_initcallp( ) is called.
The Voice Driver comes equipped with useful default definitions for each of the signals mentioned above. The application can change these definitions through the dx_chgdur( ), dx_chgfreq( ), and dx_chgrepcnt( ) functions. The dx_initcallp( ) function takes whatever definitions are currently in force and uses these definitions to initialize the specified channel.
Once a channel is initialized with the current tone definitions, these definitions cannot be changed for that channel without deleting all tones (dx_deltones( )) and re-initializing with another call to dx_initcallp( ). dx_deltones also disables PerfectCall Call Analysis. Note, however, that dx_deltones( ) will erase all user-defined tones from the channel (including any Global Tone Detection information), and not just the PerfectCall Call Analysis tones.
Parameter |
Description |
chdev |
specifies the channel device handle. |
#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 );
}
The channel must be idle.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation