Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 39
get TDM bus time slot number of analog transmit channel — ag_getxmitslot( )
EDX_SH_BADINDX
Invalid Switch Handler library index number
EDX_SH_BADLCTS
Invalid channel number
EDX_SH_BADMODE
Function is not supported in current bus configuration
EDX_SH_BADTYPE
Invalid channel type (voice, analog, etc.) number
EDX_SH_CMDBLOCK
Blocking command is in progress
EDX_SH_LCLDSCNCT
Channel is already disconnected from TDM bus time slot
EDX_SH_LIBBSY
Switch Handler library is busy
EDX_SH_LIBNOTINIT
Switch Handler library is uninitialized
EDX_SH_MISSING
Switch Handler is not present
EDX_SH_NOCLK
Switch Handler clock fallback failed
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
main()
{
int chdev; /* Channel device handle */
SC_TSINFO sc_tsinfo; /* Time slot information structure */
long scts; /* TDM bus time slot */
/* Open board 1 channel 1 devices */
if ((chdev = dx_open("dxxxB1C1", 0)) == -1) {
/* process error */
}
/* Fill in the TDM bus time slot information */
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarrayp = &scts;
/* Get TDM bus time slot connected to transmit of analog channel 1 on board ...1 */
if (ag_getxmitslot(chdev, &sc_tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev));
exit(1);
}
printf("%s is transmitting on TDM bus time slot %d", ATDV_NAMEP(chdev), ...scts);
}