




6.4. Initializations
The application main( ) function calls gateInitialize( ), which does the following:
- Calls checkArg( ) to check for command line parameters and handle them accordingly.
- Calls IPTResetSession( ) to reset the demo data structures and initialize all channels' states to INIT.
- Calls ClearAllBoards( ) to reset the board structures to default values.
- Calls gateConfiguration( ) to read information from the configuration file (gateway_R4.cfg or other CFG file determined by the user) and update the ConfigFileParm in the Session data structure.
- Calls gc_Start( ) to open all configured, call control libraries.
- Calls printAllLibs( ) to print library status (open or failed).
- Sets-up the call-back handler, PDLsr_enbhdlr( ). The callback handler handles events that it receives from the SRL library. For more details see Section 6.5.2. Handling SRL Events.
- Calls pstnGetVOXChannels( ) which checks how many available PSTN voice channels there are by doing the following:
- Gets number of PSTN boards, by calling PDLsr_getboardcnt( ).
- For each board that was found:
· Calls dx_Open( ) to open an analog board, or dt_Open( ) to open a digital board.
· Calls ATDV_SUBDEVS( ) to get the number of channels on the board.
· Calculates the logical board and channel and saves them into Session.pstnParams
· Closes the board, by calling dx_Close( ) or dt_Close( ).
- Call ipGetChannels( ) which checks how many available IP channels there are by doing the following:
- Gets number of IP boards from #define MAX_IP_BOARDS in gatedefs.h
- For each board that was found:
· Calls gc_OpenEx( ) to open the board
· Calls ATDV_SUBDEVS( ) to get the number of channels on the board
· Calculates the logical board and channel and save them in Session.ipParams
· Registers the board with the Gatekeeper by calling boardRegistration( )
- Calls getGateChannels( ) to find the demo MAX available channels (the smaller of available IP or Voice Devices and the number of channels specified with the --n command line option, if used).
- Calls pstnOpenFrontEnd( ) which opens the PSTN channels by doing the following. For each channel:
- Calls gc_OpenEx( ), which returns the PSTN LineDevH, and saves it in Session.pstnParams
- If the PSTN board is an analog board:
· Calls gc_LoadDxParm( )
· Calls gc_GetVoiceH( ), which returns the PSTN VoiceH, and saves it in Session.pstnParams
- If the PSTN board is a digital board:
· Calls gc_OpenEx( ), which returns the PSTN LineDevH, and saves it in the Session.pstnParams structure
· Calls gc_GetNetworkH( ), which returns the PSTN NetwH, and saves it in Session.pstnParams
- Calls ipOpenDevices( ) which opens the IP channels by doing the following:
- Calls gc_OpenEx( ) which opens all IP devices, returns the IP LineDevH, and saves it in Session.ipParams
- Saves the channel number in the global array HandleToChannel[ ] according to the LineDevH handle
- The application main( ) function calls waitForKey( ), to receive keyboard input.





Click here to contact Telecom Support Resources
Copyright 2002, Intel Corporation
All rights reserved
This page generated October, 2002