
Description | Cautions | Example | Errors | See Also
Name: |
int dcb_getcnflist(devh,confid,numpty,cdt) | |
Inputs: |
int devh |
|
int confid |
| |
int *numpty |
| |
MS_CDT *cdt |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Conference | |
Mode: |
synchronous | |
The dcb_getcnflist( ) function retrieves a conferee list and the total number of parties within a conference. The list contains specific information about each conferee in that conference. The information includes each conferee's SCbus transmit time slot number, selector, and conferee attribute description.
Parameter |
Description |
devh: |
The DCB/SC DSP device handle. |
confid: |
The conference identifier. |
numpty: |
Pointer to the conferee count. |
cdt: |
Pointer to the conference descriptor table. |
When a conference is being monitored, one member of the conference list will be the monitor. chan_num for the monitor will equal 0x7FFF and chan_sel will be MSPN_TS.
The conference descriptor table is an array of the MS_CDT structure. The MS_CDT structure has the following format:
typedef struct {
int chan_num; /* time slot number */
int chan_sel; /* meaning of time slot number */
int chan_attr; /* attribute description */
} MS_CDT;
#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
main()
{
int dspdevh; /* DCB/SC DSP device handle variable */
int tsdevh1, tsdevh2; /* DTI SCbus time slot device handles */
int partycnt; /* Pointer to the number of conferenced parties */
MS_CDT cdt[32]; /* Conference descriptor table */
SC_TSINFO tsinfo;
int confid; /* Conference ID */
long scts; /* Returned SCbus time slot */
int i; /* Loop index */
/* Open board 1 DSP 1 device */
if ((dspdevh = dcb_open("dcbB1D1",0)) == -1) {
printf( "Cannot open dcbB1D1: error = %d", errno);
exit(1);
}
/* Assume the DCB/SC connected to a DTI via SCbus. */
/* Open board 1, tslot 1 */
if ((tsdevh1 = dt_open("dtiB1T1",0)) == -1) {
printf( "Cannot open dtiB1T1: errno=%d", errno);
exit(1);
}
/* Prepare the SCbus time slot information structure */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &scts;
/* Retrieve the SCbus transmit time slot for tsdevh1 */
if (dt_getxmitslot(tsdevh1, &tsinfo) == -1){
printf("Error Message = %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Set up the CDT structure */
cdt[0].chan_num = (int)scts; /* scts is the SCbus time slot */
cdt[0].chan_sel = MSPN_TS; /* returned from dt_getxmitslot() */
cdt[0].chan_attr = MSPA_NULL; /* Conferee has no special attributes */
/* Open board 1, tslot 2 */
if ((tsdevh2 = dt_open("dtiB1T2",0)) == -1) {
printf( "Cannot open dtiB1T2: errno=%d", errno);
exit(1);
}
/* Retrieve the SCbus transmit time slot for tsdevh2 */
if (dt_getxmitslot(tsdevh2, &tsinfo) == -1){
printf("Error Message = %s" , ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* SCbus time slot to be conferenced */
cdt[1].chan_num = (int)scts; /* scts is the SCbus time slot */
cdt[1].chan_sel = MSPN_TS; /* returned from dt_getxmitslot() */
cdt[1].chan_attr = MSPA_PUPIL; /* Conferee may be coached later */
/* Establish 2 party conference */
if (dcb_estconf(dspdevh, cdt, NUM_PARTIES, MSCA_ND, &confid) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Do a listen to the SCbus listen time slot for tsdevh1 */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &cdt[0].chan_lts;
if (dt_listen(tsdevh1,&tsinfo) == -1){
printf("Error Message = %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Do a listen to the SCbus listen time slot for tsdevh2 */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &cdt[1].chan_lts;
if (dt_listen(tsdevh2,&tsinfo) == -1){
printf("Error Message = %s", ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* Get conferee list */
if (dcb_getcnflist(dspdevh, confid, &partycnt, &cdt[0]) == -1) {
printf("Error Message = %s", ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Display conference information */
printf("Number of parties in conference %d = %d\n", confid, partycnt);
for (i=0; i<partycnt; i++){
printf("%d : Chan_num = 0x%x", i+1, cdt[i].chan_num);
printf(" Chan_sel = 0x%x", cdt[i].chan_sel);
printf(" Chan_att = 0x%x\n", cdt[i].chan_attr);
}
/* Remove all 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);
}
/* Close all open devices */
if (dt_close(tsdevh1) == -1){
printf("Error (0x%x) closing tsdevh1\n", errno);
exit(1);
}
if (dt_close(tsdevh2) == -1){
printf("Error (0x%x) closing tsdevh2\n", errno);
exit(1);
}
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