Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EventHandler() to TAPI 3 server always return .F.
Message
From
19/12/2008 04:15:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
EventHandler() to TAPI 3 server always return .F.
Miscellaneous
Thread ID:
01368745
Message ID:
01368745
Views:
121
I'm trying bind to events of TAPI 3 Server for incoming calls throw EVENTHANDLER() function, but always return .F.
Can someone post VFP code that run ok?

Thanks.

Sample of my code:
*
*
activate SCREEN
clear
*
public oTapi, oPhone, oEvent
oTapi = null
oPhone = null
oEvent = null
*
oTapi = newobject("TAPI.TAPI")
? "Initialize ...", oTapi.initialize()
oTapi.eventFilter = ;
                0x00000004 +;	&& CALLNOTIFICATION
	0x00000008 +;	&& CALLSTATE
	0x00008000 +;	&& DIGITEVENT
	0x00200000 +;	&& PHONEEVENT
	0x00000100 +;	&& REQUEST
	0x00010000 +;	&& GENERATEEVENT
	0x00800000		&& GATHERDIGITS
*					 	
? "eventFilter ...", oTapi.eventFilter
oPhone = oTapi.addresses(8)	&& "CallBridge TU" for Siemens
? "AddressName...", oPhone.addressname
*
oEvent = newobject("myEvent")
*
? "EventHandler ...", eventhandler(oTapi,oEvent)  && **********  ALWAYS .F. *****************
*
nHRegisterCallNotification = oTapi.RegisterCallNotifications(oPhone,.T.,.T.,0x8,2)

? "RegisterCallNotification ...", nHRegisterCallNotification
*
nInkey = 0
do while nInkey <> 32 and nInkey <> 27
	*
	doevents
	nInkey = inkey(2)
	? "Esperando ...", datetime(), oPhone.state
	*
enddo
*
? "UnregisterNotifications ..." ,oTapi.UnregisterNotifications(nHRegisterCallNotification)
*
eventhandler(oTapi,oEvent,.T.)
*
oTapi.shutdown()
*
oEvent = null
oPhone = null
oTapi = null
*
return 
*
*********************************
DEFINE CLASS myEvent AS session
**	IMPLEMENTS ITTAPIDispatchEventNotification IN "TAPI.TAPI"
	IMPLEMENTS ITTAPIEventNotification IN "TAPI.TAPI"
**	PROCEDURE ITTAPIDispatchEventNotification_Event(TapiEvent AS VARIANT, pEvent AS VARIANT) AS VOID
	PROCEDURE ITTAPIEventNotification_Event(TapiEvent AS VARIANT, pEvent AS VARIANT) AS VOID
 		*
		? "Evento ...", TapiEvent 
		do case
			case TapiEvent = 4
				?? "Call notification"
			case TapiEvent = 8
				?? "Call state"
		endcase		
 		*		
	ENDPROC
ENDDEFINE
*
*
Reply
Map
View

Click here to load this message in the networking platform