
Description | Cautions | Example | Errors | See Also
Name: |
long ATDX_CONNTYPE(chdev) | |
Inputs: |
int chdev |
|
Returns: |
connection type | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
The ATDX_CONNTYPE( ) function returns the connection type for a completed call on the channel device. Use this function when a CR_CNCT is returned by ATDX_CPTERM( ) after termination of dx_dial( ) with Call Analysis enabled.
Possible return values are the following:
|
|
The function parameter is defined as follows:
Parameter |
Description |
chdev |
specifies the valid channel device handle obtained when the channel was opened using dx_open( ). |
None.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int dxxxdev;
int cares;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Delete any previous tones
*/
if ( dx_deltones(dxxxdev) < 0 ) {
/* handle error */
}
/*
* Now enable Enhanced call progress with above changed settings.
*/
if (dx_initcallp( dxxxdev )) {
/* handle error */
}
/*
* Take the phone off-hook
*/
if ( dx_sethook( dxxxdev, DX_OFFHOOK, EV_SYNC ) == -1 ) {
printf( "Unable to set the phone off-hook\n" );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Perform an outbound dial with call analysis, using
* the default call analysis parameters.
*/
if ((cares=dx_dial( dxxxdev, ",84",(DX_CAP *)NULL, DX_CALLP ) ) == -1 ) {
printf( "Outbound dial failed - reason = %d\n",
ATDX_CPERROR( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
printf( "Call Analysis returned %d\n", cares );
if ( cares == CR_CNCT ) {
switch ( ATDX_CONNTYPE( dxxxdev ) ) {
case CON_CAD:
printf( "Cadence Break\n" );
break;
case CON_LPC:
printf( "Loop Current Drop\n" );
break;
case CON_PVD:
printf( "Positive Voice Detection\n" );
break;
case CON_PAMD:
printf( "Positive Answering Machine Detection\n" );
break;
default:
printf( "Unknown connection type\n" );
break;
}
}
/*
* Continue Processing
* .
* .
* .
*/
/*
* Close the opened Voice Channel Device
*/
if ( dx_close( dxxxdev ) != 0 ) {
perror( "close" );
}
/* Terminate the Program */
exit( 0 );
}
This function will fail and return AT_FAILURE if an invalid channel device handle is specified in chdev.
Related to Call Analysis:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation