gc_TransmitAlarms( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_TransmitAlarms(linedev, aso_id, alarm_list, mode) Inputs: Returns: Includes: Category: Mode: Platform and Technology: Description
The gc_TransmitAlarms( ) function starts the transmission of alarms to the remote side. The function starts transmitting all alarms specified in alarm_list for the given line device.
linedev line device aso_id alarm source object (ASO) ID. Use the gc_AlarmSourceObjectNameToID( ) function to obtain the ASO ID for the desired alarm source object. Use the gc_GetAlarmSourceObjectNetworkID( ) function to obtain the network ID. ALARM_SOURCE_ID_NETWORK_ID can be used if the network ASO ID associated with the line device is desired. For a list of ASO IDs that are known to Global Call, see Table 18, "Alarm Source Object IDs". alarm_list points to the alarm list. See ALARM_LIST for descriptions of the fields in the ALARM_LIST data structure. Note: Only the alarm_number field of ALARM_FIELD in the ALARM_LIST data structure is used. mode set to EV_SYNC for synchronous mode (only synchronous mode is supported) Termination Events
Cautions
- Detailed knowledge of the alarm source object is required to use this function properly.
- If any of the alarms failed to start transmitting, the function will return an error. To ensure that an error is received for every failure, start the alarms one at a time.
- If the function is partially successful, that is, if only some of the alarms in alarm_list start transmitting, the alarms that were successfully started will not be stopped.
- The list of possible alarms used by the ASO is defined by the ASO itself, not by Global Call. See Section 6.1, "Alarm Source Object IDs" and the Global Call API Programming Guide for more information about ASOs.
- Some alarm source objects may require that a gc_SetAlarmParm( ) be issued before calling this function. This requirement is alarm source object dependent.
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> #include <dtilib.h> /* for ASO symbols */ int rc; LINEDEV linedev; ALARM_LIST alarm_list; GC_INFO gc_error_info; /* GlobalCall error information data */ /* -- This code assumes that linedev is already assigned -- it also assumes that linedev's alarm source object -- is known to be Springware E1 -- this could have been done via gc_GetAlarmSourceObjectNetworkID */ /* init all to 0 */ memset(&alarm_list, '\0', sizeof(ALARM_LIST)); /* transmit one alarm - DTE1_RSA1 */ alarm_list.n_alarms = 1; alarm_list.alarm_fields[0].alarm_number = DTE1_RSA1; rc = gc_TransmitAlarms(linedev, ALARM_SOURCE_ID_SPRINGWARE_E1, &alarm_list, EV_SYNC); if (rc < 0) { /* get and process the error */ }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation