Modem AT commands -- confucious

I know that programming questions may be off topic for this group but it's the type of basic question I can't get a handle on ANYWHERE, including fruitless web searches.

I'm trying to get a basic understanding of how to talk to a modem.

I have a pretty decent understanding of VB.NET and using my serialport, have written the very basic number one step....that is, a simple dial out command....ATDT, the phone number etc.

So, there you have it, I can make my phone ring....whoopee! (And so far, that's it).

My ultimate goal is to use the modem to make a call from my windows program and play some audio from my soundcard for 30 seconds or so, once the call is answered.

So, I need a voice modem and it's unique command set......I know that.

MY QUESTION IS --

Can you actually get responses to your AT commands from the ORIGINATING modem or do you have to another modem answer the call and IT sends back responses (like RING -- VCON -- etc).

Obviously, I won't be talking to another modem but will be calling a telephone.

Problem is, when your writing code, I don't know where to start after I've called the number...(with serialport.write).

The best thing I've seen is a textbox I have set up that looks at the serialport read data and it shows my the called number.....but for the life of me, I can't see anything else. (like all the feedback you're supposed to see?)

My guess is, I've asked a stupid question.

YOU DO NOT get data back from the originating modem -- only another modem that's talking to it. (?)

If that's the case, how in the heck do I accomplish what I want to do? Just call, send the audio and hope that it will be answered?

THANKS kindly for any help on this.

Reply to
mkrnews
Loading thread data ...

you can use a sound card if you wish, you'll need to do some wiring to link the two together or, you can use the Fax/voice modem's feature, which is in most cases, shows as a sound card in the system.

You need to get more acquainted with sound card programming to capture the PCM data. It's a matter or enumerating the devices which should yield a sound device with most likely low bit rate abilities.

Another area you may want to get acquainted in is the RAS "Remote Access Service"

formatting link
"

Reply to
Jamie

Softly. And with a big stick.

Not easily done with a simple modem. Google "PBX PC Card".

You send/receive AT commands from your local modem when it is in command mode. Originating or otherwise. When your link is in data mode, you send/receive data through the remote modem to/from its host.

The RING, VCON, etc. responses are from your local modem. Some are the result of handshaking between your end and the remote end. But in command mode, you talk to your modem.

You should see the connection progress messages. You might have to set a register in the modem to get more verbose dialog. This assumes that there are two modems doing some handshaking. If you are calling a voice line, you might hear 'Hello, hello?' from the other end through the speaker. But your modem will wait patiently (until it times out) waiting for a modem to reply with a carrier tone (the annoying whistle you hear when you call a modem line by mistake).

You get some call progress messages (if enabled). There is a message to announce the other end going off hook (or when ringing ceases, it assumes something picked it up). From that point, you are on your own when handling voice calls.

If your modem calls me to offer magazine subscriptions or size enhancing drugs, I've got your e-mail address and I'm coming after you. ;-)

--
Paul Hovnanian  paul@hovnanian.com
----------------------------------------------------------------------
Have gnu, will travel.
Reply to
Paul Hovnanian PE

Softly. And with a big stick.

Not easily done with a simple modem. Google "PBX PC Card".

You send/receive AT commands from your local modem when it is in command mode. Originating or otherwise. When your link is in data mode, you send/receive data through the remote modem to/from its host.

The RING, VCON, etc. responses are from your local modem. Some are the result of handshaking between your end and the remote end. But in command mode, you talk to your modem.

You should see the connection progress messages. You might have to set a register in the modem to get more verbose dialog. This assumes that there are two modems doing some handshaking. If you are calling a voice line, you might hear 'Hello, hello?' from the other end through the speaker. But your modem will wait patiently (until it times out) waiting for a modem to reply with a carrier tone (the annoying whistle you hear when you call a modem line by mistake).

You get some call progress messages (if enabled). There is a message to announce the other end going off hook (or when ringing ceases, it assumes something picked it up). From that point, you are on your own when handling voice calls.

If your modem calls me to offer magazine subscriptions or size enhancing drugs, I've got your e-mail address and I'm coming after you. ;-)

--
Paul Hovnanian  paul@hovnanian.com
----------------------------------------------------------------------
Have gnu, will travel.
Reply to
Paul Hovnanian PE

Paul --

Thank you SO MUCH.

You've really cleared some things up for me I wasn't able to get on some programming forums.

I'm going to sleep on this tonight and hopefully, make better progress tomorrow -- and hopefully as well, you may be kind enough to check back on my replies.

First of all, I may not even be in "command mode" ?

But I thought that, when you preface everything with AT, your automatically there. (?)

You've enlightened me with "connection progress messages" which really, is what I'm after (and all I'll get with just MY modem and a telephone on the other end).

BUT, that will be good enough.

At this point, I just need to know when the modem quits ringing -- put it in voice mode and play the audio. (Yes, I do have the card patched to the modem, I hear it fine).

I've tried everything ! to see those responses....RING VCON etc

stuffback = serialport.readexisting( ) textbox.text = stuffback

And don't worry -- no telephone solicitation involved !

Thanks.

Reply to
mkrnews

The modem starts out in command mode, and stays that way until you issue ATD... and get a CONNECT response, at which point DTR should go high. Once connected, it stays in data mode until you send three "+" characters followed by a break (many modems don't care about the break part to avoid Hayes' patent).

Reply to
Nobody

That could be fun if you're sending a text file with a row of + marks in it!

Reply to
Greegor

Apparently, it's exploitable:

formatting link

Reply to
Nobody

Yup. Similarly, I remember some USENET postings in which the authors would include the TIES (time-independent escape sequence) hangup. People reading USENET via dialup servers at budget-minded ISPs would tend to lost their connection upon reading the article :-)

--
Dave Platt                                    AE6EO
Friends of Jade Warrior home page:  http://www.radagast.org/jade-warrior
  I do _not_ wish to receive unsolicited commercial email, and I will
     boycott any company which has the gall to send me such ads!
Reply to
Dave Platt

Man I am so confused by these past few days I don't know where to start.

I've read where +++ PUTS the modem in command mode! (from data mode). See below ** (I got off a web page).

I just wish I could see the code to make this thing happen.....I'm all over the place with it.

I know there are + and # voice modems. I know I can make a call using ATDT and the number. I've heard you put it in voicemode before calling. I've also heard after calling.

** "+++ This is the default escape sequence. Transfers the modem from data mode to command mode. Must be preceded by at least 1 second of no characters and followed by one second of no characters. O0 (ATO0 or ATO) returns the modem to data mode."

I just want to use a voicemodem, my serial port and VB.NET to....

(1) make a call to a telephone number (not a modem) "ATDT1XXXXXXXXXX" & controlchars.cr (2) know when the call is answered VRA? VRN? (3) play audio from my sound card for 30 seconds VLS? VTX? (4) hang up the modem "ATH" & controlchars.cr

Driving me nuts because I know it's just a few lines of simple code but can't get it going.

Reply to
mkrnews

That's correct. But the modem starts out in command mode, so you only need to use +++ when you want to get out of data mode, e.g. to terminate the call with ATH.

So far as the serial interface is concerned, "voice mode" means that it won't attempt to negotiate the protocol after connection, or send or receive data.

If you're using it in voice mode, you just need to send it commands to configure it, dial the number, and wait for CONNECT. From there, you're dealing with the sound card until you want to terminate the call, at which point you need to send +++ then ATH0.

Can you communicate with the modem at all? E.g. can you send ATI0 and read the response?

If not, you need to be reading the VB.NET documentation rather than anything related to modems or the Hayes command set.

Are you reading the responses? AT commands will normally send OK (or another response) upon completion, and the modem may not accept further commands until the response has been read.

Reply to
Nobody

Here's the basic code I'm playing with (not written precisely) ---

Pause 1 second serialport.write "AT+FCLASS=8" & controlchars.cr 'puts modem in voice mode

Pause 1 second serialport.write "AT+VLS=0" & controlchars.cr 'only VLS=0 will let the modem dial out !

Pause 1 second serialport.write "AT+VTX" & controlchars.cr 'transmits audio

Pause 1 second serialport.write "ATDT1332456-7765" & controlchars.cr 'dials number and my phone will ring Pause 1 second serialport.read (sends the read buffer to a textbox)

Start > My.Computer.audio.play (plays a wav file in a loop)

I'm using a new internal modem and have the onboard audio chosen in sounds setup. Have a jumper cable from the SPKR output on the soundcard (there is no "line output"), into the MIC input on the modem.

(I've also tried all sorts of other configurations). EVERYTHING.

In the textbox I get an OK on everything but when I pick up --- NO audio (and I know the audio is there).

Now -- here is one strange problem I need to look at today.....

When I try to change the VLS number to anything but 0, the modem will not dial out. (a clue?) Actually, I think I need VLS=2 or VLS=6 or something.

(AND, if I comment out the modem ATDT dialout, I CAN get all VLS numbers (except 3) without an error). ?

Remember, I'm NOT talking to another modem. I will be calling a telephone every time I use this.

Setup modem, dial out, (hopefully know when the call is answered somehow), play audio for 30 seconds, then hang up.

Any help is appreciated.

Reply to
mkr5000

Can you communicate with the modem at all? E.g. can you send ATI0 and read the response?

as in eye-oh?

I get an error if I......

"AT+IO" & controlchars.cr

If I leave out the +

ATI0 then I get an OK.

Reply to
mkr5000

On a sunny day (Tue, 3 Feb 2009 07:01:18 -0800 (PST)) it happened mkr5000 wrote in :

US Robotics modem has a mike level control it may be at zero, see bottom of the list of commands. This is from the Linux program 'speaker', I have used it for phone conferencing, also played with it once, trying to wite my own, as it no longer compiled on a new Linux version IIRC. I used the 'Bullet' voice modem (still have it).

I strongly suggest you get the Linux application 'speaker', and look at the source code: ftp://sunsite.unc.edu/pub/Linux/apps/serialcomm/modem/speaker-1.0.1.tar.gz

This is from that archive, PLEASE respect the GPL, so if you release it in a new form, then you will have to release source code too.

So, if I help you more I could as well write it...

COMMAND SPEAKER_ON AT&F1 OK|VCON # Use factory settings AT#CLS=8 OK|VCON # Voice mode AT#VRN=0 OK|VCON # No ringback timer AT#VLS=6 OK|VCON # Set speakerphone mode AT#VBT=1 OK|VCON # Set tone length #AT#VGR=128 OK|VCON # US Robotics specific speaker volume command #AT#VGT=128 OK|VCON # US Robotics specific microfone volume command ATA OK|VCON # Finally, pick up the line END_COMMAND

COMMAND SPEAKER_OFF ATH OK|VCON # Just hangup ATZ OK|VCON # Reset modem END_COMMAND

COMMAND DIAL AT#VTS= OK|VCON # Dial command END_COMMAND

COMMAND SPEAKER_VOLUME AT#VGR= OK|VCON # US Robotics specific speaker volume command #AT#SPK=,%d, OK|VCON # Use this if you have Rockwell-based modem END_COMMAND

COMMAND MIKE_VOLUME AT#VGT= OK|VCON # US Robotics specific microphone volume command #AT#SPK=,, OK|VCON # Use this if you have Rockwell-based modem END_COMMAND

Reply to
Jan Panteltje

Morning stupidity --

  • or # are for voice commands

But anyway, yeah I can talk to it.....just wish I could get this project solved.

Reply to
mkr5000

I wish to be sure about what you are asking us for. You wish us to help you build a "computer telephone machine" that calls us in the middle of our meals, sleep times, and other times while we live our private lives, and pester us with unwanted voice messages, selling some odd point of view or crappy merchandise? It is actually illegal to do that in the USA.

Where in the pluperfect hell do you get off asking us to design for you a machine to introduce hateful nuisances into our lives?

Reply to
JosephKK

There are legitimate uses for such things, e.g. where the receiver specifically wants to receive such messages ("hi, this is your burglar alarm; someone is breaking into your house"), or will probably consider it reasonable ("hi, this is FEMA, you're about to get hit by a tornado"), or if the call isn't automated but e.g. a text-phone for the speech impaired.

Reply to
Nobody

I wish to be sure about what you are asking us for. You wish us to help you build a "computer telephone machine" that calls us in the middle of our meals, sleep times, and other times while we live our private lives, and pester us with unwanted voice messages, selling some odd point of view or crappy merchandise? It is actually illegal to do that in the USA.

My project has NOTHING to do with the public.

Why would you assume it does?

Besides, it's really none of your beeswax anyway -- I'm here (like everyone else) for electronics problems.

Who died and made you the supervisor?

"Nobody", the above poster, pretty much hit the nail on the head as far as my intent.

PS --- Don't ever use the word "machine" when you're discussing electronics. It's a contradiction.

Reply to
mkr5000

Oh.....and I forgot to add.....

"you're an idiot"

Reply to
mkr5000

Did you read OP's stated purpose for the machine??? It is there in the thread.

Reply to
JosephKK

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.