




6.3. Demo-Related Initialization (Appinit.c)
The application main( ) function calls MailInitialization( ), which does the following:
- Gets any arguments from the command line.
- Calls IPTResetSession( ) to reset the demo data structures and initialize all channels' states to INIT.
- Reads information from the configuration file (iptmail_r4.cfg or other CFG file determined by the user) and updates the ConfigFileParm in the AppSession data structure.
- Calls gc_Start( ): starts all configured, call control libraries.
- Sets up the call-back handler, PDLsr_enbhdlr( ).
- Calls getVoiceChannels( ) which checks the number of available voice devices:
- Gets the number of voice boards, by calling PDLsr_getboardcnt( ).
- For each board that was found:
· Opens the board, by calling dx_open( ).
· Finds number of channels per board, by calling ATDV_SUBDEVS( ).
· Calculates the logical board and channel and saves them into AppSession.VoiceParams.
· Closes the board, by calling dx_close( ).
- Calls getIPChannels( ) which checks the number of available IP channels:
- Gets the number of voice boards, by calling PDLsr_getboardcnt( ).
- For each board that was found:
· Opens the board, by calling gc_open( ).
· Finds number of IP channels per board, by calling ATDV_SUBDEVS( ).
· Calculates the logical board and channel and saves them into AppSession.ipParams.
· Closes the board, by calling gc_close( ).
- 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).
- NOTE:
- The printf( ) function must be used when printing an error/ trace/warning during the above initialization operations, because some actions are not related to a specific channel and log files are not yet opened.
- Opens the channels' log files if --l command-line option was used.
- Prints information from the configuration file.
- Calls the IPInit( ) function. See Section 6.4. IP Link-Related Initialization for a description of the IPInit( ) function.
- Calls the VoiceInit( ) function. See Section 6.5. Voice-Related Initialization for a description of the VoiceInit( ) function..
- Calls the InitMailBoxs( ) function, which initializes the MAILBOX structure.
- 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 September, 2002