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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ATDX_TERMMSK( ) — return the reason <strong>for</strong> the last I/O function termination<br />

TM_USRSTOP<br />

Function stopped by user<br />

� Cautions<br />

� Errors<br />

If several termination conditions are met at the same time, several bits will be set in the<br />

termination bitmap.<br />

When both DX_MAXDTMF and DX_DIGMASK termination conditions are specified in the<br />

DV_TPT structure, and both conditions are satisfied, the ATDX_TERMMSK( ) function will<br />

return the TM_MAXDTMF termination event only.<br />

For example, with a DX_MAXDTMF condition of 2 digits maximum and a DX_DIGMASK<br />

condition of digit “1”, if the digit string “21” is received, both conditions are satisfied but only<br />

TM_MAXDTMF will be reported by ATDX_TERMMSK( ).<br />

This behavior differs from Springware products, where both TM_MAXDTMF and<br />

TM_DIGIT will be returned when both DX_MAXDTMF and DX_DIGMASK termination<br />

conditions are specified in the DV_TPT structure and both are satisfied by the user input.<br />

This function will fail and return AT_FAILURE if an invalid channel device handle is specified in<br />

chdev.<br />

� Example<br />

#include <br />

#include <br />

#include <br />

#include <br />

main()<br />

{<br />

int chdev;<br />

long term;<br />

DX_IOTT iott;<br />

DV_TPT tpt[4];<br />

/* Open the channel device */<br />

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

/* Process error */<br />

}<br />

/* Record a voice file. Terminate on receiving a digit, silence, loop<br />

* current drop, max time, or reaching a byte count of 50000 bytes.<br />

*/<br />

/* set up DX_IOTT */<br />

iott.io_type = IO_DEV|IO_EOT;<br />

iott.io_bufp = 0;<br />

iott.io_offset = 0;<br />

iott.io_length = 50000;<br />

if((iott.io_fhandle = dx_fileopen("file.vox", O_RDWR)) == -1) {<br />

/* process error */<br />

}<br />

46 <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!