Establishing a Modem Connection (Windows CE 5.0)
An application that is based on Windows CE and that uses a modem must be able to handle tasks such as initializing the modem, opening the line, dialing a telephone number, closing the line, and disconnecting when the session is complete.
To create a modem connection by using TAPI
- Call the lineInitializeEx function to initialize TAPI.
- Call the lineOpen function to open the line.
- Call the lineMakeCall function.
- Call the lineGetMessage function, as needed, to receive status messages from TAPI.
- Call the lineDeallocateCall function.
- Call the lineClose function to close the line connection.
- Call the lineShutdown function to end the session.
The lineInitializeEx function returns the number of line devices that are available. If the LINEINITIALIZEEXOPTION_USEEVENT message is specified, no callback function is required, and you can use the lineGetMessage function to retrieve a TAPI message.
When the call is set up, TAPI returns a LINE_REPLY message. This message indicates only that the call has been established at the local end, which is indicated perhaps by a dial tone. The parameters for the lineMakeCall function are the telephone number to dial, the handle to a line device, and other parameters. As the connection process proceeds, TAPI returns a series of LINE_CALLSTATE messages to indicate the progress of the connection; for example, dial tone and ringing. When the connection is completed, TAPI returns a LINECALLSTATE_CONNECTED message.
During data transfer, TAPI continues to manage the connection, but the application handles data transmission and reception. When the transmission is complete, TAPI returns a LINE_CALLSTATE message, such as one that indicates that a remote disconnect has occurred.
See Also
TAPI Application Development | Initializing TAPI | Resource Inventory and Version Negotiation | Opening a Line | Making a Phone Call | Using the Callback Function | Address Translation | Incoming Calls | Shutting Down TAPI | Supplementary Telephony Functions | TAPI Functions
Send Feedback on this topic to the authors