-
[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)
-
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:
PhoneNumber$ = "(123)456-7890"
Open "COM3" For Output As #1 'or what ever your modem's COM port is.
Print #1, "ATDT" & PhoneNumber$ & Chr$(13) 'Chr 13 is like 'Enter'
Close #1
-
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?
-
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.
-
Re: Dialing a phone number
I found this code, maybe it'll help you
VB Code:
Private Sub CancelButton_Click()
CancelFlag = True
CancelButton.Enabled = False
End Sub
Private Sub Dial(Number$)
Dim DialString$, FromModem$, dummy
DialString$ = "ATDT" + Number$ + ";" + vbCr
MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "COM2: Not available. Change the CommPort Property To another port."
Exit Sub
End If
MSComm1.InBufferCount = 0
MSComm1.Output = DialString$
Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
Beep
MsgBox "Please pick up the phone and either press Enter or click OK"
Exit Do
End If
End If
'got help from microsoft
If CancelFlag Then
CancelFlag = False
Exit Do
End If
Loop
MSComm1.Output = "ATH" + vbCr
MSComm1.PortOpen = False
End Sub
Private Sub DialButton_Click()
Dim Number$, Temp$
DialButton.Enabled = False
QuitButton.Enabled = False
CancelButton.Enabled = True
Number$ = InputBox$("Enter phone number:", Number$)
If Number$ = "" Then Exit Sub
Temp$ = Status
Status = "Dialing - " + Number$
Dial Number$
DialButton.Enabled = True
QuitButton.Enabled = True
CancelButton.Enabled = False
Status = Temp$
End Sub
Private Sub Form_Load()
MSComm1.InputLen = 0
End Sub
Private Sub MSComm1_OnComm()
End Sub
Private Sub QuitButton_Click()
End
End Sub
-
Re: Dialing a phone number
Hmm this isn't working either. Maybe it's just my modem :sick:
-
Re: Dialing a phone number
Ok, how would I use TAPI?
-
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
-
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!
-
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?
-
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?
-
[URGENT] MSComm Detect Phone Was Answered
Uh yeah so anyone know who to detect if the party your calling picked up the phone?
-
1 Attachment(s)
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.
-
Re: MSComm Detect Phone Was Answered
Give CVMicheal a pm, he will help you if he has time ;)
-
[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.
-
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?
-
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...
-
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?
-
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.
-
Re: MSComm Detect Phone Was Answered
That wont work. What about my idea for checking the voltage?
-
Re: MSComm Detect Phone Was Answered
I was wondering how does the computer know when you dialup a connection that it has been established?
-
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.
-
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 :p
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.
-
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 :cool: )
-
Re: [RESOLVED] MSComm Detect Phone Was Answered
hi
please give me the source
-
Re: [RESOLVED] MSComm Detect Phone Was Answered
Hi Datacide!
Could you please send me the link to detect phone pick up?
Thank you.
-
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
-
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.
-
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.