There is no real need to talk to modems these days, because Windows provides a standard set of dialogs and APIs for making and breaking dial-up connections. These are collectively known as Remote Access Services, or RAS for short. Users can create and save connections that specify many things, including the number to dial, usernames and passwords, and network protocols and settings.
The dialogues vary considerably between Windows 95, 98, and NT, but the principles under the hood are the same. Windows thinks in terms of a phonebook. NT can have many phonebooks, stored in files with extension PBK; on Windows 95 and 98 there is a single default phonebook. The machine in Figure 19.1 has three entries.
with PythonWin provides a number of functions to manipulate these.
EnumEntries() returns a list of tuples with the
names of the entries in the phonebook:
>>> import win32ras >>> win32ras.EnumEntries() # what is in the phonebook? [('Assi Modem Pool',), ('Demon',), ('Demon Private',)] >>> win32ras.EnumConnections() # show what's active now  >>>
To make a connection, you need to specify a tuple of up to six
strings. This matches the
in Windows. The values are:
Callback number (used if you are dialing an NT server configured to call you right ...