Results 1 to 6 of 6
Is there any possibility to make my modem dialing up a certain number via command line? I'm working on a telephone book in Gambas, and I would assign to a ...
- 01-17-2008 #1
Command line dialing-up
Is there any possibility to make my modem dialing up a certain number via command line? I'm working on a telephone book in Gambas, and I would assign to a button a command line event. I would only need the code.
If you need a CD/DVD catalogizer, give a try to my program:
http://www.kde-apps.org/content/show...content=100682
Linux Usert#430188
- 01-17-2008 #2Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
If I remember right (been awhile) it's quite simple to do, just print the AT commands to the modem device. For example:
This is the shell way, but it's simple in any language because you can open devices like files and print to them.Code:echo "ATDT5592353" > /dev/ttyS1
- 01-18-2008 #3
valan's answer is correct as far as it goes. There are far more things you can do with what is called "the AT command set"; go here for details.
But before you even talk with the modem, you need to do things with the serial line itself, stuff like set the Baud rate, number of stop bits, and so on. In C, you do this with the tcgetattr() and tcsetattr() function calls. I wouldn't begin to know what to do in Basic, which I guess you're using with Gambas.
But if you're working on a telephone book, is this for voice communications? If so, what is it you want to do, exactly, with the modem?--
Bill
Old age and treachery will overcome youth and skill.
- 01-18-2008 #4
What I want
I'm writing a phone book, with addresses e-mail addresses etc. All I want to do is when I select a name in the combo box (and of course the phone number belonging to it) to press the "Dial " button on the GUI and have this particular number dialed up via modem. I would only pick up the head-set and talk with the chosen person. I also would like to implement command line printing of my phone book kept in a Database.txt file.
Example: I would like to dial up 845-1223 number with command line.If you need a CD/DVD catalogizer, give a try to my program:
http://www.kde-apps.org/content/show...content=100682
Linux Usert#430188
- 01-18-2008 #5
That will work.
As soon as the person at the other end picks up the phone, your modem will ordinarily emit squawks as it tries to negotiate the Baud rate with what it hopes is a modem at the other end.
This will puzzle the person at the other end, and he is unlikely to say "hello" (or whatever greeting is used in his country).
To avoid this, put a semicolon at the end. Example:
There are other things to consider as well.Code:ATDT12099661200;
First, I don't know about your modem, but mine requires that the end of line character after a command be carriage return, not line feed. Line feed doesn't work. Line feed is the standard end of line character in the UNIX/Linux world. So be careful.
Another caution is that just doing an echo (which will not give you the carriage return you want) or a cat from a file (which will give you the carriage return if you've constructed the input file properly) won't work. I'm not sure why.
You're working in Basic. But if you know C, I can share with you a program I wrote which actually uses the modem. I've attached it to this response. You can experiment with it and strip out the stuff you don't need (and add the semicolon at the end of the number you dial).
If you experiment with this program, and discover how to take the program you end up writing and translating it from C to Basic, you're home.
The extension of the source code is .txt, because the attachment software at linuxforums doesn't allow .c. Grrrrr. Just remove the .txt after you download the file.
Hope this helps.
Edit:
I tried uploading the program, but the attachment software didn't work at all for me. I'll try again in the next response.--
Bill
Old age and treachery will overcome youth and skill.
- 01-18-2008 #6
The program is too large to be accepted by the attachment software at linuxforums. Did it give me an error message? Nooooooooooooo.
So download that program here. I'll leave it there for at least a week.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote