PREV TOC HOME INDEX NEXT


gc_GetAlarmSourceObjectList( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetAlarmSourceObjectList(linedev, ByNameOrById, aso_list)
Inputs:

LINEDEV linedev

  • line device

int ByNameOrById

  • specifies whether list is a list of ASO names or a list of ASO IDs

ALARM_SOURCE_OBJECT_LIST *aso_list

  • pointer to alarm source object list
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

GCAMS

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1, ISDN

DM3: T-1/E-1, ISDN

IP (host-based stack)

Description

The gc_GetAlarmSourceObjectList( ) function retrieves a list of all alarm source objects associated with a specified line device. The list can contain either alarm source object (ASO) names or ASO IDs.

If the call control library associated with the specified line device uses the Global Call Alarm Management System (GCAMS), then the first entry in the list of ASOs retrieved by gc_GetAlarmSourceObjectList( ) is the network ASO ID.

Parameter

Description

linedev line device
ByNameOrById specifies whether the function is to return a list of ASO names or a list of ASO IDs. Valid values are:
  • ASO_LIST_BY_NAME
  • ASO_LIST_BY_ID
aso_list points to the alarm source object list. The Global Call API fills in this data structure with a list of all alarm source objects and their names for the requested line device. NULL is not allowed. The aso_data field of ALARM_SOURCE_OBJECT_FIELD is of type char * if the request is "by name". If the request is by ID, the field is typed an unsigned long. See ALARM_SOURCE_OBJECT_LIST for a description of the data structure.

Termination Events

None

Cautions

None

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 <stdlib.h>
#include <gclib.h>
#include <gcerr.h> 
    LINEDEV                   linedev;
    ALARM_SOURCE_OBJECT_LIST  aso_list_by_name;
    ALARM_SOURCE_OBJECT_LIST  aso_list_by_id;
    int                       rc, i;
    GC_INFO     gc_error_info;    /* GlobalCall error information data */ 
    /*
    -- This code assumes that linedev is already assigned
    */
    rc = gc_GetAlarmSourceObjectList(linedev, ASO_LIST_BY_NAME, &aso_list_by_name);
    if (rc < 0)
    {
         /* get and process the error */
         gc_ErrorInfo( &gc_error_info );
         printf ("Error: gc_GetAlarmSourceObjectList() on device handle: 0x%lx, 
              GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
               linedev, 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);
    }
    else 
    {
         rc = gc_GetAlarmSourceObjectList(linedev, ASO_LIST_BY_ID, &aso_list_by_id);
         if (rc < 0)
         {
               /* get and process the error */
              gc_ErrorInfo( &gc_error_info );
              printf ("Error: gc_GetAlarmSourceObjectList() on device handle: 0x%lx, 
                     GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
                     linedev, 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);
         }
         else 
         {
         /*
          -- This code assumes that aso_list_by_id.n_asos == aso_list_by_name.n_asos
         */
             printf("Alarm source objects associated with linedev %d are: \n", linedev);
             for (i = 0; i < aso_list_by_id.n_asos; i++)
             {
                 printf("\tID: %d\t\tName: %s\n",
                         aso_list_by_id.aso_fields[i].aso_data.intvalue,
                         aso_list_by_name.aso_fields[i].aso_data.paddress);
             }
         }
     } 

See Also

None


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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