Groups | Blog | Home
all groups > dotnet jscript > may 2005 >

dotnet jscript : How To Dial From a Web Page?



News Group
5/25/2005 12:00:00 AM
Hi,

Are there any examples (jscript or javascript) available which show how to
dial a telephone no. from a web page?

Thanks

Colin

Richard Cornford
5/25/2005 12:00:00 AM
[quoted text, click to view]

So public web sites can arrange for visitors to inadvertently phone
high-toll number belonging to the web site owners? It doesn't sound like
a good idea for that to be possible, and it is not.

Richard.

News Group
5/26/2005 12:00:00 AM
Hello and many thanks for the replies.

Yes, I can see how this could be abused.

In my naivety I was thinking more along the lines of customers hitting a key
to dial for support.

The VBScript is very interesting - Much appreciated.

I found this link at Experts Exchange:

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20709687.html

Titled: Dialing a number from a webpage Using windows dialer.

Unfortunately I am not currently a member.

Once again, thanks for the input.

Colin

[quoted text, click to view]
| Hi,
|
| Are there any examples (jscript or javascript) available which show how to
| dial a telephone no. from a web page?
|
| Thanks
|
| Colin
|
|

McKirahan
5/26/2005 6:16:26 AM
[quoted text, click to view]

Will this help? Watch for word-wrap.

Here's a VBScript adapted from this link:
'* http://www.developerfusion.com/show/194/
'* Use the MS Comm control to dial a telephone number.

I only got it to run stand-alone; not from within a Web page.

I tried to convert it to JavaScript but without success.


Call Dial("18005551212")

Sub Dial(Phone)
Dim DialString
DialString = "ATDT" + Phone + ";" + vbCr
Dim FromModem
Dim MSComm1
Set MSComm1 = CreateObject("MSCommLib.MSComm")
MSComm1.CommPort = 3
MSComm1.Settings = "9600,N,8,1"
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "COM" & MSComm1.CommPort & ": not available."
Exit Sub
End If
MSComm1.InBufferCount = 0
MSComm1.Output = DialString
Do
If MSComm1.InBufferCount Then
FromModem = FromModem + MSComm1.Input
'* Check for "OK".
If InStr(FromModem, "OK") Then
'* Notify the user to pick up the phone.
MsgBox "Please pick up the phone and either press Enter or
click OK"
Exit Do
End If
End If
Loop
MSComm1.Output = "ATH" + vbCr
MSComm1.PortOpen = False
Set MSComm1 = Nothing
End Sub

McKirahan
5/26/2005 6:24:54 AM
[quoted text, click to view]

Insert the following after "Do":
WScript.Sleep(1000)

AddThis Social Bookmark Button