108 Voice API Programming Guide — June 2005
Recording and Playback
scts = ms1txts;
/* Have channel 1 listen to station 1's transmit */
if (dx_listen(chdev1, &sc_tsinfo) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));
exit(1);
}
scts = ms2txts;
/* Have channel 2 listen to station 2's transmit */
if (dx_listen(chdev2, &sc_tsinfo) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev2), ATDV_NAMEP(chdev2));
exit(1);
}
scts = ch2ecrtxts;
/* Have channel 1's echo-canceller listen to channel 2's echo-cancelled transmit */
if (dx_listenecr(chdev1, &sc_tsinfo) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));
exit(1);
}
scts = ch1ecrtxts;
/* Have channel 2's echo-canceller listen to channel 1's echo-cancelled transmit */
if (dx_listenecr(chdev2, &sc_tsinfo) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev2), ATDV_NAMEP(chdev2));
exit(1);
}
/* Bridge connected, both stations receive echo-cancelled signal */
/*
*
* Continue
*
*/
/* Then perform xx_unlisten() and dx_unlistenecr(), plus all necessary xx_close()s */
if (ms_unlisten(msdev2) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(msdev2), ATDV_NAMEP(msdev2));
exit(1);
}
if (ms_unlisten(msdev1) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(msdev1), ATDV_NAMEP(msdev1));
exit(1);
}
if (dx_unlistenecr(chdev2) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev2), ATDV_NAMEP(chdev2));
exit(1);
}
if (dx_unlistenecr(chdev1) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));
exit(1);
}
if (dx_unlisten(chdev2) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev2), ATDV_NAMEP(chdev2));
exit(1);
}
if (dx_unlisten(chdev1) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));
exit(1);
}
if (dx_close(chdev1) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));