Results 1 to 29 of 29

Thread: [RESOLVED] MSComm Detect Phone Was Answered

  1. #1

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Resolved [RESOLVED] MSComm Detect Phone Was Answered

    Hey guys how would I go about dialing a number through my modem? I searched the forums and Google but only found ways to do it with the Window's stupid built in phone dialer. I need to dial to number, verify if it has been picked up or if the call has ended (or gone to voicemail)
    Last edited by Datacide; Jan 25th, 2006 at 09:51 PM.
    PHP in your FACE!

  2. #2
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Dialing a phone number

    I can't help you with the person picking up the phone. I Guess that you would have to read from the line. Have you tried Using MSCOMM? You can see if they have picked up or not using that. I don't know if there's a way to tell if it's gone to vioce mail. If you want to do it the manual way try this code...

    VB Code:
    1. PhoneNumber$ = "(123)456-7890"
    2. Open "COM3" For Output As #1   'or what ever your modem's COM port is.
    3. Print #1, "ATDT" & PhoneNumber$ & Chr$(13) 'Chr 13 is like 'Enter'
    4. Close #1

  3. #3

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    Well that didnt seem to work.

    I would like to use the MSComm control but can't find a comprehensive example. Can anyone explain the functions for it?
    PHP in your FACE!

  4. #4
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Dialing a phone number

    Hmm worked for me :s Did you put it on the right COM port?
    I have to get off now, but when i come back tommorow, if no one has solved it, i'll post how to use the MSCOMM.

  5. #5
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    Re: Dialing a phone number

    I found this code, maybe it'll help you


    VB Code:
    1. Private Sub CancelButton_Click()
    2.     CancelFlag = True
    3.     CancelButton.Enabled = False
    4. End Sub
    5.  
    6.  
    7. Private Sub Dial(Number$)
    8.     Dim DialString$, FromModem$, dummy
    9.     DialString$ = "ATDT" + Number$ + ";" + vbCr
    10.     MSComm1.CommPort = 2
    11.     MSComm1.Settings = "9600,N,8,1"
    12.     On Error Resume Next
    13.     MSComm1.PortOpen = True
    14.  
    15.  
    16.     If Err Then
    17.         MsgBox "COM2: Not available. Change the CommPort Property To another port."
    18.         Exit Sub
    19.     End If
    20.     MSComm1.InBufferCount = 0
    21.     MSComm1.Output = DialString$
    22.  
    23.  
    24.     Do
    25.         dummy = DoEvents()
    26.  
    27.  
    28.         If MSComm1.InBufferCount Then
    29.             FromModem$ = FromModem$ + MSComm1.Input
    30.  
    31.  
    32.             If InStr(FromModem$, "OK") Then
    33.                
    34.                 Beep
    35.                 MsgBox "Please pick up the phone and either press Enter or click OK"
    36.                 Exit Do
    37.             End If
    38.         End If
    39.         'got help from microsoft
    40.  
    41.  
    42.         If CancelFlag Then
    43.             CancelFlag = False
    44.             Exit Do
    45.         End If
    46.     Loop
    47.     MSComm1.Output = "ATH" + vbCr
    48.     MSComm1.PortOpen = False
    49. End Sub
    50.  
    51.  
    52. Private Sub DialButton_Click()
    53.     Dim Number$, Temp$
    54.     DialButton.Enabled = False
    55.     QuitButton.Enabled = False
    56.     CancelButton.Enabled = True
    57.     Number$ = InputBox$("Enter phone number:", Number$)
    58.     If Number$ = "" Then Exit Sub
    59.     Temp$ = Status
    60.     Status = "Dialing - " + Number$
    61.     Dial Number$
    62.     DialButton.Enabled = True
    63.     QuitButton.Enabled = True
    64.     CancelButton.Enabled = False
    65.     Status = Temp$
    66. End Sub
    67.  
    68.  
    69. Private Sub Form_Load()
    70.     MSComm1.InputLen = 0
    71. End Sub
    72.  
    73.  
    74. Private Sub MSComm1_OnComm()
    75. End Sub
    76.  
    77.  
    78. Private Sub QuitButton_Click()
    79.     End
    80. End Sub
    If this post has helped you please rate it by clicking the scales to the left of this post!

  6. #6

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    Hmm this isn't working either. Maybe it's just my modem
    Last edited by Datacide; Jan 15th, 2006 at 01:32 PM.
    PHP in your FACE!

  7. #7

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    Ok, how would I use TAPI?
    PHP in your FACE!

  8. #8
    Hyperactive Member Rattled_Cage's Avatar
    Join Date
    Dec 2005
    Posts
    315

    Re: Dialing a phone number

    try this this works nice and also used it before to phone my mobile to wake me up in the morning

    link

  9. #9

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    lol that worked the first time I ran it then my modem stopped working completely. Probably my fault. This is pefect though just gotta figger out what's wrong with my system. Thanx!
    Last edited by Datacide; Jan 15th, 2006 at 06:38 PM.
    PHP in your FACE!

  10. #10

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    Great code Rattled_Cage!

    Now, does anyone know how I can detect if the phone has be picked up? I know I can change the system sound input/output to the modem so how can I tell if the modem is picked up using the microphone?



    ..or better yet can the MSComm control detect if the phone has been answered?
    Last edited by Datacide; Jan 15th, 2006 at 06:06 PM.
    PHP in your FACE!

  11. #11

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Phone Dialing part Solved | Detect Phone Pickup

    Just wondering...

    When a phone is idle, it has 20 volts on the line.
    When it rings it jumps up to 48 volts then down 10 volts when answered.

    Is there any way to detect this, by like listening for 10 volts?
    PHP in your FACE!

  12. #12

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    [URGENT] MSComm Detect Phone Was Answered

    Uh yeah so anyone know who to detect if the party your calling picked up the phone?
    PHP in your FACE!

  13. #13
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: MSComm Detect Phone Was Answered

    This is a sample that came with VB. I tried it a while ago but i can't remember if it told you if the phone was picked up.
    Attached Files Attached Files

  14. #14
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: MSComm Detect Phone Was Answered

    Give CVMicheal a pm, he will help you if he has time

  15. #15

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    [URGENT] MSComm Detect Phone Was Answered

    This sucks I have less tha 2 hours to figure this out. I can get it to call no problem. There's gotta be a MSComm event to see if the phone is ringing/not ringing. Or at least is there a distiguisable sound (tone or click) when the person picks up the phone?

    Any suggestions would be ubelievably gratefully appreciated.
    PHP in your FACE!

  16. #16

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: MSComm Detect Phone Was Answered

    Ok I've now got a personal aspiration to solve this problem. Many hours of Googling only turns up hundreds of other people asking the same question. Turns out that there is no way at all to use the MSComm or modem to detect if the phone has been answered for voice calls. I think I may have found a solution though...

    Quote Originally Posted by Datacide
    Just wondering...

    When a phone is idle, it has 20 volts on the line.
    When it rings it jumps up to 48 volts then down 10 volts when answered.

    Is there any way to detect this, by like listening for 10 volts?
    Well there is a way somewhat, but it involes building a simple device that can be controlled with the MSComm control. Here's the link . Basically it's a serial volt-meter. I could use it measure the volts on the line. What are your thoughts on doing it this way?
    PHP in your FACE!

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

    Re: MSComm Detect Phone Was Answered

    Yes, what you discovered is right, you can't detect if phone is picked up with a modem or MSComm.

    But... I don't know how acceptable it might be for you: You can detect the phone rings, and when it stops ringing, you can assume the phone is ansered...

  18. #18

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: MSComm Detect Phone Was Answered

    Quote Originally Posted by CVMichael
    Yes, what you discovered is right, you can't detect if phone is picked up with a modem or MSComm.

    But... I don't know how acceptable it might be for you: You can detect the phone rings, and when it stops ringing, you can assume the phone is ansered...
    How? I though that was just for incomming calls?
    PHP in your FACE!

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

    Re: MSComm Detect Phone Was Answered

    Quote Originally Posted by Datacide
    How? I though that was just for incomming calls?
    Ow, yea, your right...

    Well, in that case, for outgoing calls, you can "listen" for the dialing numbers, and when they stop, assume the conversation started.

  20. #20

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: MSComm Detect Phone Was Answered

    That wont work. What about my idea for checking the voltage?
    PHP in your FACE!

  21. #21
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: MSComm Detect Phone Was Answered

    I was wondering how does the computer know when you dialup a connection that it has been established?

  22. #22

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: MSComm Detect Phone Was Answered

    Quote Originally Posted by Andrew G
    I was wondering how does the computer know when you dialup a connection that it has been established?
    Because the computer it calls plays a tone when it answers that calling computer listen for. Unfortunately voice lines don't play a tone when it is answered.
    PHP in your FACE!

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

    Re: MSComm Detect Phone Was Answered

    Quote Originally Posted by Datacide
    That wont work. What about my idea for checking the voltage?
    Yea, that will work for sure, but do you know how to build that device ? I know electronics, I would know how to build it... but that wouldn't help you
    Anyways, check out these 2 threads that are "kind of" related...
    Sound Recognition [ Solved ], VB - Tone Recognition. Maybe those threads will help you...

    Quote Originally Posted by Andrew G
    I was wondering how does the computer know when you dialup a connection that it has been established?
    Well, the modem is analog, so I assume the dialing modem sends some data (as sound), and the receiver replies when it undertands that message, kind of like a ping, when the sender received something from the receiver, then it knows it establised a connection.

  24. #24

    Thread Starter
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Dialing a phone number

    Quote Originally Posted by Datacide
    Does anyone know how I can detect if the phone has be picked up?
    Quote Originally Posted by Datacide
    Turns out that there is no way at all to use the MSComm or modem to detect if the phone has been answered for voice calls
    Appearently there is a way. I found that there is software to that can do this so I did a little more Googling and found some source code through Google Groups that does just that. Since this is very popular and requested alot, whoever wants the link can send me a PM. I'd post it here but it's very valuable and I'm sure you'd want to sell any software you make with this code. (I saw this kind of software selling for $300 - $700US )
    PHP in your FACE!

  25. #25
    New Member
    Join Date
    Aug 2007
    Posts
    1

    Re: [RESOLVED] MSComm Detect Phone Was Answered

    hi
    please give me the source

  26. #26
    New Member
    Join Date
    Apr 2008
    Posts
    1

    Re: [RESOLVED] MSComm Detect Phone Was Answered

    Hi Datacide!
    Could you please send me the link to detect phone pick up?
    Thank you.

  27. #27
    New Member
    Join Date
    Dec 2012
    Posts
    1

    Re: [RESOLVED] MSComm Detect Phone Was Answered

    Hi Datacide
    Can you please send me the link to detect phone pick up? and thank you in advanced

  28. #28
    New Member
    Join Date
    Mar 2015
    Posts
    1

    Re: [RESOLVED] MSComm Detect Phone Was Answered

    Hi,

    I realize this thread is several years old. But I need this code in the worst way. Please send link or code...thanks.

  29. #29
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: [RESOLVED] MSComm Detect Phone Was Answered

    Please don't repost in old threads like this. Apart from anything, people are unlikely to read resolved threads so you're unlikely to get an answer.

    If you want to ask a question start a new thread. You can include a link to an old thread if you think it will clarify your question.

    Since this particular thread keeps being resurrected I'm closing it.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

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