Solved

Sick of being asked about .wav files and modems?

Posted on 2004-03-24
7
899 Views
Last Modified: 2013-12-27
(There is a question here, please bear with me.)

After hours of searching online, there seems to be a consensus that you CAN dial a telephone number from your computer, play a .wav file, and have the person on the receiving end hear it -- and there appears to be two methods to do this:

a)  Software Solution.
Programs like Extra Dialer Pro, CallPad, pc-to-phone, and NetMeeting do it.  The modem needs to be a voice modem.  The programs get the modem to recognize the .wav format, then convert it into the modem's own file type in order to play it over the (analog) telephone lines.

b)  Hardware Solution.
Involves hooking the output of the computer speaker to the microphone of the phone, through an isolated circuit (since telephone regulations forbid loafing the power from the lines, and also if the telephone rings, that voltage will fry the sound card).  I found an "isolated telephone interface" on Google that will probably do it.

*********
So, what do I need to know?

I want the software solution, but dumbed down -- the basic AT commands and the order in which they should be written.
*********

Just so you know where I'm coming from, I've included the following:

I'm using Tcl (Tool Control Language) as a GUI to connect to the modem and convert this file and play it.  I don't want to have to call a program to do it for me, although it would be nice to interface with something like Extra Dialer Pro, considering it does exactly what I want (and also it's free!).

This is what I have so far, based on another guy in here who said you can set the FCLASS=8 for voice, then call the number, then have VLS=3 for setting the "output to your speaker and your input to your mic."

set serial [open com4: r+]
fconfigure $serial -mode "9600,n,8,1"
fconfigure $serial -blocking 0 -buffering none
puts -nonewline $serial "AT+FCLASS=8;\r"
after 100
puts -nonewline $serial "ATDT 9, (555) 555-5555; \r"
after 100
puts -nonewline $serial "AT+VLS=3;\r"
# play message to machine
PlaySound $serial


When I go to dial the number, it says NO CARRIER.  (Tcl people: Should fconfigure have -translation? -encoding?)  Another person on here in another question suggested using vgetty, but that looks like it only works with Linux -- I want a Windows-friendly solution (2k,XP).  I've also looked at TAPI but that confuses me even more.  Surely there is a simple procedure??

I just want a straight answer.  Please.
0
Comment
Question by:wheezle
  • 4
  • 3
7 Comments
 
LVL 6

Expert Comment

by:HippyWarlock
ID: 10671298
A few pointers - be carefull how you dish out modem AT commands, they can sometimes vary from the Hayes AT standard and towards a manufacturers hybrid AT.

set serial [open com4: r+]
fconfigure $serial -mode "9600,n,8,1"
fconfigure $serial -blocking 0 -buffering none

I assume you checked it is actually on enumerated port 4? Are you sure you don't wanna up yer baud rate here?

puts -nonewline $serial "AT+FCLASS=8;\r"
after 100
puts -nonewline $serial "ATDT 9, (555) 555-5555; \r"
after 100
puts -nonewline $serial "AT+VLS=3;\r"  is this '\r' a result of your language?

Can't verify the AT commands as you havent said what modem you will use (see my comments  above?

Maybe you'd be best gettin a modem and seeing what it does to connect from the  its output to the logfile and the contents of it's registers?

# play message to machine
PlaySound $serial


Sorry for not being constructive  
0
 
LVL 6

Expert Comment

by:HippyWarlock
ID: 10671640
>A few pointers - be carefull how you dish out modem AT commands, they can >sometimes vary from the Hayes AT standard and towards a manufacturers hybrid AT.

I withdraw that comment.... mostly

0
 

Author Comment

by:wheezle
ID: 10672074
Thanks for posting, HippyWarlock,

I know AT commands are specific to different modems, but I'll be using this on a couple computers with different modems.  Right now it's my pc, I think I have a no-name or a USR or something, and the other would be on a Compaq laptop.  I want it to work on one of them, I'll just have to worry about translating it to the other later.  (So for now say the laptop takes precedence.)

Let's put it this way:  If I get rid of the AT+FCLASS=8;\r  and AT+VLS=3;\r  commands (where \r signifies a carriage return), and the call number command is the only one left of the three, it calls the number no problem.  But you won't hear anything on the telephone because it's expecting something in binary or whatever.  Com4 is the right port.  Baud rate I have no idea, I was just using someone's example -- should I bump this up?  To what?

I'm looking for pseudocode, I guess.  But with examples.

Thanks again.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Accepted Solution

by:
HippyWarlock earned 230 total points
ID: 10672139
ok here's the nuts and bolts you'll need - and a few quiet nights in :-)

In AT command operating environment, the modem has four functional states:

1 The command state,
2 The wait-for-carrier state,
3 The on-line state, and
4 The on-line command state.

In the command state, the modem accepts AT commands form the terminal, allowing you to configure the modem and dial telephone numbers. When the modem is powered on, it defaults to the command state.

After modem dials a number, it enters a transition state, called the wait-for carrier state and waits for a carrier signal from the remote modem. If the modem does not detect a carrier signal within a preset time period (this period is defined by the value of S7 register), it abandons the call and re-enters the command state. You can also cause the modem to exit the wait-for-carrier state and return to the command state by pressing any key on the keyboard, causing a dial abort action.

If modem detects a valid carrier signal, it connects with the remote modem, according to the best negotiation speed decided by both modems, and enters the on-line state. In this case, the modem transmits data asynchronously. If the carrier signal is lost or intentionally dropped the connection, the modem hangs up and re-enters the command state.

While the modem is on line, you can temporarily exit the on-line state, and enter the on-line command state, from which limit set of AT commands can be entered to interrogate the modem current settings and make sure the connection is what is supposed to be and to disconnect the line gracefully.


To enter the on-line command state, wait 1 second, type +++, wait another 1 second, and type AT, carriage return (this procedure is called Time Independent Escape Sequence, TIES). The first valid AT commands entered while the modem in the on-line command state will be executed just as they would be executed in the command state. If the first command is Invalid in this state, it will cause modem be to on-line state and you will have on-line connect message shown on the screen.

After the first command is accepted and in the on-line command state, the rest AT commands will accepted with OK or rejected with ERROR and stay in this state until

1. You issue ATO command to re-enter the on-line state,
2. You issue ATH to drop the connection and back to command state,
3. Connection is disconnected and the modem go back to command,
4. Application program request modem to disconnect and go back to command state.

This is just the voice command set:

#BDR Baud Rate Selection
#BDR? Returns the current setting of the #BDR
#BDR=? Shows available settings
#BDR=0* Enable auto baud detection
#BDR=n Where n = 1,2,4,6,8,16,24. Sends OK message and switches to the new speed defined by n*2400 bps.

#CLS Data, Fax or Voice Mode Selection
#CLS? Returns the current setting of the #CLS
#CLS=? Shows available settings

#CLS=0* Selects data mode operation
#CLS=8 Selects voice mode operation

#SPK=m,n,o Speaker Phone Control
m=0 speaker phone mode
m=1 microphone modem
n,o dummy parameters

#TL=XXXX Voice Playback Volume Control
#TL=0 mute, means no volume
#TL=1 -24db, low volume
#TL=2 -18db
#TL=3 -12db
#TL=4 -6db
#TL=5* -0db
#TL=6 +6db
#TL=7 +12db
#TL=8 +18db, high volume

#VBQ? Query Buffer Size (Response 20)

#VBS Bits Per Sample Selection
#VBS? Returns the current setting of #VBS
#VBS=? Shows available settings
#VBS=2 Selects 2 bits per sample ADPCM
#VBS=3 Selects 3 bits per sample ADPCM
#VBS=4* Selects 4 bits per sample ADPCM

#VBT Beep Tone Timer
#VBT? Returns the current setting of the #VBT command
#VBT=? Shows available settings
#VBT=0 Disables the tone generation capability
#VBT=n Sets tone duration time in 100 msec. Where n = 1-40. Default is 10.

#VCI? Request Compression Method Information

#VLS Voice Line Selection
#VLS? Returns the current setting of the #VLS
#VLS=? Shows available settings
#VLS=0* This command causes the telephone line interface to be routed through the modem.

#VLS=1 This command causes the handset to be routed through the modem.
#VLS=2 This command routes the speaker through the modem.
#VLS=3 This command routes the auxiliary input device through the modem.
#VLS=4 This command is the same as #VLS=0, except the modem enables the internal speaker.
#VLS=5 This command enables the microphone and speaker interface, use for speaker phone mode.
#VLS=6 This command enables the microphone and speaker interface, use for speaker phone mode.

#VRX Set Voice Receive Mode
This action command is only valid if the modem is in the on-line voice command mode.

#VSP Set Silence detection Period ( 0 - 255)
#VSP? Returns the current settings
#VSP=? Shows available settings
#VSP=n Where n defines the period without received voice data in 100 ms units

#VSS Silence Detection Enable/Disable
#VSS? Returns the current settings
#VSS=? Shows available settings
#VSS=0 Disable silence detection
#VSS=1 Set silence detection to lease sensitive setting
#VSS=2 Set silence detection to midrange sensitive setting
#VSS=1 Set silence detection to most sensitive setting

#VTS Play DTMF/Tone String
#VTS=m,n,o Send Beep Tone for 1 sec
m,n,o are dummy parameters
#VTS=p,q Send DTMF ' for '*100ms
where p ranges from 0 to 9, or from A to F, q ranges from 0 to 255.

#VTX Set Voice Transmit Mode
This action command is only valid if the modem is in the on-line voice command mode.

#VRA Ring Back Goes Away Timer
#VRA? Returns the current setting

#VRN Ring Back Never Came Timer
#VRN? Returns the current setting

#VSD Silence Detection Enable/Disable
#VSD? Returns the current setting

#VSK Buffer Skid Setting
#VSK? Returns the current setting

#VSR Sampling Rate Selection
#VSR? Returns the current setting

#VTD DTMF Tone Report Capability
#VTD? Returns the current setting

Voice mode Result codes

OK Command valid and executed successfully

ERROR Command error and can not be executed

VCON Issued in Voice mode (#CLS=8) when the modem determines that the remote modem or handset has gone off-hook, or when returning to on-line voice command mode.

NO ANSWER Issued in Voice mode (#CLS=8) when the modem determines that the remote modem has not picked up the line after the S7 timer has expired.

CONNECT When Voice transmission by DTE can begin

Voice mode Shielded codes

0-9 DTMF digits 0 through 9
*,# DTMF digits *, #
A-D DTMF A through D
a Answer Tone detected, V.35/T30 2100Hz answer tone is detected
b Busy, the busy cadence is detected
c Calling Tone, T.30 1100Hz Calling tone is detected.
d Dial Tone, the Dial tone is detected
e European Calling Tone, V.25 1300Hz Calling Tone is detected
f Bell Answer Tone, Bell 2225Hz Answer tone is detected

ENJOY
0
 

Author Comment

by:wheezle
ID: 10682318
Wow that's a lot of info, thanks!  :)

Okay, from I got from this command set, can someone tell me if I'm missing something from the following order of operations?  Will this work??

- open the port
- call number and wait for a connection (as before)
- enter the online command state (+++)
- change to the voice mode operation (CLS=8)
- route the speaker through the modem (VLS=2)
      (should this be 5 or 6 instead?? where is the speaker phone -- telephone, modem or other?)
- set to voice transmit mode (VTX)
- play the file
- return to whatever state, either online (ATO) or command (ATH)
- close the port etc. etc.


(It would be nice to add the VSS=2 and VSP=20, but I could also just make my program wait...)


Any thoughts??
0
 
LVL 6

Expert Comment

by:HippyWarlock
ID: 10736816
Sorry, I'm a bit bogged down at the mo, and I remember the nightmare I had doing what your attempting.

Look here for more help - again sorry I can't do more but that's the fun of coding :-/ Sorting it out for yourself

Later
0
 

Author Comment

by:wheezle
ID: 10837066
No prob, I understand it's a huge undertaking.  I decided instead to implement this all with a hardware solution (isolated with a transformer, don't worry) where I hooked it up to the headphone jack, but I'm still really interested in a software solution.

I'm sure one of these days someone will post a good solution.  It's a hot topic.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you’re like me and you like peace and quiet, saving money, and pretty lights, then this article is for you. For financial reasons, I buy all the Cisco equipment for my home lab second-hand. The first thing to wear out is usually one of the coo…
When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now