82 Global Call API for HMP on Windows Programming Guide — August 2006
Application Development Guidelines
with the voice device (they are attached and routed on the TDM bus). If you do not specify the
voice device name when you open the Global Call line device, you can separately open a voice
device, and then attach and route it to the network interface device.
For boards that use the DM3 architecture in a flexible routing configuration, only the network
device name is required.
The following procedure shows how to initialize Global Call when using Digital Network Interface
boards.
Note: In Windows, use the sr_getboardcnt() function with the class name set to DEV_CLASS_DTI and
DEV_CLASS_VOICE to determine the number of network and voice boards in the system,
respectively. In Linux, use SRL device mapper functions to return information about the structure
of the system. For information on these functions, see the Standard Runtime Library API Library
Reference.
1. Start/Initialize Global Call using gc_Start( ).
2. Use gc_OpenEx( ) to open a Global Call line device.
Specify the network interface device name and the protocol name in the devicename
parameter, as in the following example:
":N_dtiB1T1:P_ISDN"
Alternatively, specify the network interface device name, the voice device name, and the
protocol name in the devicename parameter, as in the following example:
":N_dtiB1T1:V_dxxxB1C1:P_ar_r2_io"
3. Obtain the voice channel device handle.
Open a voice channel device (for example, dxxxB1C1) with dx_open() to get its handle.
Alternatively, if you specified the voice device name in the devicename parameter in
step2, use gc_GetResourceH( ), with a resourcetype of GC_VOICEDEVICE, to get the
handle.
4. Attach the voice and network interface devices.
Use gc_AttachResource( ) to attach the voice resource and the network interface line
device.
Alternatively, if you specified the voice device name in the devicename parameter in
step2, the voice and network interface devices are attached by nature of the
gc_OpenEx( ), so no action is necessary for this step.
5. Use gc_GetResourceH( ), with a resourcetype of GC_NETWORKDEVICE, to obtain the
network interface time slot device handle that is associated with the line device.
6. Set up TDM bus full duplex routing between the network interface device and voice device.
Use nr_scroute(FULL DUPLEX).
Alternatively, if you specified the voice device name in the devicename parameter in
step 2, the network interface device and voice device are automatically routed on the
TDM bus by nature of the gc_OpenEx().
Repeat steps 2 to 6 for all Global Call device line devices.