Creating a batch file to manualy dial a modem

I would like to create a batch file to manauly dial a number on my modem that is connected to a linux box running e-smith 6.0. The reason for this is so that I can turn on and off my call divert while out of the office. i need to dial 161 then wait for maybe a second then hang up to turn off I dial 160 again wait for the tone maybe a second then hang up. Ideally i want to be able to make a batch file that I can call froma web / wap page but intially i would be happy if I could get the commands to do it from a command. I am runny Hyla fax so the modem is always waiting for a call so might need to bypass this some how.

Strange request but i don't want to have to pay the telecom provider more money to have the remote service set up, currently can only be done form the line that has the divert on it??

Thanks in advance



LVL 1
missmuppetAsked:
Who is Participating?
 
gtkfreakCommented:
Check out a program called wvdial on your system.
# man wvdial
# man wvdial.conf

You can see the option you can setup using wvdial and also put in the configuration info such as phone number, etc in the wvdial.conf file.
0
 
DonConsolioCommented:
Try something like this:

----- dial1.sh --------------------
:

MODEMDEV=/dev/ttyS0

(
echo "ATD$1" # Hayes Modem command DIAL
sleep $2
echo ATH # Hayes Modem command HANGUP
) > $MODEMDEV
-------------------------------------

Use:
chmod +x dial1.sh
# dial 160 - wait a second - hang up
./dial1.sh 160 1
# dial 161 - wait 2 seconds - hang up
./dial1.sh 161 2
 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.