Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 453
make a full or half-duplex connection — nr_scroute( )
#include <stdio.h>
#include <varargs.h>
#include <srllib.h>
#include <dxxxlib.h>
#ifdef DTISC
#include <dtilib.h>
#endif
#ifdef FAXSC
#include <faxlib.h>
#endif
#include "sctools.h"
#if ( defined( __STDC__ ) || defined( __cplusplus ) )
int nr_scroute( int devh1, unsigned short devtype1,
int devh2, unsigned short devtype2 unsigned char mode )
#else
int nr_scroute( devh1, devtype1, devh2, devtype2, mode )
int devh1;
unsigned short devtype1;
int devh2;
unsigned short devtype2;
unsigned char mode;
#endif
{
SC_TSINFO sc_tsinfo; /* TDM bus time slot info structure */
long scts; /* TDM bus time slot */
/*
* Setup the TDM bus time slot information structure.
*/
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarrayp = &scts;
/*
* Get the TDM bus time slot connected to the transmit of the first
* device.
*/
switch (devtype1
{
case SC_VOX:
if (dx_getxmitslot(devh1, &sc_tsinfo) == -1) {
nr_scerror
("nr_scroute: %s: dx_getxmitslot ERROR: %s\n",
ATDV_NAMEP(devh1),ATDV_ERRMSGP(devh1))
;
return -1;
}
break;
case SC_LSI:
if (ag_getxmitslot(devh1, &sc_tsinfo) == -1) {
nr_scerror("nr_scroute: %s: ag_getxmitslot ERROR: %s\n",
ATDV_NAMEP(devh1),ATDV_ERRMSGP(devh1));
return -1;
}
break;
#ifdef DTISC
case SC_DTI:
if (dt_getxmitslot(devh1, &sc_tsinfo) == -1) {
nr_scerror("nr_scroute: %s: dt_getxmitslot ERROR: %s\n",
ATDV_NAMEP(devh1),ATDV_ERRMSGP(devh1));
return -1;
}
break;
#endif