
Description | Cautions | Example | Errors | See Also
Name: |
int dcb_monconf(devh,confid,lts) | |
Inputs: |
int devh |
|
int confid |
| |
long *lts |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Conference Management | |
Mode: |
synchronous | |
The dcb_monconf( ) function adds a monitor to a conference. A monitor has no input in the conference.
This function places the monitored signal on the SCbus. Several parties can listen to the monitored signal simultaneously.
Parameter |
Description |
devh: |
The DCB/SC board device handle. |
confid: |
The conference identifier. |
lts: |
Indicates the pointer to the returned listen SCbus time slot. The monitored signal is present on this time slot. |
A monitor counts as one of the parties in the conference. If all the resources on the DSP are already in use, it is not possible to monitor the conference. When a conference is deleted, the conference monitor is also deleted.
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
main()
{
int dspdevh; /* DCB/SC DSP device handle */
int tsdevh1, tsdevh2; /* DTI time slot device handles */
MS_CDT cdt[NUM_PARTIES]; /* Conference descriptor table */
int confid; /* Conference ID */
long lts, scts; /* SCbus listen/transmit time slots */
SC_TSINFO tsinfo; /* Time slot information structure */
/* Open DCB/SC board 1, DSP 3 device */
if ((dspdevh = dcb_open("dcbB1D3",0) == -1) {
printf("Cannot open dcbB1D3 : errno = %d", errno);
exit(1);
}
/* Open DTI 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;
/* Get SCbus transmit time slot of DTI tsdevh1 */
if (dt_getxmitslot(tsdevh1, &tsinfo) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Set up CDT structure */
cdt[0].chan_num = (int)scts; /* SCbus transmit time slot returned */
cdt[0].chan_sel = MSPN_TS; /* ...from dt_getxmitslot() */
cdt[0].chan_attr = MSPA_NULL; /* Conferee has no special attributes */
/* Open DTI board 1, tslot 2 */
if ((tsdevh2 = dt_open("dtiB1T2",0)) == -1) {
printf("Cannot open dtiB1T2 : errno = %d", errno);
exit(1);
}
/* Get transmit time slot of DTI tsdevh2 */
if (dt_getxmitslot(tsdevh2, &tsinfo) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* Set up CDT structure */
cdt[1].chan_num = (int)scts ; /* SCbus time slot returned */
cdt[1].chan_sel = MSPN_TS; /* from dt_getxmitslot() */
cdt[1].chan_attr = MSPA_NULL; /* Conferee has no special attributes */
/* Open DTI board 1, tslot 3 */
if ((tsdevh1 = dt_open("dtiB1T3",0)) == -1) {
printf( "Cannot open dtiB1T3 : errno = %d", errno);
exit(1);
}
/* 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 for the 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 for the 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);
}
/* Now monitor the conference on time slot lts */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = <s;
if((dcb_monconf(dspdevh,confid,<s)) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Assume that a DTI time slot, tsdevh3, is a monitor */
if (dt_listen(tsdevh3,&tsinfo) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh3));
exit(1);
}
/* Perform an unlisten() to end monitor listening */
if (dt_unlisten(tsdevh3) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(tsdevh3));
exit(1);
}
/* Now remove the monitor from the conference */
if((dcb_unmonconf(dspdevh,confid)) == -1){
printf("Error Message : %s", ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* 'Unlisten' the SCbus time slots */
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 closing tsdevh1\n");
exit(1);
}
if (dt_close(tsdevh2) == -1){
printf("Error closing tsdevh2\n");
exit(1);
}
if (dt_close(tsdevh3) == -1){
printf("Error closing tsdevh3\n");
exit(1);
}
if (dcb_close(dspdevh) == -1){
printf("Cannot close dcbB1D3. 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