6.1 General Programming Tips
The following tips apply when programming with Global Call:
- When using Global Call functions, the application must use the Global Call handles (that is, the line device ID and CRN) to access Global Call functions. Do not substitute a network, voice or media device handle for the Global Call line device ID or CRN. If the application needs to use a network, voice or media device handle for a specific network or voice library call, for example, nr_scroute( ) or dx_play( ), you must use the gc_GetResourceH( ) to retrieve the network, voice or media device handle, associated with the specified Global Call line device. The gc_GetResourceH( ) function is only needed if the voice or media resource is associated with a Global Call line device. If a voice resource is not part of the Global Call line device, the device handle returned from the dx_open( ) call should be used.
- Do not access the underlying call control libraries directly. All access must be done using the Global Call library, that is, using Global Call (gc_) functions.
- Do not call any network library (dt_) function directly from your application that may affect the state of the line or the reporting of events, for example, dt_settssig( ), dt_setevtmsk( ), or others.
- The GCEV_BLOCKED and the GCEV_UNBLOCKED events are line related events, not call related events. These events do not cause the state of a call to change.
- Before exiting an application:
- Drop and release all active calls, using the gc_DropCall( ) and gc_ReleaseCallEx( ) functions.
- Close all open line devices, using the gc_Close( ) function.
- Stop the application, using the gc_Stop( ) function
- Before issuing gc_DropCall( ), you must use the dx_stopch( ) function to terminate any application-initiated voice functions, such as dx_play( ) or dx_record( ).
- In Windows environments, although asynchronous models are more complex than the synchronous model, asynchronous programming is recommended for more complex applications that require coordinating multiple tasks. Asynchronous programming can handle multiple channels in a single thread. In contrast, synchronous programming requires separate threads. Asynchronous programming uses system resources more efficiently because it handles multiple channels in a single thread. Asynchronous models let you program complex applications easily, and achieve a high level of resource management in your application by combining multiple voice channels in a single thread. This streamlined code reduces the system overhead required for inter process communication and simplifies the coordination of events from many devices.
- In Windows environments, when calling the gc_GetMetaEventEx( ) function from multiple threads, ensure that your application uses unique thread-related METAEVENT data structures or ensure that the METAEVENT data structure is not written to simultaneously.
Click here to contact Telecom Support Resources
Copyright 2002, Intel Corporation