TAPI 3.0事件非提升
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TAPI 3.0事件非提升相关的知识,希望对你有一定的参考价值。
我是C#的菜鸟,所以请抱歉我的编码不好。我正在尝试使这个应用程序在呼叫发生时,它获取呼叫者的电话号码,它将使用它从CRM获取信息,然后,它从NotifyIcon创建一个气球,显示有关的信息呼叫者,召集者。 CRM连接和搜索电话号码工作正常,NotifyIcon也一样,但所有TAPI部分都无法正常工作。当我尝试用我的电话打电话给我的办公室Zoiper5号时,没有发生任何事件。
这是TAPI的类:
using System;
using System.Windows.Forms;
using TAPI3Lib;
namespace CallHelper
{
class TapiApplication : ApplicationContext
{
private static NLog.Logger logger =
NLog.LogManager.GetCurrentClassLogger();
private TAPIClass tapi;
private string number;
private Notification notification;
private ITAddress address;
public TapiApplication()
{
try
{
tapi = new TAPIClass();
tapi.Initialize();
//Notification.cs : handle the NotifyIcon
notification = new Notification();
tapi.ITTAPIEventNotification_Event_Event += new
ITTAPIEventNotification_EventEventHandler(callNotificationHandler);
tapi.EventFilter = (int) (TAPI_EVENT.TE_CALLNOTIFICATION);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
private void callNotificationHandler(TAPI_EVENT TapiEvent, object
pEvent)
{
try
{
ITCallNotificationEvent cne = pEvent as ITCallNotificationEvent;
number = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);
//creates the balloon containing the information of the caller
notification.showBalloon(number);
}
catch (Exception ex)
{
logger.Error(ex.Message);
tapi.Shutdown();
}
}
}
}
我真的不知道在哪里搜索;我在这里看过很多关于SOF的文章,而其他网站几乎都在谈论同样的事情,但是,我还没有解决。
谢谢你的帮助。
问题解决了。我错过了部分初始化。在传入呼叫事件中,您必须已初始化您希望接收通知的行,如此处所示ITTAPI::RegisterCallNotifications method您可以使用
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
您可以在ITAddress
中选择一个单独的tapi.Address as ITCollection
或cicle all地址,并为每个地址执行RegisterCallNotifications。在第一种情况下,只有当来电指示在您指定的地址行时,您才会收到通知,在第二种情况下,只要有任何地址有来电,您就会收到通知。
这个示例项目对我帮助很大:TAPI 3.0 Application development using C#.NET
我不确定你是否正在注册你想要的活动。我建议使用这里找到的Julmar Tapi 3.0 .Net包装器:https://github.com/markjulmar/itapi3。当您使用此包装器初始化Tapi时,它会注册所有事件并查找所有可用设备。
以上是关于TAPI 3.0事件非提升的主要内容,如果未能解决你的问题,请参考以下文章