Intel 05-2409-003 Manual Do Utilizador

Página de 154
Global Call API for HMP on Windows Programming Guide — August 2006
81
Application Development Guidelines
5.3.2.2
Using Device Handles (Flexible Routing)
When using Digital Network Interface boards, application performance may be a consideration 
when opening and closing devices using Global Call. If an application must use Global Call to 
dynamically open and close devices as needed, it can impact the application’s performance. One 
way to avoid this is to open all devices during application initialization and keep them open for the 
duration of the application, closing them only at the end.
5.3.2.3
Multi-Threading and Multi-Processing (Flexible Routing)
When using Digital Network Interface boards, the R4 APIs support multi-threading and multi-
processing with some restrictions on multi-processing as follows:
One specific channel can only be opened in one process at a time. There can, however, be 
multiple processes accessing different sets of channels. In other words, ensure that each 
process is provided with a unique set of devices to manipulate.
If a channel was opened in process A and then closed, process B is then allowed to open the 
same channel. However, since closing a channel is an asynchronous operation when using R4, 
there is a small gap between the time when the xx_close( ) function returns in process A and 
the time when process B is allowed to open the same channel. If process B opens the channel 
too early, things could go wrong. For this reason, this type of sequence should be avoided. 
5.3.2.4
Initializing an Application (Flexible Routing)
A device must first be opened in order to obtain its handle, which can then be used to access the 
device functionality. Since applications use Global Call for call control (that is, for call setup and 
tear-down), all Intel network interface devices must be opened using the gc_OpenEx( ) function. 
Note:
When call control is not required, such as with ISDN NFAS, dt_open( ) can be used to open DM3 
network interface devices. 
Once the call has been established, voice and or data streaming should be done using the Voice 
API. Functions such as dx_playiottdata( )dx_reciottdata( ), and dx_dial( ) can be used. Of 
course, in order to do so, the voice device handle must be obtained. 
5.3.2.5
Initializing Global Call (Flexible Routing)
This scenario is one where an application uses Digital Network Interface boards in a flexible 
routing configuration. When initializing an application to use boards based on the DM3 
architecture, you must use Global Call to handle the call control.  
Take note of the following flexibility that exists for the gc_OpenEx( ) function when opening a 
Global Call line device on Digital Network Interface boards: 
Due to the nature of the DM3 architecture, the protocol name is irrelevant at the time of 
opening the Global Call line device; that is, the protocol name is ignored. Also, when using R4 
with boards based on the DM3 architecture, all protocols are bi-directional. You do not need to 
dynamically open and close devices to change the direction of the protocol. 
It is not necessary to specify a voice device name when opening a Global Call line device. If 
you specify the voice device name, the network interface device is automatically associated