-
sending phone key tones after connecting using mscomm32.ocx
hi all
I have created a phone connection using mscomm32.ocx and AT hayes commands.
so the phone dials, the recepient picks up, that's where it starts... How do I send further subsequent dial tones through the line while the line is connected?
i have tried
MSComm1.Output = "ATDT" & tone & ";" & VbCr
but to no avail...
this same command generates tones before dialing and as the phone is being dialed, but not after the connection has been established.
Am I barking up the wrong tree here? How am I able to send tones down the line?
Thanks!
-
Re: sending phone key tones after connecting using mscomm32.ocx
For some possible background, have a look here:
http://www.vbforums.com/showthread.php?t=325457
(And, this tread reference the one above)
http://www.vbforums.com/showthread.php?t=336074
:)
-
Re: sending phone key tones after connecting using mscomm32.ocx
thanks for that!
so it looks like I cant use AT commands to send further tones down the line? I have to hardwire a speaker into the handset speaker? the handset IS connected to the modem...
:confused:
-
Re: sending phone key tones after connecting using mscomm32.ocx
Go into sound properties, and set the playback to the modem. That should take care of it for you. Nothing else required.
-
Re: sending phone key tones after connecting using mscomm32.ocx
yes thanks for those links, they'll come in handy when I need to test the incoming tones for quality..
Yes I did try changin the sound output device to the modem, but What I get is an error message saying that the sound card is in use when I try to play a sound... does the sound through the modem need to played at a certain frequency? 8khz? or is the sound data converted to a different format to be able to be sent through the modem?
-
Re: sending phone key tones after connecting using mscomm32.ocx
Not sure about that. I can play two sounds at once out of my sound card, one just overlays the other. Maybe you have to reboot your computer for the effect to work? Hmm. I just tried it and didn't get any error.
I clicked apply and it worked fine. When are you getting an error?
-
Re: sending phone key tones after connecting using mscomm32.ocx
well I get the error when I try to play the sound from the audio properties dialouge in the control panel.. so i go to the tab where I'm able to change the output device to the modem, then I click Apply, go to the tab that contains default sounds for windows alerts.. I click on one of them and the play button and the error comes up.. I guess the sound is not being directed to the soundcard anymore yet it says that it cannot be played because the soundcard is in use.. I've even uninstaled the soundcard alltogether.. same thing...
maybe it has to do with the modem that I'm using... it's only able to accept certain types of sounds? from a certain type of player? (not windows media player)? I'm using NetComm Roadster v.90 external modem... I've looked around the netcomm website for any help.. none there...
*sigh*
-
Re: sending phone key tones after connecting using mscomm32.ocx
Hmm. I get the same error. I wonder if you have to restart Windows so that the sound card isn't in use? Just grasping at straws, here. I wonder if the modem can only play touchtones?
-
Re: sending phone key tones after connecting using mscomm32.ocx
yeh it's weird huh?
I've restarted the windows to no avail...
It's also weird because the modem has microphone and speaker jacks and there are audio device drivers installed into windows with the modem drivers and you're able to choose from those... but they just plain dont work... I get a feeling it's got to do with the sound format... if the format is not correct it automatically tries to divert the sound to the sound card, which is not selected, causing the error...
I wander if there is a different sound format that modems can play back...
*clutches another straw*
-
Re: sending phone key tones after connecting using mscomm32.ocx
Send a PM to CVMichael. He might be able to shed some light on this one.
Include a link to this thread. He did some touch tone stuff a few weeks ago, it's in the CodeBank.
-
Re: sending phone key tones after connecting using mscomm32.ocx
cool thanks i've PMd him,
and the software I've downloaded.. it's in one of the links that bruce fox posted above..
:wave:
-
1 Attachment(s)
Re: sending phone key tones after connecting using mscomm32.ocx
OK, first things first, see if you have something like this in your sound properties
See if you have a modem line ?
-
Re: sending phone key tones after connecting using mscomm32.ocx
We do. We select the modem, and then try to play a sound, which generates an error. How/when can you output sound to the modem? The message displayed is "Soundcard in use".
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
so it looks like I cant use AT commands to send further tones down the line?
is the modem actually communicating with another modem? or is some voicesystem or person on the other end.
If the later then you can send tones after dialing a number.
It's been a long time since I've done this stuff, but I think you need to set a register on the modem to tell it that it is dialing only and not connecting to another modem.
If a connection is estsblished and you want to interrupt it then send the escape sequence which is usually "+++"
-
Re: sending phone key tones after connecting using mscomm32.ocx
I've never done this before, but I think you have to send an AT command to enable the sound first.
Let me look on the web to see what commands have to be sent to the modem.
-
Re: sending phone key tones after connecting using mscomm32.ocx
I can't find the links I used to have, I have the bookmarks at home, now i'm at work.
Anyways, this is what I found:
http://www.eicon.com/support/helpweb...and/atlist.htm
Scroll all the way to the bottom of the page, and check out the command: #VTS
-
Re: sending phone key tones after connecting using mscomm32.ocx
thanks for that!
yes I am connected using a voice connection and all i need to do is send dtmf tones trough
so I use ATDT to dial and the other person picks up
I then need to send
AT&VTS=
command with a number after the = as I understand.. but it does not seem to work even after a few different combinations like
Comm.Output = "AT&VTS=2" & vbCr
Comm.Output = "AT#VTS=2" & vbCr
Comm.Output = "AT+VTS=2" & vbCr
it's bizarre I cant get these to send a tone even though I should be able to...
am I doing anthing wrong here that anyone can spot?
thanks for all your help so far btw.
mp
-
Re: sending phone key tones after connecting using mscomm32.ocx
That commad is for voice, so you have to enable voice first...
But I don't know the commands yet... i'll look through my bookmarks in a few minutes... hopefully I'll find the link i'm looking for
-
Re: sending phone key tones after connecting using mscomm32.ocx
OK, Here it is:
http://vocpsystem.com/install_modems.php?mode=function
To bad I don't have a voice modem at home to test all this... but i plan to buy a voice modem this week-end, I want to make my own ansering machine with it :)
First give this command: AT+FCLASS=8 to enable voice
then give this command to list the sound capabilities: AT+VSM=?
Then from that list choose (usually the best) sound mode.
Also, other links I found on modem commands:
http://www.zoltrix.com/PUBLIC/MODEM/...al/ATHSP56.HTM
http://www.uktsupport.co.uk/reference/modem.htm
-
Re: sending phone key tones after connecting using mscomm32.ocx
I always use an ATZ to initialize the modem. That's why I thought that it would work. Having the SOUND CARD IN USE threw me, though.
Enable VOICE worked, but the next line threw an error.
-
Re: sending phone key tones after connecting using mscomm32.ocx
How about if you enable voice, then try to play music (or whatever) on the modem ?
-
Re: sending phone key tones after connecting using mscomm32.ocx
Tried setting modem to fclass=8 (ok) then with soundcard set to modem, dialed my cellphone (from hyperterminal). Answered it, and while it was off-hook, went to sounds, and tried to play the first sound there (asterisk).
Same error "Sound Card in Use"
then i did an ATH to hang-up.
Something is clearly missing. If I dial a number with the Windows Dialer, you can click the buttons to emit sounds. You don't have to set the output to the modem.
-
Re: sending phone key tones after connecting using mscomm32.ocx
I don't know... i'm lost.. I need a voice modem to test...
-
Re: sending phone key tones after connecting using mscomm32.ocx
No problem. I know that it can be done, but thought setting the sound card was all that was required. Never had any reason to test it. Report back when you find something out, and it will be memorialized on the forums!
-
Re: sending phone key tones after connecting using mscomm32.ocx
cool thansk for that AT command set. it's weird though because i can set the at+FCLASS=8 (ok) then the AT+VSM returns the active profile and stored profile tables... same for AT+VTS
I know that this is a voice modem, so hmmm
as for the soundcard issue -"sound card in use" - i'm still getting that too..
:D
-
Re: sending phone key tones after connecting using mscomm32.ocx
very odd. I just tried to play a song in media player, and hear nothing!.
I hear sounds in trillian, and playing asterisk, but nothing in media player.
I think i'm going to reboot.
Still happened. Found the MUTE button. I don't know how that happened, though. :eek:
All is good again.
-
Re: sending phone key tones after connecting using mscomm32.ocx
wow - bizarro
as for me, mild victory!
i am able to send tones down the line using:
atdt9058723458 to dial the number , wait for it to pick up
OK
at+fclass=8
OK
at+vts=4 -----------I HEAR A BLEEP!!!! :party:
OK
now trying to do the same in VB seems to yeld no result... any ideas why?
this of course after atdt connecton established and the phone picks up
VB Code:
If Comm.PortOpen = True Then Comm.PortOpen = False
DoEvents
Comm.InputLen = 0
Comm.PortOpen = True
Comm.Output = "AT+FCLASS=8" & vbCr
Do
' Read the latest data from the serial port.
DoEvents
results = results & Comm.Input
num_tries = num_tries + 1
If num_tries > MAX_TRIES Then
MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
Exit Do
End If
Loop Until InStr(results, "OK" & vbCrLf) > 0
'Comm.Output = "AT+VSM=?" & vbCr
'Comm.Output = "AT+VTS=" & args & "" & vbCr
Comm.Output = "AT+VTS=5" & vbCr
it seems that i'm mimicking the hyper terminal here... why is this not working?
thanks!
-
Re: sending phone key tones after connecting using mscomm32.ocx
Looks like you're closing the port.
-
Re: sending phone key tones after connecting using mscomm32.ocx
YAY!
you PEOPLE ROCK!!!!
i thought i had to close and open the port for each command send, but no :):):):)
happies!!!!
thanks vary much for your help here!
-
[RESOLVED] sending phone key tones after connecting using mscomm32.ocx
-
Re: sending phone key tones after connecting using mscomm32.ocx
Post the working code for future readers. I'll save it also.
You can edit out the number. Just make it xxx-xxx-xxxx or something. We'll get the picture. :)
-
Re: sending phone key tones after connecting using mscomm32.ocx
sure
VB Code:
Private Sub Form_Load()
wmp.Visible = False
Comm.CommPort = ReadWriteINI("GET", "COMM", "port")
Comm.Settings = "9600,N,8,1"
If Comm.PortOpen = True Then
Comm.Output = "ATH" & vbCr
Comm.PortOpen = False
End If
ShockwaveFlash1.Movie = App.Path & "\" & ReadWriteINI("GET", "SWF", "file")
If Comm.PortOpen = False Then Comm.PortOpen = True
DoEvents
End Sub
Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
Const MAX_TRIES = 10000
Dim results As String
Dim num_tries As Long
If command = "speeddial" Then
Comm.InputLen = 0
Comm.Output = "ATDT" & args & ";" & vbCr
ShockwaveFlash1.SetVariable "dialled", args
End If
If command = "dial" Then
Comm.InputLen = 0
Comm.Output = "AT+FCLASS=8" & vbCr
Do
' Read the latest data from the serial port.
DoEvents
results = results & Comm.Input
num_tries = num_tries + 1
If num_tries > MAX_TRIES Then
MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
Exit Do
End If
Loop Until InStr(results, "OK" & vbCrLf) > 0
'Comm.Output = "AT+VSM=?" & vbCr
Comm.Output = "AT+VTS=" & args & "" & vbCr
ShockwaveFlash1.SetVariable "dialled", args
End If
If command = "reload" Then
ShockwaveFlash1.Movie = App.Path & "\" & ReadWriteINI("GET", "SWF", "file") & "?random=" & Format(Now, "ttttt")
End If
If command = "hangup" Then
If Comm.PortOpen = True Then
Comm.Output = "ATH" & vbCr
Do
' Read the latest data from the serial port.
DoEvents
results = results & Comm.Input
num_tries = num_tries + 1
If num_tries > MAX_TRIES Then
MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
Exit Do
End If
Loop Until InStr(results, "OK" & vbCrLf) > 0
Comm.Output = "ATZ" & vbCr
End If
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Close the port on form unload
If Comm.PortOpen = True Then
Comm.Output = "ATZ" & vbCr
Comm.PortOpen = False
End If
End Sub
Private Sub MSComm_OnComm()
MsgBox Comm.CommEvent
Select Case Comm.CommEvent
' Handle each event or error by placing
' code below each case statement
' Errors
Case comEventBreak ' A Break was received.
Case comEventFrame ' Framing Error
Case comEventOverrun ' Data Lost.
Case comEventRxOver ' Receive buffer overflow.
Case comEventRxParity ' Parity Error.
Case comEventTxFull ' Transmit buffer full.
Case comEventDCB ' Unexpected error retrieving DCB]
' Events
Case comEvCD ' Change in the CD line.
Case comEvCTS ' Change in the CTS line.
Case comEvDSR ' Change in the DSR line.
Case comEvRing ' Change in the Ring Indicator.
Case comEvReceive ' Received RThreshold # of
' chars.
ShockwaveFlash1.SetVariable "dialerror", StrConv(MSComm1.Input, vbUnicode)
Case comEvSend ' There are SThreshold number of
' characters in the transmit
' buffer.
Case comEvEOF ' An EOF charater was found in
' the input stream
End Select
End Sub
please excuse the references to shockwave flash as I am doing this from an embedded flash activex
:)
-
Re: sending phone key tones after connecting using mscomm32.ocx
So what does that do ?
Does that enable voice, then you are able to send sound on the phone line ? or just beeps ?
-
Re: sending phone key tones after connecting using mscomm32.ocx
just beeps so far as per my original post request ;)
I'd like to add the ability to play a phone line quality sound via the output of the COM port as a part of windows ability to use a voice modem as a sound device.
so reduce the sound's quality to like 8khz and shove it down that gob!!
I still haven't resolved the issue with the windows error stated above.. sound card busy thing.. that might have something to do with the fact that I can't play a 'sound' throught the phone line..
-
Re: sending phone key tones after connecting using mscomm32.ocx
Theoretically it should be possible; it would not make sence if it's not possible.
I went today to a computer store to buy a voice modem, and the guy selling it did not even know if the modem they had it was voice modem. He wanted to sell it to me assuming it was a voice modem. And nothing about voice was written on the box. Stupid people....
Anyways....
I think when you initialyze the sound for playing or recording, I think it has to be the same (samples / sec & bits / sample) as the choice you make when you issue the command "AT+VTS=?".
As soon as I get a voice modem, I'll try to make a program that uses DirectXSound to initialize the sound with the modem (hopefully my theory is correct).
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
I think when you initialyze the sound for playing or recording, I think it has to be the same (samples / sec & bits / sample) as the choice you make when you issue the command "AT+VTS=?".
i think that's right also... If only i could play ANY sound to my modem without that stupid error! :(
-
Re: sending phone key tones after connecting using mscomm32.ocx
I figured it out !!
After the commands I previously listed, you have to give this command to start receiving sound: AT+VRX or this command to start transmitting: AT+VTX
So, for example for the modem I have (I just bought one), I have to give this commands:
AT+FCLASS=8
AT+VSM=0
AT+VRX ' this is to receive... I did not test for transmit yet...
The data comes/goes thgough the comm control, so you don't even need DirectXSound to play or record...
After the AT+VRX command I receive the "CONNECT" response, then i receive the sound data.
-
Re: sending phone key tones after connecting using mscomm32.ocx
killer!
that's really cool
thanks for that
*geeeeeeenuis* :)
-
Re: sending phone key tones after connecting using mscomm32.ocx
So, did it work for you ?
Were you able to play/record sounds on your modem ?
-
Re: sending phone key tones after connecting using mscomm32.ocx
I'll try it later tonight when cellphone calls are free.