VBScript and event handling under WSH
Posted on 2009-04-24
I would like to write a VBScript program using WSH that waits for incoming calls and then processes them as they come in. I found the ActiveX controls that can deal with the telephony side of the application, but since it's a completely event driven application, what does the main part of the VBScript do while waiting for a call to come in and trigger an event? I imagine that if there was a way to ping/query for an incoming call, then I could write a while loop that sleeps for one second and then pings, although that seems so wasteful and inefficient. But I don't think I have that functionality anyway, which raises the question of how do I get VBScript to twiddle its thumbs (while waiting for an event to be triggered) until a call comes in? and if I do discover a function that can tell me if a call is coming in, is the while loop I described above the best way to handle that?