cnfGetResourceInfo

Returns information for a conference resource such as the capabilities of the resource, the maximum number of members the resource can accept, and the number of members available for a new conference.

Prototype

DWORD cnfGetResourceInfo ( CNFRESOURCEHD cnfresourcehd, CNF_RESOURCE_INFO *resourceinfo, unsigned size)

Argument

Description

cnfresourcehd

Handle returned by cnfOpenResource.

resourceinfo

Pointer to a CNF_RESOURCE_INFO structure:

typedef struct
{
  DWORD size;              /* size of the structure                  */
  DWORD board;             /* board number                           */
  DWORD boardtype;         /* unused                                 */
  DWORD capabilities;      /* capabilities currently available       */
  DWORD conference;        /* number of conferences currently running*/
  DWORD max_members;       /* maximum number of members              */
  DWORD available_members; /* number of members currently available  */

 } CNF_RESOURCE_INFO; 

Refer to the Details section for a description of these fields.

size

The maximum size of the buffer pointed by resourceinfo.


Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

resourceinfo pointer is NULL.

CTAERR_BAD_SIZE

size is smaller than the size of DWORD.

CTAERR_INVALID_HANDLE

cnfresourcehd is not a valid conferencing resource handle.


Details

cnfGetResourceInfo returns the information structure for the resource designated by cnfresourcehd.

The CNF_RESOURCE_INFO structure contains the following fields:

Field

Description

size

Number of bytes written to the buffer pointed to by resourceinfo.

board

Board number where the conference resource is located as declared in the board keyword file and in cnf.cfg.

boardtype

This field is longer used. It is kept for compatibility.

capabilities

Bitmask representing capabilities provided by the conferencing resource. The supported capabilities are defined in cnfdef.h. They are:

CNF_RESCAP_AUTO_GAIN_CONTROL

CNF_RESCAP_TALKER_PRIVILEGE

CNF_RESCAP_ACTIVE_TALKER

CNF_RESCAP_DTMF_CLAMPING

CNF_RESCAP_TONE_CLAMPING

CNF_RESCAP_ECHO_CANCELER

CNF_RESCAP_EC_10_MS_WINDOW

CNF_RESCAP_EC_20_MS_WINDOW

CNF_RESCAP_EC_100_MS_CV

CNF_RESCAP_EC_200_MS_CV

conference

Number of conferences currently running on the resource.

max_members

Maximum number of members the resource can manage if using the full resource capabilities.

available_members

Number of members available for creating a new conference using the full resource capabilities.


For more information, refer to Creating conferences.

See also

cnfCloseResource, cnfGetConferenceList, cnfGetResourceList, cnfOpenResource

Example

DWORD getResourceUsage(CNFRESOURCEHD cnfresourcehd, 
                        INT32 *percentage)
{
   DWORD error;
   CNF_RESOURCE_INFO resourceinfo;

   error = cnfGetResourceInfo (cnfresourcehd, &resourceinfo,
                               sizeof(CNF_RESOURCE_INFO)); 

   *percentage = 100 - (resourceinfo.available_members /
                         resourceinfo.max_member * 100);
   return(error);
}