Remote Access Services
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.
![]() |
The win32ras
module supplied
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 RASDIALPARAMS structure
in Windows. The values are:
Entry name
Phone number
Callback number (used if you are dialing an NT server configured to call you right ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
