gc_Start( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_Start(startp) Inputs: Returns: Includes: Category: Mode: Platform and Technology: †See the Global Call Technology User's Guides for additional information.
Description
The gc_Start( ) function starts and initializes call control libraries. This function must be called before any other Global Call function is called. The application can specify one or more call control libraries to be started through the GC_START_STRUCT data structure.
To start all the supported call control libraries:
- Pass a NULL parameter; that is, use gc_Start(NULL).
- Set the num_cclibs field in the GC_START_STRUCT structure pointed to by startp to a value of GC_ALL_LIB.
The function opens the call control libraries that interface directly to the network interface so that these libraries can be used by the Global Call library.
The gc_Start( ) function returns 0 if the call control libraries have successfully started. If a NULL parameter is passed to gc_Start( ) and a call control library is not present, an error is not returned. However, the state of the missing call control library will be "failed". If GC_START_STRUCT is used, an error is returned if one or more of the libraries fail to load.
Successfully started libraries are available to be used by the Global Call functions and are called "available" libraries. Libraries that fail to start are called "failed" libraries. Use the gc_CCLibStatusEx( ) function to determine the status (available, configured, failed) of one or all call control libraries.
startp points to list of call control libraries to be loaded and started. If NULL, then all of the supported libraries will be started. Termination Events
Cautions
- The gc_Start( ) function should be called only once per application execution. Calling gc_Start( ) a second time (i.e., after gc_Stop( ) function) is not recommended although it is allowed in a debug environment. If calling gc_Start( ) after gc_Stop( ) is needed in your application, it should be done only a limited number of times, not frequently.
- For Linux applications, the gc_Start( ) function must be called from the parent process when creating child processes.
- For multi-threaded applications, the gc_Start( ) function must be called from the primary thread when creating multiple threads. The gc_Stop( ) function must be called from the same thread that issued the gc_Start( ) call.
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.
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> int sysinit() { GC_START_STRUCT gclib_start; /* Structure for gc_Start() */ GC_INFO gc_error_info; /* GlobalCall error information data */ GC_CUSTOMLIB_STRUCT custom_lib1 = { "libgcxyz.dll", "xyz_Start" }; CCLIB_START_STRUCT cclib_start[]={ {"GC_ANAPI_LIB",NULL}, {"GC_ICAPI_LIB",NULL}, {"GC_PDKRT_LIB",NULL}, {"GC_CUSTOM1_LIB",(void *)&custom_lib1}, }; gclib_start.num_cclibs = 4; gclib_start.cclib_list = cclib_start; /* Next issue a gc_Start() Call */ if ( gc_Start( &gclib_start ) != GC_SUCCESS ) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_Start(), GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", 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); } return (0); /* Next open the GlobalCall Line Devices */ return(0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation