New Posts New Posts RSS Feed - Waiting for call to complete and then redialing?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Way2call telephony device is your ultimate telephony integration solution!

Waiting for call to complete and then redialing?

 Post Reply Post Reply
Author
mattj View Drop Down
Newbie
Newbie


Joined: Apr 15 2010
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattj Quote  Post ReplyReply Direct Link To This Post Topic: Waiting for call to complete and then redialing?
    Posted: Apr 20 2010 at 11:51am
I'm just a noob so there's probably a better method but i created a class. I have a few global vars to track different events.

Imports Way2call
Imports Way2call.Driver
Imports System.Threading
Public Class Cls_Events
    Public Sub WaitForConnection(ByVal DurationSec As Integer, ByVal DeviceID As Integer)
        MyCallDropped = False   'clear dropped call flag
        MyCallBusy = False      'clear number busy flag
        MyCallErrored = False   'clear call error flag
        MyCallConnected = False 'clear call connected flag

        Static start_time As DateTime = Now
        Dim elapsed_time As TimeSpan

        Do
            If MyCallConnected = True Then Exit Do 'exit loop if OnConnected event is fired
            If MyCallBusy = True Then Exit Do 'exit loop if the line is busy
            If MyCallDropped = True Then Exit Do 'exit loop if the call was dropped
            elapsed_time = Now.Subtract(start_time)
           
            ' operation timed out exit the loop
            If elapsed_time.TotalSeconds >= DurationSec Then Exit Do
            Application.DoEvents()
        Loop
    End Sub
End Class



then i did something like:

w2cErr = w2cDrv.Device(0).Call("w5558675309", True, True)
Dim CallEvent As New Cls_Events
CallEvent.WaitForConnection(40, 0)




Back to Top
stupid48 View Drop Down
Newbie
Newbie


Joined: Mar 09 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote stupid48 Quote  Post ReplyReply Direct Link To This Post Posted: Apr 01 2010 at 7:39pm
I'm writing a .net executable that will dial out.  If nobody answers, inside the same running application, I would like to redial.  The problem is, I don't know how to pause and wait for the first call to finish.  In the sample console application, there is a "goto" loop that allows the redial and the key to the loop is the line:

cki = Console.ReadKey(false);

So, the Console.ReadKey is pausing the thread while the software is dialing and waiting for someone to hit "a" to make a new call.  Does anyone know how to pause the thread in a windows .net application?
 
Thanks....Chris
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.