Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss. print.
THE MAGIC OF THE MODEM

Recently I posted a question on this site about AT commands. What I wanted to achieve was to find the Hayes-AT command that was responsible for connecting my modem and soundcard so I could use my headset.

First I thought I had found the solution, but then it appeared to me, after restarting my machine the next day, that this “naughty” machine played haywire with me. (I’m getting a new machine soon).

The solution did not work any more and I was really puzzled. So I started playing around a bit with modem setting through the configuration screen. All of a sudden I saw the possibility to write modem actions to a log file. This log file could be opened with notepad or any ASCII text-editor.

Here is how I did it.


I opened the Control Panel and double-clicked on Modem. You get the following screen.



Next I clicked on Properties, this screen appears:



Wondering what the advanced button had as a surprise I pressed that, this is what I got:



And here I saw the checkbox, add to logfile, directly under that the button, show log. It looks like this:



NOW, there was my solution. I could let the modem tell me how to do it.

I emptied the logfile, closed all windows and started outlook contacts. The number from one of my friends was in the list. I called him, using the screens offered by Outlook (right click the contact record and choose 'Call Contact...' . The conversation was done on my side over the headset. After that I opened the logfile again and looked what it had to say.

Wow, it had to say a lot. Never knew that a modem could tell me that much.

Final Solution
So here is the final solution. There are quite some lines of code involved but this will work fine.

All these lines should go to the output-property of the communication control.
portopen = .T.
"AT"+chr(13)
"AT&FE0V1S0=0&C1&D2+MR=2;+DR=1;+ER=1;W0"+chr(13)
"ATS7=60M1+ES=3,0,2;+DS=3;+IFC=2,2;X4"+chr(13)
"at+fclass=8"+chr(13)
"at+vls=0"+chr(13)
"at+vrn=0"+chr(13)
"at+vtd=10"+chr(13)
"at+vsm=130,8000,0,0"+chr(13)
"at+vit=6"+chr(13)
"at+vsp=1"+chr(13)
"ATDT"+chr(13)
"ATX3DT<PhoneNumber>"+chr(13)


Between each command there should be a short break (about 0.075 to 0.1 seconds) to give the modem a chance to reply.
This should always be an “OK” string. For the purpose of this white paper I rewrote the callme form I posted earlier on the Foxite. It now has a checkbox indicating whether or not you have a headset. So now you can use this form with a normal phone and with a headset. Just play around a bit with it and let me know what you think about it.

Download code
Click here to download the code that is discussed in this article. The download is a zipfile. Its size is 9.803 bytes.

ABOUT THE AUTHOR: BOUDEWIJN LUTGERINK

Boudewijn Lutgerink Programming is one of the many hobbies of Boudewijn. He has worked with computers since 1985 and is the author of two books from Sybex. He has a weblog at http://weblogs.foxite.com/boudewijnlutgerink.

FEEDBACK


Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: