views:

34

answers:

2

We have just purchased some software that provides an API into our phone system allowing us to dial, hangup etc.. The API was designed to be used client side (internet explorer / activex). We want to use this server side and execute the dial commands via an ajax call to a classic ASP script.

The basic VBScript for initialising the component is as follows:

<%
 set objPhone = server.createobject("XariosPhoneManager.PhoneManager")
 objPhone.RemoteHost = "192.168.0.17"
 objPhone.RemotePort = "2001"
 objPhone.OAIPassword = ""
 objPhone.Extension = "1000"
 objPhone.Initialise()
 set objPhone = nothing
 %>

but I can't call the dial command

objPhone.MakeCall("1001")

until the "initialised" event has happened. Is there a way in classic ASP to wait for an event to fire before executing some code?

A: 

I don't know anything about this component so the following involves some guesswork.

1) If the component has a property to track when it is initialised, you can check that and once it is initialised, call the MakeCall method.

2) I am guessing that the component has a OnInitializedComplete event(or something like that), if so, write your server side code in JScript and assign a function to the event.

DaveB
turns out it simply isn't possible in ASP. There's no property exposed that says the component is initialised, just the initialised event that fires. Unfortunately ASP cannot detect events. The developer has suggested wrapping their component in a new DLL that takes care of the event management, but I don't have the resources to do that. They have promised true serverside capability in a future version of the software.
Neil Burton
A: 

turns out it simply isn't possible in ASP. There's no property exposed that says the component is initialised, just the initialised event that fires. Unfortunately ASP cannot detect events. The developer has suggested wrapping their component in a new DLL that takes care of the event management, but I don't have the resources to do that. They have promised true serverside capability in a future version of the software

Neil Burton