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_STATE( ) — return the current state of the channel<br />

� Cautions<br />

This function extracts the current state from the driver and requires the same processing resources<br />

as many other functions. For this reason, applications should not base their state machines on this<br />

function.<br />

� Errors<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 />

main()<br />

{<br />

int chdev;<br />

long chstate;<br />

}<br />

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

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

/* Process error */<br />

}<br />

.<br />

.<br />

/* Examine state of the channel. Per<strong>for</strong>m application specific action based<br />

* on state of the channel<br />

*/<br />

if((chstate = ATDX_STATE(chdev)) == AT_FAILURE) {<br />

/* Process error */<br />

}<br />

printf("current state of channel %s = %ld\n", ATDX_NAMEP(chdev), chstate);<br />

.<br />

.<br />

� See Also<br />

None.<br />

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