Dailing modem.

Josiah Carlson jcarlson at uci.edu
Wed Jan 21 11:53:02 EST 2004


> I need to dail a modem from python and disconnect it again. Is there a pythonic way of doing this? Life is just too short for fiddling with the complexity of TAPI via COM. But if you do have a TAPI-way of doing this, please share.
> 
> Help will be welcomed greatly!

Herman,

You can actually open up a file called 'COM1' or 'COM2' (or any other
com ports) and do writes to them without any win32 extensions (reads are
another matter entirely).  There are tricks so that you're not trying to
open the port with both Python and some other app, but as long as your
secondary application doesn't have a hold, you can send both 'ATDT
<phone number>\r\n' and '+++ATH\r\n', for desired "dial then hangup"
behavior.

 - Josiah




More information about the Python-list mailing list