PREV TOC HOME INDEX NEXT


gc_CCLibStatusEx( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_CCLibStatusEx(cclib_name, cclib_infop)
Inputs:

char *cclib_name

  • name of call control library
 

void *cclib_infop

  • status of call control library
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

library information

Mode:

synchronous

Platform and Technology:

All

Description

The gc_CCLibStatusEx( ) function retrieves call control library status. The status retrieved can be for a single call control library, specified by the cclib_name parameter, or the status of all libraries. The status of a library can be available, configured, or failed. This status information is stored in a location pointed to by cclib_infop. The cclib_infop parameter points to an integer location where the status information is stored for the single library specified. If the status for all the libraries is specified, then the cclib_infop points to a GC_CCLIB_STATUSALL structure. The current functionality retrieves the status of one library at a time. This functionality will be expanded to provide the status of all the supported libraries if requested. If the status of all the libraries is to be retrieved, the GC_ALL_LIB name must be specified and a pointer to a GC_CCLIB_STATUSALL structure must be passed by the cclib_infop parameter. The status will be returned in this structure.

Parameter

Description

cclib_name call control library name. See gc_CCLibNameToID( ) for valid call control library names. The string must be set to one of these names in uppercase and terminated by a NULL.
cclib_infop points to an integer location for status information. The possible states are:
  • GC_CCLIB_AVAILABLE
    available library (started successfully)
  • GC_CCLIB_CONFIGURED
    configured library
  • GC_CCLIB_FAILED
    library failed to start
If the status of all the libraries is to be retrieved, that is, if GC_ALL_LIB is specified by the cclib_name parameter, the application must pass the pointer to a GC_CCLIB_STATUSALL structure. The status of all the libraries will be returned in this structure.

Termination Events

None

Cautions

If an invalid cclib_name is passed to the gc_CCLibStatusEx( ) function, the function will not return <0 to indicate failure; the information stored in cclib_infop will remain unchanged (for example, 0).

Errors

If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).

Example

#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h> 
#define  MAX_STRING_SIZE        100 
int print_all_cclibs_status(void)
{
    int                  i;
    char                 str[MAX_STRING_SIZE], str1[MAX_STRING_SIZE];
    GC_CCLIB_STATUSALL   cclib_status_all;
    GC_INFO     gc_error_info;    /* GlobalCall error information data */ 
    if (gc_CCLibStatusEx("GC_ALL_LIB", &cclib_status_all) != GC_SUCCESS) {
        /* error handling */
        gc_ErrorInfo( &gc_error_info );
        printf ("Error: gc_CCLibStatusEx(), lib_name: %s, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
               "GC_ALL_LIB", gc_error_info.gcValue, gc_error_info.gcMsg, 
               gc_error_info.ccLibId, gc_error_info.ccLibName,
               gc_error_info.ccValue, gc_error_info.ccMsg);
        return (gc_error_info.gcValue); 
    }   
    strcpy(str, " Call Control Library Status:\n"); 
    for (i = 0; i < GC_TOTAL_CCLIBS; i++) {
        switch (cclib_status_all.cclib_state[i].state) {
            case GC_CCLIB_CONFIGURED:
                sprintf(str1, "%s - configured\n", 
                        cclib_status_all.cclib_state[i].name);
                break; 
            case GC_CCLIB_AVAILABLE:
                sprintf(str1, "%s - available\n", 
                        cclib_status_all.cclib_state[i].name);
                break; 
            case GC_CCLIB_FAILED:
                sprintf(str1, "%s - is not available for use\n", 
                        cclib_status_all.cclib_state[i].name);
                break; 
            default:
                sprintf(str1, "%s - unknown CCLIB status\n", 
                        cclib_status_all.cclib_state[i].name);
                break;
        }
        strcat(str, str1);
    }
    printf(str);
    return (0);
} 

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated February, 2003