-
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.
-
Re: sending phone key tones after connecting using mscomm32.ocx
Can the same be done with an ADSL Modem?
-
Re: sending phone key tones after connecting using mscomm32.ocx
I don't think it is a voice modem, nor does it support the AT command set.
This is only for analog modems.
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
Originally Posted by dglienna
I don't think it is a voice modem, nor does it support the AT command set.
This is only for analog modems.
G'Day David,
Your right, I didn't think the question tru long enough (doh!).
-
Re: sending phone key tones after connecting using mscomm32.ocx
The second command ERROR'd, I dialed the number, typed AT+VTX, got the CONNECT, and tried to send Asterisk.wav
Quote:
AT+FCLASS=8
AT+VSM=0
AT+VRX ' this is to receive... I did not test for transmit yet...
Same error. Sound Card in Use.
I was able to press keys on my cellphone and see the numbers in HyperTerminal, though. Didn't know I could do that. :)
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
Originally Posted by dglienna
Same error. Sound Card in Use.
The sound you get is as data, through the comm port. So if you do this with HyperTerminal, then you get the sound in the HyperTerminal.
Just type those commands in the HyperTerminal, type the AT+VRX command, so you receive sound (to visually see the data in the hyper terminal).
I'm just trying to figure out how to save that data as wav (maybe). And when I do figure it out how to read the sound, then I'll try playing the sound.
Remember, you don't use the sound card... you read/write on the comm port.
I don't know why you have the option in the sound properties, that part doesnot makes sence to me anymore.
Quote:
Originally Posted by dglienna
I was able to press keys on my cellphone and see the numbers in HyperTerminal, though. Didn't know I could do that. :)
That's pretty cool, I have to try that too...
-
Re: sending phone key tones after connecting using mscomm32.ocx
I was calling my cellphone from my laptop, hoping to hear the wave file in the cellphone. I thought selecting modem output would do it, but apparently not.
I wasn't trying to receive in Hyperterminal. (also had trouble hanging up. had to close HyperTerminal)
-
Re: sending phone key tones after connecting using mscomm32.ocx
Did you guys get it to work ?
Cuz I can't... and I blame it on the modem.
When I give the command AT+VSM=? I only get 4 options. And all of them seem to be encoded somehow.
When I try to play the recorded/saved sound from the modem, all I get is weird/distorted noises.
I don't have an option to record as plain wav !
I have to return the modem back, and buy a better one. This one sucks !
Edit And it's Half-Duplex ! besides that I have only 4 options for AT+VSM=? command !
-
Re: sending phone key tones after connecting using mscomm32.ocx
I only got as far as playing the dial tones using at+vts=<number>
as far as wav sounds go, I still get that error that the sound card is being used. haven't been able to get around it.. it's quite frustrating. . It coud be the modem, but I've tried a few different ones now with the same result.. I'm heading down the road of sticking a speaker in the headset's microphone and playing the sound down the line that way... but i'm sure there HAS to be a way to do it as it's meant ! :confused:
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
Originally Posted by mikepol
as far as wav sounds go, I still get that error that the sound card is being used.
Don't use the sound card !
After you issue the AT+VSM=# command, you read the sound from the COMM port, your not using the sound card at all....
Just give these commands in the HyperTerminal
AT+FCLASS=8
AT+VSM=0
AT+VRX
And you will see that right after the AT+VRX you will get a "CONNECT" message then you will see a LOT of "garbage" data, that's actually the sound that comes from the line...
-
Re: sending phone key tones after connecting using mscomm32.ocx
arrrrrr
you're right!
just tested it// works a treat!!!
*spins*
-
Re: sending phone key tones after connecting using mscomm32.ocx
For those of you who are still trying to get this to work (like me):
I found out that for some modems, there is an extra command you have to give to enable sound; it's AT+VLS
I bought a new modem (full-deplex, the old one was half-duplex), and for this modem, I have to give the following commands:
AT+FCLASS=8
AT+VLS=1 <- new command
AT+VSM=0
AT+VRX <- to receive sound
<- here, read the sound from the comm port
If you do: AT+VLS=?
You will get a list, kind of like the command AT+VSM=?, and you have to choose one from the list, for my modem 0 does not work... 1 works, and I did not try the others...
Now I can finally start programming on my own ansering machine !
-
Re: sending phone key tones after connecting using mscomm32.ocx
-
Re: sending phone key tones after connecting using mscomm32.ocx
Which modem did you buy?
I was thinking of getting one to build an answering machine too.
I long ago wrote some code to get the caller ID string and announce the caller over the PC speakers. I used an access database to store a phone book and lookup table for incoming calls.
Now I'd like to make seperate mailboxes and have different greetings for incoming calls depending on what the caller ID is.
Keep posting the code as you build it if you don't mind.
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
Originally Posted by moeur
Which modem did you buy?
AOpen FM56-PX 56K V.92 PCI Modem
http://img.ncix.com/images/8589-l.gif
Quote:
Originally Posted by moeur
Now I'd like to make seperate mailboxes and have different greetings for incoming calls depending on what the caller ID is.
Thanks for the idea :D
Quote:
Originally Posted by moeur
Keep posting the code as you build it if you don't mind.
Sure, in this thread ? I think we should make a new thread for that, what do you think ?
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
I think we should make a new thread for that, what do you think
if you do, post a link to it here :)
-
Re: sending phone key tones after connecting using mscomm32.ocx
Hello to you all,
Right now, I want to make a telephony software, and I tried almost everything that you all said, but with out anything working out.
I saw what CVMichael, and I really liked all his posts, but the problem is I can't get things to work.
Right now, my voice modem can call any mobile or land-line easily, but the problem is I can't hear the voice of the ringing on the SPEAKERs at all, I tried to change the output sound to Modem#0 Line PlayBack, but things didn't work out.
Here is my code:
Code:
MSComm1.Output = "AT+FCLASS=8" & vbCr
MSComm1.Output = "AT+VRX" & vbCr
MSComm1.Output = "AT+VTX" & vbCr
MSComm1.Output = "ATD0123686884" & vbCr
-
Re: sending phone key tones after connecting using mscomm32.ocx
Quote:
Originally Posted by mikepol
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:
This thread has progressed quite a bit since the post that's quoted above, so if what I'm going to say has been covered already then just ignore it. Anyway, In order to send audio down the Tel line (after the number has been dialed) you should be using the Semicolon AT command modifier. Using the semicolon instructs the modem to remain in Terminal Mode after dialing the number.
Code:
'Wait for dial tone & dial the number using DTMF. Stay in (;)Terminal Mode
MSCommSendAlarm.Output = "ATDTW" & txtNumToDial & ";" & Chr(13)