I am trying to write a tapi application using VB6.0
The problem I am facing is that, as soon as i create a call and try to connect using ITCallControl.Connect method, the status shows as INPROGRESS and immediately DISCONNECTED without even dialing.
Ofcourse It dials the number if i don't hangup, but dosenot generate any events after that. SO i am not able to get further call status.
The above things are good because it dials the target phone number and it rings. The modem hangs up once i disconnect the phone.
But the program is not able to generate these events.
Here is the piece of code used to dial the number
The event is handled by implementing the TAPI object withevents.
Public Sub CallUser(pForm As Form)
Set gobjTapi = New TAPI
Dim objAddressCapabilities As ITAddressCapabilities
Const TAPI3_CALL_EVENTS = TE_CALLMEDIA Or TE_CALLNOTIFICATION Or TE_CALLSTATE _
Or TE_ADDRESS Or TE_REQUEST Or TE_TAPIOBJECT Or TE_CALLHUB Or TE_DIGITEVENT Or TE_PRIVATE _
bFound = False
For indexAddr = 1 To objCollAddresses.Count
Set objCrtAddress = objCollAddresses.Item(indexAddr)
Set objMediaSupport = objCrtAddress
Set objAddressCapabilities = objCrtAddress
If objMediaSupport.QueryMediaType(lMediaTypes) Then
bFound = True
Set objAddressCapabilities = Nothing
Set objMediaSupport = Nothing
Set objCrtAddress = Nothing
If bFound = True Then Exit For
Set gobjAddress = objCollAddresses.Item(indexAddr)
glRegistrationToken = gobjTapi.RegisterCallNotifications(gobjAddress, fMonitor, fOwner, lMediaTypes, lCallbackInstance)
If glRedistrationToken = S_OK Then
Debug.Print "Registration OK"
Set pForm.gobjTapiWithEvents = gobjTapi
Set objCallControl = gobjAddress.CreateCall("00624241599", 1, lMediaTypes)
gobjTapi.SetApplicationPriority App.EXEName, lMediaTypes, True