Voice API Programming Guide — June 2005 133
Send and Receive FSK Data
8. Issue dx_RxIottData( ) to receive messages from the CPE. This function should be issued as
soon as possible because the CPE peripheral can send data to the server after a minimum of
100 msec following the completion of its transmission.
If data needs to be transmitted to the CPE when the server is waiting to receive data, issue
dx_stopch( ) to terminate the current dx_RxIottData() function. Upon confirmation of
termination of dx_RxIottData( ), issue dx_clrdigbuf( ) to clear the voice device channel
buffer, and then issue dx_TxIottData() to send the data to the CPE.
10.9 Modifying Older One-Way ADSI Applications
Prior to the release of the two-way ADSI, including two-way FSK, applications used the
dx_play( ) function to implement one-way ADSI applications. With two-way ADSI, transmit and
receive data functions are introduced for data transfer. To take advantage of on-hook ADSI transfer
in a one-way ADSI application, and/or to introduce two-way FSK concepts into applications, older
applications need to be modified.
Applications developed prior to the release of the two-way ADSI use the following sequence of
commands to generate a CAS tone followed by transmission of an ADSI file:
/* Setup DX_IOTT to play from disk */
/* Setup DV_TPT for termination conditions */
/* Initiate ADSI play when DTMF ‘A’ is received from CPE */
parmval = DM_A;
if (dx_setparm(Voice_Device, DXCH_DTINITSET, (void *)&parmval) == -1) {
/* Process error */
}
/* Clear digit buffer for impending ADSI protocol DTMFs */
if (dx_clrdigbuf(Voice_Device) == -1) {
/* Process error */
}
/* Send CAS followed by ADSI data when DTMF ‘A’ is received */
if (dx_play(Voice_Device, &Iott_struct, &Tpt_struct, EV_SYNC | PM_ADSIALERT) == -1) {
/* Process error */
}
In older applications, the use of dx_play( ) for ADSI transmission can be replaced with the
specialized dx_TxIottData( ) data transfer function. The same DV_TPT and DX_IOTT are used
by dx_TxIottData( ) as for dx_play( ), however, the following additional parameters need to be
configured:
wType
specifies the data type transferred. To transfer ADSI FSK data, wType is set to DT_ADSI
lpParams
specifies the data type specific information. To transmit CAS followed by the ADSI FSK
message, dwTxDataMode within the ADSI_XFERSTRUC data structure pointed to by
lpParams is set to ADSI_ALERT.
Using these parameters, the CAS will be transmitted and, upon receipt of DTMF ‘A,’ the ADSI
FSK data will be sent to the CPE device.