110 Voice API Programming Guide — June 2005
Recording and Playback

Figure 18. An ECR Play Over the TDM bus

Example
#include <stdio.h>
#include <windows.h> /* Windows applications only */
#include <srllib.h>
#include <dxxxlib.h>
#include <msilib.h>
#include <errno.h> /* Linux applications only */
mmain()
{
int chdev1, chdev2; /* Voice channel device handles */
int msdev1, msdev2; /* MSI/SC station device handles */
SC_TSINFO sc_tsinfo; /* TDM bus time slot information structure */
long scts; /* Pointer to TDM bus time slot */
long ms1txts, /* Transmit time slots of stations 1 & 2 */
ch1txts, ch2ecrtxts; /* Transmit time slots of echo-cancellers on
voice channels 1 & 2 */
/* Open voice board 1 channel 1 device */
if ((chdev1 = dx_open("dxxxB1C1", 0)) == -1) {
printf("Cannot open channel dxxxB1C1. errno = %d", errno);
exit(1);
}
/* Open voice board 1 channel 2 device */
if ((chdev2 = dx_open("dxxxB1C2", 0)) == -1) {
printf("Cannot open channel dxxxB1C2. errno = %d", errno);
exit(1);
}
/* Open MSI/SC board 1 station 1 device */
if ((msdev1 = ms_open("msiB1C1", 0)) == -1) {
printf("Cannot open station msiB1C1. errno = %d", errno);
exit(1);
}
TX
CH2
EC
ECR
TX
ECR
RX
RX
TX
(Unused)
CH2_ECR_TX
MS2_TX (unused)
CH1_TX
MS1_TX
S
C
b
u
s
S
C
b
u
s
Voice
File
CH1
MS1 MS2