Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command
Modem & AT Command Modem & AT Command
Modem & AT Command
Go Back  Xtreme Visual Basic Talk > > > Modem & AT Command

Thread Tools Display Modes
Old 05-14-2012, 08:38 PM
gr8_big_geek gr8_big_geek is offline
Join Date: Dec 2010
Posts: 2
Default Modem & AT Command

Alright all,

I'm needing some help. You know when you look at the same lines of code over and over your brain turns to mush? Yeah, that's what's happened to me. I'm sure this is all very simple but for some reason I am not seeing it.

My current project is being written in C# but I could easily convert the code to VB (I usually code with them both interchangeably). So, let's do a poorman's UML run down:

Create a program that allows one to place a telephone call to the computer. After X amount of rings the computer answers the call. The user can speak to the computer and input is received by the computer. This is so the user can utilize the computers voice recognition capabilities (but the computer must "listen" or hear the user on the other end of the phone).

Current Status:
Have been able to place and receive calls through use of current program. Program allows the user to speak to another user that is plugged into the computer (or in other words, the computer acts as a glorified telephone).

The computer receives the voice of the user through COM4 (which is the port utilized by the modem). What is needed is for the voice of the user to come into the computer via the "mic in" port.

My use and knowledge of AT commands is seriously lacking. I understand the following as described by various text manuals but nothing providing examples to answer the current vexation.

Voice/Audio Commands
#TL - Audio Output Transmit Level
#VBQ? - Query Buffer Size
#VBS - Bits Per Sample (Compression Factor)
#VBT - Beep Tone Timer
#VCI? - Identify Compression Method
#VGT - Set Playback Volume in the Command State
#VLS - Voice Line Select
#VRA - Ringback Goes Away Timer (Originate)
#VRN - Ringback Never Came Timer (Originate)
#VRX - Voice Receive
#VSD - Enable Silence Deletion (Voice Receive)
#VSK - Buffer Skid Setting
#VSP - Silence Detection Period (Voice Receive)
#VSR - Sampling Rate Selection
#VSS - Silence Detection Tuner (Voice Receive)
#VTD - DTMF Tone Reporting
#VTM - Enable Timing Mark Placement
#VTS - Generate Tone Signals (On Line Voice Command)
#VTX - Voice Transmit
#CLS - Select Data, Fax or Voice Mode

My code:
This is the small blip of code that allows the serial port (COM4) to authorize use of the modem

private void btnCALL_Click(object sender, System.EventArgs e)
            string PHONENUMBER = "ATD=" + this.textBox1.Text + "\r";
            file = File.Open("raw.txt", FileMode.Create);
            logfile = File.CreateText("log.txt");
            buffer = new byte[10 * 1024];
            modemPort = new SerialPort("COM4", 112500, Parity.None, 8, StopBits.One);
            modemPort.ReadTimeout = SerialPort.InfiniteTimeout;
            modemPort.DataReceived += new SerialDataReceivedEventHandler(modemPort_DataReceived);
Okay, before everyone freaks out, I understand that this syntax is C# but I could easily convert it to VB if needed. The point or focus of the matter is more about the AT command(s) and their proper usage. Once it could be established as to how they work properly the AT commands could be used the same for either VB or C#.

Granted, the thing I am attempting to do may not be possible but it is very probable. The computer has the ability to record someone calling in, yes? If that is the case then the computer has the ability to "listen" to incoming audio. I'm attempting to allow the computer to capture/monitor this audio much like it does with the "mic in".

Again, I've been playing around with these darn AT commands until my brain is mush. Please be gentle!

Any assistance would be very helpful.

Thank you all in advance!

Last edited by Flyguy; 05-15-2012 at 02:29 AM.
Reply With Quote
Old 05-15-2012, 04:23 AM
DrPunk's Avatar
DrPunkModem & AT Command DrPunk is offline
Senior Contributor

* Expert *
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403

I'm not sure this is possible with a modem as such.

We're talking about a voice band modem here, whose job it is to turn digital data into an audio signal (modulate) that can be passed down a telephone line and then converted back into the digital data (demodulate).

The point being that a voice talking to the modem cannot be demodulated. You would require something else to convert the voice into digital data to transfer over the modem for another modem to receive and then another process to convert the data back into the audio voice.

If I understand what you're after properly. Maybe I don't.
There are no computers in heaven!
Reply With Quote
Old 05-18-2012, 08:57 PM
lamy's Avatar
lamy lamy is offline
Junior Contributor
Join Date: Jan 2003
Location: under your bed
Posts: 347

you should check first if your modem supports those AT commands, i suggest getting a manual from the manufacturer, not all modems uses Hayes commands set, some has its own proprietary AT commands

also, some modems has a separate port for audio (on the device it self)

i noticed in your code that you don't check for the modems response, AT for example will respond with an OK, some AT commands needs to be initialized first before you can use it, better check the response, maybe its throwing an error
slow down when you need to hurry, stop when you need to move on,
look back when you need to forget, or you might slip and leave sanity
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
Modem & AT Command
Modem & AT Command
Modem & AT Command Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command
Modem & AT Command