
Description | Cautions | Example | Errors
Name: |
int dcb_gettalkers(devh,confid,numpty,talkers) | |
Inputs: |
int devh |
|
int confid |
| |
int * numpty |
| |
MS_CDT * talkers |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Auxiliary | |
Mode: |
synchronous | |
The dcb_gettalkers( ) function retrieves information about the conferees actively talking in the specified conference.
Parameter |
Description |
devh: |
The DCB/SC DSP device handle. |
confid: |
The conference identifier. |
numpty: |
Pointer to number of active talkers. |
talkers: |
Pointer to the array of talker descriptions. |
The returned array of MS_CDT structures contains the active talker descriptions. The array has numpty number of elements. Each MS_CDT structure describes one active talker and has the following format:
typedef struct {
int chan_num; /* SCbus time slot number */
int chan_sel; /* meaning of time slot number */
int chan_attr; /* attribute description */
} MS_CDT;
chan_num contains the transmit time slot number of the actively talking conferee. chan_sel specifies that the conferee is an SCbus time slot.
This function fails when:
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
#define NUM_PARTIES 2
#define MAX_PTY 32
main()
{
int dspdevh; /* DCB/SC DSP device handle */
int tsdevh1; /* DTI time slot device handle */
int partycnt; /* The no. of conferenced parties */
int confid; /* Conference ID */
SC_TSINFO tsinfo; /* Time slot information structure */
MS_CDT cdt[MAX_PTY]; /* Conference descriptor table */
long scts; /* SCbus time slot */
int i; /* Loop index */
/* Open DCB/SC board 1, DSP 1 device */
if ((dspdevh = dcb_open("dcbB1D1",0)) == -1) {
printf("Cannot open dcbB1D1 : errno = %d", errno);
exit(1);
}
/* Open DTI board 1, time slot 1 device */
if ((tsdevh1 = dt_open("dtiB1T1",0)) == -1) {
printf("Cannot open dtiB1T1 : errno = %d", errno);
exit(1);
}
/* Open DTI board 1, time slot 2 device */
if ((tsdevh2 = dt_open("dtiB1T2",0)) == -1) {
printf("Cannot open dtiB1T2 : errno = %d", errno);
exit(1);
}
/* Prepare time slot information structure */
tsinfo.sc_numts=1
tsinfo.sc_tsarrayp=&scts;
/* Get SCbus transmit time slot of tsdevh1 */
if (dt_getxmitslot(tsdevh1, &tsinfo) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Set up CDT structure, for tsdevh1 */
cdt[0].chan_num = (int)scts; /* SCbus time slot returned */
cdt[0].chan_sel = MSPN_TS; /* ...by dt_getxmitslot() */
cdt[0].chan_attr = MSPA_NULL; /* Conferee has no special attributes */
/* Get SCbus transmit time slot of tsdevh2 */
if (dt_getxmitslot(tsdevh2, &tsinfo) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* Set up CDT structure, for tsdevh2 */
cdt[1].chan_num = (int)scts; /* SCbus time slot returned */
cdt[1].chan_sel = MSPN_TS; /* by dt_getxmitslot() */
cdt[1].chan_attr = MSPA_PUPIL; /* Conferee may be coached later */
/* Establish a 2 party conference */
if (dcb_estconf(dspdevh, cdt, NUM_PARTIES, MSCA_ND, &confid) == -1) {
printf("Error Message : %s", ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Prepare time slot information structure */
tsinfo.sc_numts=1
tsinfo.sc_tsarrayp=cdt[0].chan_lts;
/* Listen to the time slot returned by dcb_estconf() */
if (dt_listen(tsdevh1, &tsinfo) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Prepare time slot information structure */
tsinfo.sc_numts=1
tsinfo.sc_tsarrayp=cdt[1].chan_lts;
/* Listen to the time slot returned by dcb_estconf() */
if (dt_listen(tsdevh2, &tsinfo) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* Find out who is currently talking */
if ((dcb_gettalkers(dspdevh,confid,&partycnt,&cdt)) == -1) {
printf ("Error Message = %s", ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Print out the time slot numbers of currently active talkers */
printf ("There are %d currently active talkers\n", partycnt);
for (i=0; i<partycnt; i++){
printf ("Time slot = %d , Chan_sel = 0x%x\n", cdt[i].chan_num, cdt[i].chan_sel);
}
/* Remove all time slot listens */
if (dt_unlisten(tsdevh1) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
if (dt_unlisten(tsdevh2) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* Delete the conference */
if(dcb_delconf(dspdevh, confid) == -1) {
printf("Cannot delete conference %d. Error Message = %s", confid,
ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Done processing - close all open devices */
if (dt_close(tsdevh1) == -1) {
printf("Error closing %s : errno = %d\n", ATDV_NAMEP(tsdevh1), errno);
exit(1);
}
/* Done processing - close device */
if (dt_close(tsdevh2) == -1) {
printf("Error closing %s : errno = %d\n", ATDV_NAMEP(tsdevh2), errno);
exit(1);
}
/* Done processing - close device */
if (dcb_close(dspdevh) == -1) {
printf("Cannot close dcbB1D1 : errno = %d\n", errno);
exit(1);
}
}
If the function does not complete successfully, it will return -1 to indicate an error. Use the Standard Attribute functions ATDV_LASTERR( ) to obtain the applicable error value, or ATDV_ERRMSGP( ) to obtain a more descriptive error message.
Refer to the error type tables found in Chapter 2 of this guide. Error defines can be found in dtilib.h, msilib.h or dcblib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation