08.01.2013 Views

Voice API for HMP Library Reference - Dialogic

Voice API for HMP Library Reference - Dialogic

Voice API for HMP Library Reference - Dialogic

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ATDX_CPERROR( ) — return the call progress analysis error<br />

CR_OVRLPERR<br />

overlap in selected SIT tones<br />

CR_TMOUTOFF<br />

timeout waiting <strong>for</strong> SIT tone to terminate (exceeds a ca_mxtimefrq parameter)<br />

CR_TMOUTON<br />

timeout waiting <strong>for</strong> SIT tone to commence<br />

CR_UNEXPTN<br />

unexpected SIT tone (the sequence of detected tones did not correspond to the SIT sequence)<br />

CR_UPFRQERR<br />

invalid upper frequency selection. This value must be nonzero <strong>for</strong> detection of any SIT.<br />

� Example<br />

#include <br />

#include <br />

#include <br />

main()<br />

{<br />

int dxxxdev;<br />

int cares;<br />

/*<br />

* Open the <strong>Voice</strong> Channel Device and Enable a Handler<br />

*/<br />

if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {<br />

perror( "dxxxB1C1" );<br />

exit( 1 );<br />

}<br />

/*<br />

* Take the phone off-hook<br />

*/<br />

if ( dx_sethook( dxxxdev, DX_OFFHOOK, EV_SYNC ) == -1 ) {<br />

printf( "Unable to set the phone off-hook\n" );<br />

printf( "Lasterror = %d Err Msg = %s\n",<br />

ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );<br />

dx_close( dxxxdev );<br />

exit( 1 );<br />

}<br />

/*<br />

* Per<strong>for</strong>m an outbound dial with call progress analysis, using<br />

* the default call progress analysis parameters.<br />

*/<br />

if((cares = dx_dial( dxxxdev,",84",(DX_CAP *) NULL, DX_CALLP )) == -1 ) {<br />

printf( "Outbound dial failed - reason = %d\n",<br />

ATDX_CPERROR( dxxxdev ) );<br />

dx_close( dxxxdev );<br />

exit( 1 );<br />

}<br />

/*<br />

* Continue Processing<br />

* .<br />

* .<br />

* .<br />

*/<br />

36 <strong>Voice</strong> <strong>API</strong> <strong>for</strong> <strong>HMP</strong> <strong>Library</strong> <strong>Reference</strong> — September 2004

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!