Page 1 of 2 12 LastLast
Results 1 to 40 of 57

Thread: sending phone key tones after connecting using mscomm32.ocx

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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!

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    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


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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...

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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?

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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*

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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?

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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*

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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..


  12. #12
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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 ?
    Attached Images Attached Images  

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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".

  14. #14
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: sending phone key tones after connecting using mscomm32.ocx

    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 "+++"

  15. #15
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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.

  16. #16
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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

  18. #18
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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

  19. #19
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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

  20. #20
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.
    Last edited by dglienna; Oct 13th, 2005 at 09:08 PM.

  21. #21
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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 ?

  22. #22
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  23. #23
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: sending phone key tones after connecting using mscomm32.ocx

    I don't know... i'm lost.. I need a voice modem to test...

  24. #24
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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!

  25. #25

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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..


  26. #26
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

    All is good again.
    Last edited by dglienna; Oct 13th, 2005 at 10:57 PM.

  27. #27

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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!!!! arty:
    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:
    1. If Comm.PortOpen = True Then Comm.PortOpen = False
    2.       DoEvents
    3.       Comm.InputLen = 0
    4.       Comm.PortOpen = True
    5.       Comm.Output = "AT+FCLASS=8" & vbCr
    6.      Do
    7.         ' Read the latest data from the serial port.
    8.         DoEvents
    9.         results = results & Comm.Input
    10.         num_tries = num_tries + 1
    11.         If num_tries > MAX_TRIES Then
    12.             MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
    13.             Exit Do
    14.         End If
    15.     Loop Until InStr(results, "OK" & vbCrLf) > 0
    16.      
    17.       'Comm.Output = "AT+VSM=?" & vbCr
    18.       'Comm.Output = "AT+VTS=" & args & "" & vbCr
    19.       Comm.Output = "AT+VTS=5" & vbCr

    it seems that i'm mimicking the hyper terminal here... why is this not working?

    thanks!

  28. #28
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: sending phone key tones after connecting using mscomm32.ocx

    Looks like you're closing the port.

  29. #29

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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!

  30. #30

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    [RESOLVED] sending phone key tones after connecting using mscomm32.ocx

    marking as resolved

  31. #31
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  32. #32

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    Re: sending phone key tones after connecting using mscomm32.ocx

    sure

    VB Code:
    1. Private Sub Form_Load()
    2.     wmp.Visible = False
    3.  
    4.     Comm.CommPort = ReadWriteINI("GET", "COMM", "port")
    5.     Comm.Settings = "9600,N,8,1"
    6.  
    7. If Comm.PortOpen = True Then
    8.     Comm.Output = "ATH" & vbCr
    9.     Comm.PortOpen = False
    10. End If
    11.  
    12.     ShockwaveFlash1.Movie = App.Path & "\" & ReadWriteINI("GET", "SWF", "file")
    13.    
    14. If Comm.PortOpen = False Then Comm.PortOpen = True
    15. DoEvents
    16. End Sub
    17.  
    18. Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
    19. Const MAX_TRIES = 10000
    20. Dim results As String
    21. Dim num_tries As Long
    22.  
    23. If command = "speeddial" Then
    24.    
    25.     Comm.InputLen = 0
    26.     Comm.Output = "ATDT" & args & ";" & vbCr
    27.  
    28.     ShockwaveFlash1.SetVariable "dialled", args
    29.  
    30. End If
    31.    
    32.    
    33. If command = "dial" Then
    34.  
    35.       Comm.InputLen = 0
    36.       Comm.Output = "AT+FCLASS=8" & vbCr
    37.      Do
    38.         ' Read the latest data from the serial port.
    39.         DoEvents
    40.         results = results & Comm.Input
    41.         num_tries = num_tries + 1
    42.         If num_tries > MAX_TRIES Then
    43.             MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
    44.             Exit Do
    45.         End If
    46.       Loop Until InStr(results, "OK" & vbCrLf) > 0
    47.              
    48.       'Comm.Output = "AT+VSM=?" & vbCr
    49.       Comm.Output = "AT+VTS=" & args & "" & vbCr
    50.  
    51.       ShockwaveFlash1.SetVariable "dialled", args
    52. End If
    53.    
    54. If command = "reload" Then
    55.  ShockwaveFlash1.Movie = App.Path & "\" & ReadWriteINI("GET", "SWF", "file") & "?random=" & Format(Now, "ttttt")
    56. End If
    57.  
    58. If command = "hangup" Then
    59.     If Comm.PortOpen = True Then
    60.       Comm.Output = "ATH" & vbCr
    61.            Do
    62.         ' Read the latest data from the serial port.
    63.         DoEvents
    64.         results = results & Comm.Input
    65.         num_tries = num_tries + 1
    66.         If num_tries > MAX_TRIES Then
    67.             MsgBox "Did not get OK response in " & MAX_TRIES & " tries"
    68.             Exit Do
    69.         End If
    70.     Loop Until InStr(results, "OK" & vbCrLf) > 0
    71.       Comm.Output = "ATZ" & vbCr
    72.  
    73.     End If
    74.    
    75. End If
    76.  
    77.  
    78. End Sub
    79.  
    80.  
    81. Private Sub Form_Unload(Cancel As Integer)
    82. ' Close the port on form unload
    83. If Comm.PortOpen = True Then
    84.     Comm.Output = "ATZ" & vbCr
    85.     Comm.PortOpen = False
    86. End If
    87.  
    88. End Sub
    89.  
    90. Private Sub MSComm_OnComm()
    91. MsgBox Comm.CommEvent
    92.  
    93.    Select Case Comm.CommEvent
    94.    ' Handle each event or error by placing
    95.    ' code below each case statement
    96.  
    97.    ' Errors
    98.       Case comEventBreak   ' A Break was received.
    99.       Case comEventFrame   ' Framing Error
    100.       Case comEventOverrun   ' Data Lost.
    101.       Case comEventRxOver   ' Receive buffer overflow.
    102.       Case comEventRxParity   ' Parity Error.
    103.       Case comEventTxFull   ' Transmit buffer full.
    104.       Case comEventDCB   ' Unexpected error retrieving DCB]
    105.  
    106.    ' Events
    107.       Case comEvCD   ' Change in the CD line.
    108.       Case comEvCTS   ' Change in the CTS line.
    109.       Case comEvDSR   ' Change in the DSR line.
    110.       Case comEvRing   ' Change in the Ring Indicator.
    111.       Case comEvReceive   ' Received RThreshold # of
    112.                         ' chars.
    113.                          ShockwaveFlash1.SetVariable "dialerror", StrConv(MSComm1.Input, vbUnicode)
    114.       Case comEvSend   ' There are SThreshold number of
    115.                      ' characters in the transmit
    116.                      ' buffer.
    117.       Case comEvEOF   ' An EOF charater was found in
    118.                      ' the input stream
    119.    End Select
    120. End Sub
    please excuse the references to shockwave flash as I am doing this from an embedded flash activex

    Last edited by mikepol; Oct 14th, 2005 at 12:19 AM.

  33. #33
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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 ?

  34. #34

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    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..

  35. #35
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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).

  36. #36

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    Re: sending phone key tones after connecting using mscomm32.ocx

    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!

  37. #37
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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.

  38. #38

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    69

    Re: sending phone key tones after connecting using mscomm32.ocx

    killer!

    that's really cool

    thanks for that

    *geeeeeeenuis*

  39. #39
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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 ?

  40. #40
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: sending phone key tones after connecting using mscomm32.ocx

    I'll try it later tonight when cellphone calls are free.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width