Phonebook entry in windows

David Bolen db3l at fitlinxx.com
Wed Jul 4 16:18:38 EDT 2001


Antonio Navarro Navarro <hostmaster at bemarnet.es> writes:

> I need to write a stand-alone Python application that will run like a
> daemon (started at windows boot) to create a Phonebook entry on a
> Windows 95 machine, start up a connection, make some FTP transfers and
> then hang up and delete the connection.
> 
> I have been reading the mailing list and have found several references
> to win32ras.CreatePhonebookEntry, EditPhonebookEntry, etc, but I don't
> know if this functions are fully functional.

The problem with the currently wrapped functions in win32ras is that
they all involve GUI interaction with the user.  That is, they behave
just as if the user was creating or editing the entry.  I do not
believe that any functions are currently wrapped that will let you
silently create such entries.

> Where can I find more info, for example a working script that
> creates-connect-disconnect-deletes a phonebook entry in Python ?

Well, the rastest.py module in the demos directory of the win32all
installation (under <pythonroot>/win32) exercises most of the
functions including a sample of a callback with the Dial function.

> Do you think It will be better to use a different approach ? (I prefer
> not to use rasdial.exe, because I need to obtain full control of the
> connection process).

One suggestion is to have a fixed entry in the phonebook (already
established) that you just reference in your win32ras.Dial call - you
can still override the phone number at dial time.

Alternatively if you can handle default phonebook entry settings, you
can use win32ras.Dial directly without a phone book entry - just
include all the parameters in the call.  Note however that at least
under NT 4, there is a bug that over time (and generally thousands of
calls) can build up stray RAS parameter entries in your registry which
make the dialing process very sluggish.

The other option would be to write your own wrapper function around
the RasSetEntryProperties function which can create an entry without
any user interaction.  Or, use a standalone utility (we did one
locally but I'm sure there must be something around on the net) that
can build a RAS entry and execute that from your code with os.system()
or os.popen().

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list