Error when calling a URL (1 Viewer)

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
I use the A13 runtime to run my software on a client's pcs and it is not easy to debug.

I am calling a URL from my software and this call would communicate with the telephony system and do a dial.

When I run my code I get,

"The expression On Click you entered as the property setting produced the following error: Return without GoSub
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."

The URL is as follows "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
where 12345678 is the telephone number which I want to call

The above URL works if I ran it from a browser and the dial goes ahead

I called the URL in two ways:

1)
Application.FollowHyperlink ("http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=99358535&outgoing_uri=URI"), "", False

2)
Code:
Dim xhr As Object
Dim webServiceURL As String
Dim thisRequest As String


webServiceURL = "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"


thisRequest = webServiceURL


'use late binding
Set xhr = CreateObject("Microsoft.XMLHTTP")


xhr.Open "GET", thisRequest, False
xhr.Send

If xhr.Status = 200 Then
   Debug.Print xhr.responseText
   MsgBox xhr.getAllResponseHeaders
Else
   MsgBox xhr.Status & ": " & xhr.statusText
End If


Set xhr = Nothing





Any ideas would be most welcome. Thanks.
 

strive4peace

AWF VIP
Local time
Today, 18:52
Joined
Apr 3, 2020
Messages
1,003
hi @JohnPapa

another option for calling phones is to add a MODEM (hardware) to your computer that's connected to your phone system. From Access, then you can use

Application.Run "utility.wlib_AutoDial", sPhoneNumber
This functionality is in Utility.MDA and now Utility.ACCDA, which comes with Access. Once Access dials the number, then you'd pick up your phone connected to the same system and talk.

A program I wrote for someone more than 20 years ago still uses this to call his clients using the phone number on the form in the ActiveControl (prior to clicking button to call since there are multiple phone numbers on the form)
 

bastanu

AWF VIP
Local time
Today, 16:52
Joined
Apr 13, 2010
Messages
1,401
Have you tried it without the brackets?

Application.FollowHyperlink "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=99358535&outgoing_uri=URI"
No need for the other two arguments as the first is empty and the second (NewWindow) already defaults to False.

Cheers,
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
Have you tried it without the brackets?

Application.FollowHyperlink "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=99358535&outgoing_uri=URI"
No need for the other two arguments as the first is empty and the second (NewWindow) already defaults to False.

Cheers,
Hi, which brackets are you referring to?

What "other two arguments" are you referring to? Please clarify.
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
hi @JohnPapa

another option for calling phones is to add a MODEM (hardware) to your computer that's connected to your phone system. From Access, then you can use

Application.Run "utility.wlib_AutoDial", sPhoneNumber
This functionality is in Utility.MDA and now Utility.ACCDA, which comes with Access. Once Access dials the number, then you'd pick up your phone connected to the same system and talk.

A program I wrote for someone more than 20 years ago still uses this to call his clients using the phone number on the form in the ActiveControl (prior to clicking button to call since there are multiple phone numbers on the form)
Thanks for your suggestion, but the setup is a dental clinic with 20 pcs and a brand new telephony system, so they would like to use their existing system.
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
Hi, which brackets are you referring to?

What "other two arguments" are you referring to? Please clarify.
Hi Bastanu
I saw what you mean about brackets and parameters. Thanks, will try.
 

bastanu

AWF VIP
Local time
Today, 16:52
Joined
Apr 13, 2010
Messages
1,401
You might also try this:
Code:
Dim strURL As String
strURL = "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
CreateObject("Shell.Application").Open CVar(strURL)
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
You might also try this:
Code:
Dim strURL As String
strURL = "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
CreateObject("Shell.Application").Open CVar(strURL)
I get no message when I ran the above command.

When I run

Application.FollowHyperlink "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=99358535&outgoing_uri=URI"

I get the message which appears in the attachment

When I place the following command in the browser, it works (a call is made to the selected telephone number in this case 99358535)

http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=99358535&outgoing_uri=URI
 

Attachments

  • Error.jpg
    Error.jpg
    26.5 KB · Views: 171

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
If it helps, I now get another message as indicated in the attachment.

The command that gives this message is

xhr.open "GET", webServiceURL, False
 

Attachments

  • Telephony.jpg
    Telephony.jpg
    19.2 KB · Views: 160

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954

bastanu

AWF VIP
Local time
Today, 16:52
Joined
Apr 13, 2010
Messages
1,401
When I try this modified version it opens this thread, can you try it?
Code:
Dim strURL As String
'strURL = "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
strURL = "https://www.access-programmers.co.uk/forums/threads/error-when-calling-a-url.323255/#post-1827172"
CreateObject("Shell.Application").Open CVar(strURL)
Have you checked the telephony system\API documentation?

Cheers,
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
When I try this modified version it opens this thread, can you try it?
Code:
Dim strURL As String
'strURL = "http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
strURL = "https://www.access-programmers.co.uk/forums/threads/error-when-calling-a-url.323255/#post-1827172"
CreateObject("Shell.Application").Open CVar(strURL)
Have you checked the telephony system\API documentation?

Cheers,
What you suggested works fine.

As I mentioned the URL I am trying to run has the Username and Password built in "admin:jTZ27imOh2". Might this be causing the problem?
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
What you suggested works fine.

As I mentioned the URL I am trying to run has the Username and Password built in "admin:jTZ27imOh2". Might this be causing the problem?
Will check what you suggested from the client's network. Maybe it is a problem with the network or a pc.

Also I have asked the telephony people to send me a URL without Username and Password. I believe the .send command has an option for the Username and Password.
 

Sodslaw

Registered User.
Local time
Today, 16:52
Joined
Jun 7, 2017
Messages
81
"http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
"....192.168.90.24..." is a local network addreass so it wouldnt for for anyone unless they are logged in via a vpn or on the local network.

do you get the same reults with ...

Code:
Application.FollowHyperlink "Http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
 
Last edited:

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
"http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
"....192.168.90.24..." is a local network addreass so it wouldnt for for anyone unless they are logged in via a vpn or on the local network.

do you get the same reults with ...

Code:
Application.FollowHyperlink "Http://admin:jTZ27imOh2@192.168.90.24/command.htm?number=12345678&outgoing_uri=URI"
If you look at #7 above, I believe I tried it, but will try it again.
And yes it is a private network and I have to do all the testing locally.
 

JohnPapa

Registered User.
Local time
Tomorrow, 01:52
Joined
Aug 15, 2010
Messages
954
I erroneously started a new thread on this and Gasman pointed it out, whom I thank.

I am now logged to the telephone system via VPN and I can test my code.

I am trying to automatically place a telephone call from within Access13.

If I place the following URL (used in the sub), the call is placed
"http://admin:q0FBzy4G4M@192.168.90.23/command.htm?number=99407373&outgoing_uri=URI"

I get the error message indicated in the attachment. A similar code for incoming calls are identified by A13. I can show this code if it would help.



Code:
Private Sub imgOut_Click()
Dim xhr As Object
Dim webServiceURL As String
Dim actionType As String
Dim thisRequest As String
Dim targetWord As String



'Dim strURL As String
'strURL = funGetStrOut()


webServiceURL = "http://admin:q0FBzy4G4M@192.168.90.23/command.htm?number=99407373&outgoing_uri=URI" 'strURL


thisRequest = webServiceURL


'use late binding
Set xhr = CreateObject("Microsoft.XMLHTTP")


xhr.Open "GET", thisRequest, False
xhr.Send


If xhr.Status = 200 Then
Debug.Print xhr.responseText
MsgBox xhr.getAllResponseHeaders
Else
MsgBox xhr.Status & ": " & xhr.statusText
End If



End Sub
 

Attachments

  • 220622.jpg
    220622.jpg
    18.5 KB · Views: 111

Gasman

Enthusiastic Amateur
Local time
Today, 23:52
Joined
Sep 21, 2011
Messages
14,048
I have to ask, if it is meant to be a url, why do you have uri ?
 

Users who are viewing this thread

Top Bottom