RE: Guide to going native. Pure AT.
- From: John_Mac <JohnMac@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 20:17:01 -0800
Nathan....
I sent this to Erakis who is also trying direct AT commands, but wanted you
to see it as well...
I see several people (including myself) are trying to go directly to the
modem to call and play a WAV file.
I followed Erakis' outline and wrote the following code. I get clicking on
the
phone, rather than the greeting....so was wondering if I did it right. Can
you look at this and see how it differs from your working code? It's in
VB.NET but it should be pretty obvious what i am doing. I'm mostl wondering
if I am sending the WAV file data correctly to the Comport (I'm using an
external voice modem connected to the serial port). I read in the WAV file,
then write it to the serial port skipping the 33 bytes of header with an 8000
byte buffer using 16 bits and 7 khz sampling rate (how the file was
written)...according to the modem documentation it supports 16 bit 8 khz.
Dim Port As IO.Ports.SerialPort
' voice modem is on serial port....internal modem is on COM3
Dim Comport As String = "COM1"
Dim modemPort As New SerialPort(Comport, 9600)
' set buffer size
modemPort.WriteBufferSize = 8000
Dim fileByte as Byte = My.Computer.FileSystem.ReadAllBytes ("greeting.wav")
' initialize modem
modemPort.Write("ATZ" & vbCrLf)
' enable DTR
modemPort.DtrEnable = True
' Voice mode
modemPort.Write("AT+FCLASS=8" & vbCrLf)
' txtPhone.text has the phone number to call
modemPort.Write("ATDT" & txtPhone.Text & vbCrLf)
' 16 bit 8 khz PCM
modemPort.Write("AT+VSM=129,8000" & vbCrLf)
' disable silence detection
modemPort.Write("AT+VSD=128,0" & vbCrLf)
' hardware flo control
modemPort.Write("AT+FLO=2" & vbCrLf)
' enter voice transmit data state
modemPort.Write("AT+VTX" & vbCrLf)
'now send the data
'need to strip off first 44 byte header from wave file that
was read in
'set buffer size to 8000
modemPort.Write(fileByte, 44, fileByte.Length - 44)
' hang up
modemPort.Write("ATH" & vbCrLf)
Thanx in advance.
John
"Nathan" wrote:
I'm a dotnet character and was working on TAPI 3.1 and everything is fine,.
but I would like to break it all down to the AT commands.
I don't expect it would be all that difficult for the main stuff, but for
VOICEANSWER, STARTRECORD, I am not exactly sure what data I am receiving and
if there is anything that needs to be done with it.
I've gone into the registry to see the Command Categories and associated AT
commands. I've also found the inf that contains this same info.
What has me intrigued is the WaveDriver category in the registry and am
thinking that I might not be able to run the StartRecord at commands and
capture all the data, plop it into a file and call it a .wav file.
Is there any guidance out there that can point me in the right direction?
Thanks,
Nathan
- Follow-Ups:
- Re: Guide to going native. Pure AT.
- From: Angus
- Re: Guide to going native. Pure AT.
- Prev by Date: RE: How to use TAPI3 with .NET SerialPort
- Next by Date: Re: Determine telephone number with TAPI 3.0?
- Previous by thread: RE: How to use TAPI3 with .NET SerialPort
- Next by thread: Re: Guide to going native. Pure AT.
- Index(es):
Relevant Pages
|