Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 65
return the connection type for a completed call — ATDX_CONNTYPE( )
!
!!
! Cautions
None.
!
!!
! Errors
This function will fail and return AT_FAILURE if an invalid channel device handle is specified in
chdev.
!
!!
! Example
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.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 call progress analysis 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 progress analysis, using
* the default call progress 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 );
}